# graphviz-wasm

> A port of Graphviz to WASM.

Latest version **3.0.2** (published 2024-04-04) · 0 weekly downloads

## Install

```sh
npm install graphviz-wasm
pnpm add graphviz-wasm
yarn add graphviz-wasm
bun add graphviz-wasm
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2024-04-04 |
| First published | 2021-12-27 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | fabiospampinato |
| Keywords | graphviz, wasm, dot |

## Links

- npm: https://www.npmjs.com/package/graphviz-wasm
- Repository: https://github.com/fabiospampinato/graphviz-wasm
- Homepage: https://github.com/fabiospampinato/graphviz-wasm#readme
- Issues: https://github.com/fabiospampinato/graphviz-wasm/issues
- npm.io page: https://npm.io/package/graphviz-wasm

## Dependencies (2)

- [decode-base64](https://npm.io/package/decode-base64.md) ^3.0.1
- [function-once](https://npm.io/package/function-once.md) ^3.0.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2024-04-04
- 3.0.1 — 2023-08-24
- 3.0.0 — 2022-04-08
- 2.0.2 — 2022-03-25
- 2.0.1 — 2021-12-28
- 2.0.0 — 2021-12-27
- 1.0.0 — 2021-12-27

## README

# Graphviz WASM

A port of Graphviz to WASM.

Note: this is currently just a light wrapper around [`@hpcc-js/wasm`](https://www.npmjs.com/package/@hpcc-js/wasm), you might want to consider just using that directly. The plan is to eventually generate custom bindings to graphviz, optimized for speed and size, and depending on your use case you'd import the right one.

## Install

```sh
npm install --save graphviz-wasm
```

## Usage

This is how you'd use the library:

```ts
import graphviz from 'graphviz-wasm';

await graphviz.loadWASM (); // First of all you need to load the WASM instance and wait for it

const dot = `
  strict graph {
    a -- b
    a -- b
    b -- a [color=blue]
  }
`;

const svg = graphviz.layout ( dot );
```

This is the interface of the `layout` method:

```ts
type Engine = 'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' | 'sfdp' | 'twopi';

type Format = 'dot_json' | 'dot' | 'json' | 'plain-ext' | 'plain' | 'svg' | 'xdot_json';

type layout = ( source: string, format: Format = 'svg', engine: Engine = 'dot' ) => string;
```

## License

- **Graphviz**: EPL © [Graphviz](https://gitlab.com/graphviz/graphviz/-/blob/main/LICENSE).
- **WASM Port**: Apache © [hpcc-js-wasm](https://github.com/hpcc-systems/hpcc-js-wasm/blob/trunk/LICENSE).
- **Rest**: MIT © Fabio Spampinato.

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