Reputation: 593
This is the first time I am using D3 and was wondering whether someone could explain how I can create the Bilevel Partition with only two layers.
A complete & not complete section. then the complete section shows avergae corrrect and incorrect.
I've had a look at this code http://bl.ocks.org/mbostock/5944371
but I am not fully aware of what it does.
Upvotes: 1
Views: 1066
Reputation: 1626
The code doesn't really care what data you throw at it, as long as it is formatted the way it expects.
Right now, this is the JSON file it is loading in.
Make your own JSON file that looks like
{
"name": "sections",
"children": [
{
"name": "complete",
"children": [
{"name": "correct", "size": 10},
{"name": "incorrect", "size": 30}
]
},
{
"name": "incomplete",
"size": 20
}
]
}
And see if it works when you load that in instead of flare.json. If you load the file locally, use firefox to check out the code, chrome will block requests for local files.
I have it working somewhat on tributary, you can change the data and the code, and fork it if you want to save your edits. here it is
Upvotes: 2