JS-modulesnetflow-circular
1.5.2 · API 1

netflow-circular

The circular views of Netflow Map as a netflow-engine add-on: Chord (arcs and bands as wide as what each link carries, with an order searched for fewer crossing bands) and Bundles (links bent along the tree so links that go the same way run together).

What it is and how it works

Load order: netflow-scene.js, then netflow-hierarchy.js, then netflow-circular.js (this module draws through netflow-scene).

The circular views of Netflow Map as an add-on for netflow-engine: Chord and Bundles.

Why it exists

Who sends how much to whom, and which parts of a map talk to each other, read best around a circle. Kept here, the app and any other page use one tested copy. Netflow Map keeps the views built in.

Where it helps

Not for: maps where position along a route matters; use the layered views.

How it compares

Against d3-chord 3.0.1, measured by Netflow Map on its own copy of this code (the same layouts to the last digit) in the cloud test browsers, random flows with 4 links per item: with the order kept (no search, like d3) it takes 0.3 to 1.0 of d3's time. With the crossing search it takes 3.5 to 15 times d3's time and its bands cross 53%, 16% and 3% less at 20, 60 and 200 items (weighted: two crossing bands count the smaller amount); d3-chord keeps the order it is given. The crossing count was made 3 to 4 times faster before this release.

How to use it

Use

// netflow-scene.js, netflow-hierarchy.js, then netflow-circular.js
var L = NetflowCircular.layout('chord', { nodes: nodes, edges: edges }, { chordBy: 'auto' });   // searches the order; chordOrder: 'fast' keeps it
var S = NetflowCircular.scene(L, { theme: 'dark' }, NetflowScene);

Use with netflow-engine: load the files as page scripts (or keep the folders side by side in Node) and the views join NetflowEngine.VIEWS; or hand them over with NetflowEngine.use('circular', NetflowCircular). Then NetflowEngine.build(graph, { view: 'chord' }) lays the map out and NetflowCircular.scene(L, options, NetflowScene) draws it.

Use

// netflow-scene.js, netflow-hierarchy.js, then netflow-circular.js
var L = NetflowCircular.layout('chord', { nodes: nodes, edges: edges }, { chordBy: 'auto' });   // searches the order; chordOrder: 'fast' keeps it
var S = NetflowCircular.scene(L, { theme: 'dark' }, NetflowScene);

Use with netflow-engine: load the files as page scripts (or keep the folders side by side in Node) and the views join NetflowEngine.VIEWS; or hand them over with NetflowEngine.use('circular', NetflowCircular). Then NetflowEngine.build(graph, { view: 'chord' }) lays the map out and NetflowCircular.scene(L, options, NetflowScene) draws it.

Speed and efficiency numbers

Against d3-chord, cloud-browser runs

Chord layout of a dense random matrix (400 x 400, 79,795 links), a fresh page for every library, alternating pages (7 in Chromium and Firefox, 2 in WebKitGTK; d3-chord from the same test), shared 4-core cloud machine. Each library gets its native input (matrix for d3-chord, links for netflow-circular, fast order). Lower is faster.

Compared: netflow-circular against d3-chord 3.0.2 (chord layout, 400 x 400 matrix, ms).

netflow-circular lays out a dense 400 x 400 chord in 14 to 23 ms against 25 to 54 for d3-chord, ahead in all three browsers
Chromium 156
d3-chord29.3
netflow-circular18
Firefox 158
d3-chord24.8
netflow-circular14.3
WebKitGTK 2.52.6
d3-chord54
netflow-circular23

These are the default settings. The band objects (chart.flows) are made the first time they are read, and drawing with scene() does not need them; the optional typed: true setting, which returns the bands as typed arrays, takes about the same time (18.7, 15.4 and 24 ms). The work is not identical: d3-chord makes one ribbon per pair (79,795 chords) and netflow-circular one band per direction with drawing geometry (158,061 bands), about twice the output. netflow-circular also offers bundles, grouped arcs, drawing lists and an order search that d3-chord does not. The WebKitGTK number for netflow-circular is from 2 pages only, so treat it as direction. A 150 x 150 matrix was not re-measured.

Size (esbuild minified, gzip -9, measured at 1.5.2): d3-chord 3.0.1 is 1.6 KB gzipped (2.7 KB with d3-path 3.1.0); netflow-circular is 6.4 KB (it also has Bundles and the crossing search), or 20.7 KB with netflow-hierarchy that it builds on (14.3 KB).

Source: Against d3-chord, cloud-browser runs.

Credits

The code is Netflow Map's own (LFC Foundry), cut out for this module; no code from other projects. d3-chord was the speed comparison only.

Original sources (links checked 2026-11-14; ideas only):

Original sources (links checked 2026-11-14; ideas only unless the section above says code is included):