graphviz-worker

1.1.0 • Public • Published

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.

Package Sidebar

Install

npm i graphviz-worker

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

1.23 MB

Total Files

7

Last publish

Collaborators

  • xtwan