0.5.5 • Published 2 years ago

svg-flowgraph v0.5.5

Weekly downloads
60
License
Apache-2.0
Repository
github
Last release
2 years ago

svg-flowgraph

svg-flowgraph provides the basic blueprints for doing customizable renderings for small-to-medium graphs (up to ~500 nodes). It provides the scaffolding, data management, and utilities to abstract out the common chores for building interactive graphs so you can focus on the rendering aspect.

Note svg-flowgraph is NOT a layout engine, you need to write your own layout heuristics, or use an off-the-shelf algorithm. We have used svg-flowgraph with ELK-JS (https://github.com/kieler/elkjs).

example1

The example provided here uses Dagre (https://github.com/dagrejs/dagre).

example2

Usage

Data format

Events

These event hooks are emitted for customizing logic, emitters send back these parameters: eventName, event object, selection, renderer object.

  • node-click
  • node-dbl-click
  • node-mouse-enter
  • node-mouse-leave
  • node-drag-start
  • node-drag-move
  • node-drag-end
  • edge-click
  • edge-mouse-enter
  • edge-mouse-leave
  • background-click, also sends clicked coordinates
  • background-dbl-click, also send clicked coordinates

Example:

renderer.on('node-dbl-click', (name, evt, selection, renderer) => {
  selection.selectAll('text').style('font-size', 15);
});

Build

npm run build

Test

npm run develop

0.5.4

2 years ago

0.5.5

2 years ago

0.5.3

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.5

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago