graphviz-worker
v1.1.0
Published
A web worker version of the [@hpcc-js/wasm](https://hpcc-systems.github.io/hpcc-js-wasm/classes/graphviz.Graphviz.html#class-graphviz) library.
Downloads
2
Maintainers
Readme
GraphvizWorker
A web worker version of the @hpcc-js/wasm library.
USAGE
npm install graphviz-worker
import Graphviz from "graphviz-worker";
const graphviz = new Graphviz();
const dotSource = "digraph G { Hello -> World }";
const jsonStr = await graphviz.layout(dotSource)
API
layout
layout(dotSource, outputFormat?, layoutEngine?, options?): string
Parameters
| Name | Type | Default value | Description |
| :------------- |:------------------------------------------------------------------------------------------|:--------------| :----------------------------------------------------------- |
| dotSource
| string
| undefined
| Required - graph definition in DOT language |
| outputFormat
| Format
| "json"
| The format of the result. |
| layoutEngine
| Engine
| "dot"
| The type of layout to perform. |
| options?
| Options
| undefined
| Advanced Options for images, files, yInvert and nop. |
destroy
destroy(): void
Destroy the web worker.
Types
Format
Format: "svg" | "dot" | "json" | "dot_json" | "xdot_json" | "plain" | "plain-ext"
Various graphic and data formats for end user, web, documents and other applications. See Output Formats for more information.
Engine
Engine: "circo" | "dot" | "fdp" | "sfdp" | "neato" | "osage" | "patchwork" | "twopi"
Various algorithms for projecting abstract graphs into a space for visualization. See Layout Engines for more details.