Skip to content

Getting data of selected node returned after d3.select #232

@manav-bhanot

Description

@manav-bhanot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions