Skip to content

kanesee/d3-2way-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

d3-2way-tree

d3 implementation of a 2-way tree.

It extends Mike Bostock's D3 tree layout example

This is essentially a graph focused on a single root node that you want to display its parents and children for. Unlike other D3 graphs, there is a static up/down direction of the tree fanout, which informs the user of parent vs child nodes.

An example of the input data is found in sample.json. This is a snapshot of the wikipedia category "Airlines". The visualization shows some of the subcategories of "Airlines" as well as the categories of "Airlines".

{
    "name": "Airlines",
    "parents": [
        {
            "name": "Aviation",
            "isparent": true
        },
        {
            "name": "Transparent_companies",
            "isparent": true
        },
        {
            "name": "Transport_operators",
            "isparent": true
        }
    ],
    "children": [
        {
            "name": "Airline_alliances",
            "isparent": false
        },
        {
            "name": "Airlines_by_continent",
            "isparent": false
        },
        {
            "name": "Airlines_by_type",
            "isparent": false
        },
        {
            "name": "Defunct_airlines",
            "isparent": false
        }
    ]
}

About

d3 implementation of a 2-way tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages