View on GitHub

d3-easy

download .ZIPdownload .TGZ

Generate Hierarchical Edge Bundling

Hierarchical Edge Bundling is the best way to vidualize interactive relationships. The base is created by mbostock. The purpose of this library is giving you the way to vidualize data without knowledge of d3.js.
=> Original Codes of mbostock

Preparation

How to use

Below is the simplest case, but be careful. makeHierarchicalEdge would fail if your pointer name does not exist. Please make sure all the names in imports exist in the name list.

// simple example
var data = [
  {"name":"tanaka","imports":["higashi"]},
  {"name":"higashi","imports":["suzuki","toudou"]},
  {"name":"suzuki","imports":["tanaka", "higashi"]},
  {"name":"toudou","imports":["tanaka", "higashi", "suzuki"]}
]

makeHierarchicalEdge(data, 300, 200, 10, 30)

With more options

// more option example
var data = [
  {"name":"tanaka","imports":["higashi"]},
  {"name":"higashi","imports":["suzuki","toudou"]},
  {"name":"suzuki","imports":["tanaka", "higashi"]},
  {"name":"toudou","imports":["tanaka", "higashi", "suzuki"]}
]

var dom_classes = {
      "node": "node_default",
      "link": "link_default",
      "in_node": "linked_node",
      "out_node": "linking_node",
      "in_link": "linked",
      "out_link": "linking"
    }

makeHierarchicalEdge(data, 300, 200, 10, 30, dom_classes)

Parameters Format

ParameterMust Or NotType of Format
DataMust[ {"name": String, "imports": [string, ...]}, {...}, {...} ]
innerRadiusMustinteger
thickness(outer radius - inner radius)Mustinteger
minFontMustinteger
maxFontMustinteger
dom classesMust{ "node": string, "link": string, "in_node": string, "out_node": string, "in_link": string, "out_link": string }

For More Details

To see whole the example, please check out demo.html and demo.js