vizulySeptember 12, 2017 at 9:18 am #8048
You will want to use the source code files to start your modifications (versus the minified files)
The tree is being rendered in SVG, which draws primitive graphics (rectangles, circles, paths, etc) but SVG does not support widgets like buttons. You could simulate a button by drawing a rectangle, and adding border treatments etc that then responds to user input (clicking, mouse-over etc.) but that is beyond the scope of what would be easy to explain via a forum.
The place you would want to add this coded is in the viz/weighted_tree.js file in the “update()” function which is responsible for adding/updating/removing the tree nodes and branches.
Alternatively, the tree currently emits an event when a user clicks on a node, and it is simple enough to trap this event and respond to it accordingly. This would alleviate the need to add a button to each node.
I hope that helps,
You must be logged in to reply to this topic.
© 2021 — vizuly.io