Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 664 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 664 Bytes

A Tiny Typescript Wrapper for mxgraph

Overview

A tiny wrapper around mxgraph that provides a configurable TypeScript compatible package.

Usage

npm i -D ts-mxgraph
import { mxgraph, mxgraphFactory } from "ts-mxgraph";

const { mxGraph, mxGraphModel } = mxgraphFactory({
    mxLoadResources: false,
    mxLoadStylesheets: false,
});

const container = document.getElementById("mxgraph-container");
if (container) {
    const model: mxgraph.mxGraphModel = new mxGraphModel();
    const graph: mxgraph.mxGraph = new mxGraph(container, model);
}

License

Apache 2.0 License