mxGraph Typescript Declarations For Official mxGraph NPM Package.
-
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
-
Update
tsconfig.json
appendnode_modules/@typed-mxgraph
totypeRoots
:{ "compilerOptions": { "target": "es5", "module": "commonjs", "esModuleInterop": true, "typeRoots": [ "node_modules/@types", "node_modules/@typed-mxgraph" ] } }
-
Import mxGraph factory:
import factory from 'mxgraph'; const mx = factory({ mxBasePath: '', }); console.log(mx.mxClient.VERSION);
The definitions currently target mxGraph 4.1.1
. See the implementation status in the following table.
- progress: initial support
- not yet: no support at all
- partial: implementation started but some classes/fields/methods are missing
- completed: all classes/fields/methods should exist (fill an issue and/or provide a Pull Request if you detect an issue) but
- TSDoc is not fully accurate
- some type declaration may be wrong
- checked: a finest review has been conducted about TSDoc, mxGraph types used by functions/methods, fields, ...
Module | Progress | Checked |
---|---|---|
editor | partial | no |
handler | completed | no |
io | completed | no |
layout | completed | no |
model | completed | no |
shape | completed | no |
util | partial | no |
view | partial | no |
mxClient.d.ts | completed | no |
We are actively developing, if you want to be a contributor, please refer to the following links