d3-flame-graph icon indicating copy to clipboard operation
d3-flame-graph copied to clipboard

Getting data of selected node returned after d3.select

Open manav-bhanot opened this issue 7 months ago • 0 comments

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 element in DOM) to display a boundary around it. Refer screeshot 1 below

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

  1. Focussed Node Screenshot 2024-07-17 at 14 58 35

Smartphone (please complete the following information): N.A.

Additional context N.A.

manav-bhanot avatar Jul 17 '24 22:07 manav-bhanot