d3-flame-graph
d3-flame-graph copied to clipboard
Getting data of selected node returned after d3.select
Describe the bug
I am trying to enable keyboard navigation (using arrow and w,a,s,d keys) on the d3-flame-graph. Initially I click one of the nodes in the flame graph and then in clickHandler, add a focussed
CSS class to that node (represented by
Now on press of a key, I fetch the existing focussable node using d3-selection. eg select('.d3-flame-graph').select('svg').select('.focussed').node()
but the .datum()
property of the node does not give me the data for that node. Instead it returns the root node of the tree
Am I missing anything ? How can I get the corresponding node data ?
Screenshots
- Focussed Node
Smartphone (please complete the following information): N.A.
Additional context N.A.