user3506938
user3506938

Reputation: 593

Bilevel Partition D3 create a simple 2 layer

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

enter image description here

but I am not fully aware of what it does.

Upvotes: 1

Views: 1066

Answers (1)

elsherbini
elsherbini

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

Related Questions