# svg-flowgraph

> SVG graph blueprint/renderer

Latest version **0.5.5** (published 2022-06-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install svg-flowgraph
pnpm add svg-flowgraph
yarn add svg-flowgraph
bun add svg-flowgraph
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.5 |
| Published | 2022-06-20 |
| First published | 2020-12-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 243.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | mwdchang, kbranigan |
| Keywords | graph, svg |

## Links

- npm: https://www.npmjs.com/package/svg-flowgraph
- Repository: https://github.com/mwdchang/svg-flowgraph
- Homepage: https://github.com/mwdchang/svg-flowgraph#readme
- Issues: https://github.com/mwdchang/svg-flowgraph/issues
- npm.io page: https://npm.io/package/svg-flowgraph

## Dependencies (2)

- [d3](https://npm.io/package/d3.md) ^7.1.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.5.5 (latest) — 2022-06-20
- 0.5.4 — 2022-06-16
- 0.5.3 — 2022-04-21
- 0.5.2 — 2022-02-14
- 0.5.0 — 2022-01-08
- 0.4.8 — 2021-10-22
- 0.4.7 — 2021-10-19
- 0.4.6 — 2021-08-16
- 0.4.5 — 2021-08-16
- 0.4.4 — 2021-07-13
- 0.4.3 — 2021-06-09
- 0.4.2 — 2021-06-09
- 0.4.1 — 2021-06-08
- 0.4.0 — 2021-06-07
- 0.3.0 — 2021-03-26
- … 4 more at https://npm.io/package/svg-flowgraph/versions

## README

## 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](example1.png)

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

![example2](example2.png)


### 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

---
_Source: https://npm.io/package/svg-flowgraph · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
