Skip to main content
100%

Chord - source, target, value

✓ Published0🌍 Public
NNPashaP
Last edited Jul 31, 2016
Created on Jul 4, 2016

Two chord diagrams display directional flows between five countries using data from a static array of source, target, and value triples. The left diagram uses default accessors (`d=>d[0]`, `d=>d[1]`, `d=>d[2]`), while the right overrides them with `viz.ch().source`, `.target`, and `.value` functions, doubling the value and reversing source/target. Rendered as SVG via d3.v4 and VizJS, each diagram uses a custom `fill` function mapping country names to colors, and both are placed side-by-side in a single SVG canvas.

AI-generated description

viz.ch().source, viz.ch().target, viz.ch().value

These methods can be used to set the accessor functions for the source, target, and values in the data array.

The diagram on the left uses the default accessors d=>d[0], d=>d[1], and d=>d[2] for source, target and value respectively.

The diagram on the right over rides these deafults.

Part of a series of examples on Chord diagram using VizJS

gpl-3.0 Licensed

Similar vizzes