I created my own Json file to use with the collapsible tree in d3. I have three extra fields in the file for each child. I created one for one root node that has three children. Each of those children have leaves, and ends there, so a total of three levels.
I am stuck as being able to load the json. I have ran the code with the original flare.json, so all else is working. I have the same json pasted below. Thank you!
UPDATE: I was able to deal with this by copy/pasting the json into the html to create a variable as in this question: How to load data from an internal JSON array rather than from an external resource / file for a collapsible tree in d3.js? It works, though not ideal as I have a large json list.
Here is a pastebin link of my html code: http://pastebin.com/njdfrwhf Thanks!
{
"name": "checkD",
"children": [
{
"name": "XX.YY.IP1",
"children": [
{"name": "xxx.yyy.1", "distance": 1, "CC": "US", "m":0},
{"name": "xxx.yyy.2", "distance": 1.8, "CC": "US", "m":0},
{"name": "xxx.yyy.3", "distance": 4.5, "CC": "US", "m":0},
{"name": "xxx.yyy.4", "distance": 2.5, "CC": "US", "m":0},
{"name": "xxx.yyy.5", "distance": 1, "CC": "US", "m":0},
{"name": "xxx.yyy.6", "distance": 2, "CC": "US", "m":0},
{"name": "xxx.yyy.7", "distance": 1, "CC": "US", "m":0},
{"name": "xxx.yyy.8", "distance": 3, "CC": "US", "m":1},
{"name": "xxx.yyy.9", "distance": 1, "CC": "US", "m":1},
{"name": "xxx.yyy.10", "distance": 5, "CC": "US", "m":1}
]
},
{
"name": "XX.YY.IP2",
"children": [
{"name": "xxx.yyy.1", "distance": 1, "CC": "US", "m":0},
{"name": "xxx.yyy.2", "distance": 1.8, "CC": "US", "m":1},
{"name": "xxx.yyy.3", "distance": 2, "CC": "US", "m":1},
{"name": "xxx.yyy.4", "distance": 4.3, "CC": "US", "m":1},
{"name": "xxx.yyy.5", "distance": 5, "CC": "US", "m":0},
{"name": "xxx.yyy.6", "distance": 2, "CC": "US", "m":0},
{"name": "xxx.yyy.7", "distance": 1.3, "CC": "US", "m":0},
{"name": "xxx.yyy.8", "distance": 3, "CC": "US", "m":1},
{"name": "xxx.yyy.9", "distance": 4, "CC": "US", "m":1},
{"name": "xxx.yyy.10", "distance": .5, "CC": "US", "m":1}
]
},
{
"name": "XX.YY.IP3",
"children": [
{"name": "xxx.yyy.1", "distance": 1, "CC": "US", "m":0},
{"name": "xxx.yyy.2", "distance": 1.8, "CC": "US", "m":0},
{"name": "xxx.yyy.3", "distance": 2, "CC": "US", "m":0},
{"name": "xxx.yyy.4", "distance": 4.3, "CC": "US", "m":0},
{"name": "xxx.yyy.5", "distance": 5, "CC": "US", "m":0},
{"name": "xxx.yyy.6", "distance": 2, "CC": "US", "m":0},
{"name": "xxx.yyy.7", "distance": 1.3, "CC": "US", "m":0},
{"name": "xxx.yyy.8", "distance": 3, "CC": "US", "m":0},
{"name": "xxx.yyy.9", "distance": 4, "CC": "US", "m":0},
{"name": "xxx.yyy.10", "distance": .5, "CC": "US", "m":0}
]
}
]
}