JSON format - Adapt data to myvisualization - JSVIZ 3.4

Hi,

 

I have this data table:

Cod Imp Cod Sez
IM_A SZ_A
IM_A SZ_B

and I would like to visualize these data as "Collaspible tree" graph using Javascript Visualization framework (3.4 version) as in image.

Actually I use d3.js code to create a graph (in attach "collapsibletree.txt" to see a code).

The problem is that the structure of JSON file mismatch to structure format that use the code d3.js. I need that the structure data of JSON file become: 

var treeData = [
  {
    "name": "Top Level",
    "parent": "null",
    "children": [
      {
        "name": "Level 2: A",
        "parent": "Top Level",
        "children": [
          {
            "name": "Son of A",
            "parent": "Level 2: A"
          },
          {
            "name": "Daughter of A",
            "parent": "Level 2: A"
          }
        ]
      },
      {
        "name": "Level 2: B",
        "parent": "Top Level"
      }
    ]
  }
];

 

How can I do?

 

Thank a lot!

M.

 

Attachments

AttachmentSize
Image icon collapsibletree.png37.46 KB
Plain text icon collapsibletree.txt4.05 KB

1 Comment

Hi Marco:

I have the same problem, did you get adapt the data? 

Thanks in advanced!

 

 

aurrego - Dec 17, 2018 - 12:57pm
+ Add a Comment
Login