Sunday, 7 October 2018

Customize nodes on d3 tree chart (styling and event listener)

I am still on my chart, and I need to default close the level 2 & 3 nodes, and keep the expand/collapse function on click.

On mouseover show a popup and open my link if clicked. My link must be a value of my data object (var pubs in my codepen) as you can see bellow (level 0 has no link, "TOOLS" in my example) :

{
    "name": "TOOLS",
    "children": 
      [
        {
            "name": "Localization",
            "url": "http://#",
            "children":             
                [
                   {"name": "FRANCE", "url": "http://france.fr"}
...

Finaly another event listener on "mouseover" to do some styling on the node (closed or open) etc...

My current code : https://codepen.io/anon/pen/BqjJJv



from Customize nodes on d3 tree chart (styling and event listener)

No comments:

Post a Comment