Skip to content

Latest commit

 

History

History
48 lines (42 loc) · 1.5 KB

README.md

File metadata and controls

48 lines (42 loc) · 1.5 KB

Typed mxGraph

Build npm version GitHub license

mxGraph Typescript Declarations For Official mxGraph NPM Package.

Usage

  1. Add mxgraph and @typed-mxgraph/typed-mxgraph dependencies to your project:

    npm:

     npm install --save mxgraph
     npm install --save-dev @typed-mxgraph/typed-mxgraph

    yarn:

    yarn add mxgraph
    yarn add --dev @typed-mxgraph/typed-mxgraph
  2. Update tsconfig.json append node_modules/@typed-mxgraph to typeRoots:

    {
      "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "esModuleInterop": true,
        "typeRoots": [
          "node_modules/@types",
          "node_modules/@typed-mxgraph"
        ]
      }
    }
  3. Import mxGraph factory:

    import factory from 'mxgraph';
    
    const mx = factory({
      mxBasePath: '',
    });
    console.log(mx.mxClient.VERSION);