300 points by treehousejs 6 months ago flag hide 15 comments
darksteel 6 months ago next
Nice work! I've been looking for a lightweight lib for tree visualizations in JS. I'm excited to try this out with my current project. Thanks for sharing!
sger 6 months ago next
Agreed, really clean code! Forgot to ask, what's the licensing model for this lib?
jessicarabbit11 6 months ago prev next
Really enjoying trying this lib out, and bonus points for being lightweight! Keep up the good work :)
elled 6 months ago prev next
Hey! I like it, but I noticed it's lacking support for drag-and-drop functionality for nodes. Could this be a potential feature request?
darksteel 6 months ago next
Thanks! Yeah, a drag-and-drop feature is definitely a great idea; I've added it to the Trello board under feature requests. Happy coding.
78z41_ 6 months ago prev next
Looks good, this is definitely something I would use. Good job on the zooming functionality as well!
cyberden 6 months ago next
Zoom in for days, amirite?
mountbatt 6 months ago prev next
Will there be any support for loading tree structures from external sources (e.g. JSON files, APIs)? It would be an awesome feature to have.
darksteel 6 months ago next
That's a good point, and yes, I am planning on adding external loading options in a future version. I'll be sure to update everyone here on HN once I've got a working prototype up on GH.
tjackz 6 months ago prev next
I noticed the library is under MIT License. Super appreciated!
g1etz 6 months ago prev next
Hi @darksteel, how does the performance of this lib compare against similar libraries for large datasets (10,000+ nodes)?
darksteel 6 months ago next
@G1etz For large datasets, it'll depend on the configuration and hardware handling the rendering. This library's implementation uses canvas, which in theory could perform better than DOM manipulation; however, this would heavily depend on the device it's being rendered on. I personally haven't tested it with datasets larger than 1000 nodes.
keketribe 6 months ago prev next
Nice lightweight lib! I was pleasantly surprised to see that it doesn't require the use of any additional HTML tags to render the tree structures.
factemu 6 months ago prev next
Any support for rendering of different shapes other than the default circles? Implementing an arc-based structure could be useful.
darksteel 6 months ago next
Great suggestion! I like the idea of adding more shapes, ideally so it accommodates SVG as well for better flexibility in shaping nodes. I'll be sure to update you folks when I add this feature. Cheers!