lgleim / mxgraph-typings Goto Github PK
View Code? Open in Web Editor NEWTypescript Type Definitions / Typings for https://github.com/jgraph/mxgraph
License: MIT License
Typescript Type Definitions / Typings for https://github.com/jgraph/mxgraph
License: MIT License
Hi Lars,
I'm trying to implement your example
const mx = require('mxgraph')({
mxImageBasePath: 'mxgraph/images',
mxBasePath: 'mxgraph'
});
and am getting "Module not found: Error: Can't resolve 'mxgraph'".
I'm building with Angular CLI / Webpack.
The following is my tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2016",
"lib": [
"es6",
"dom"
],
"traceResolution": true,
}
Any suggestions?
Thanks
Dave
Lars,
This looks like a great start to typings in mxGraph. it looks like there is a slight issue with the way that modules work in typescript now. when I try to use the library with import {mxCell} from 'mxgraph'
I get the error 'No exported member' however if i remove the export module mxgraph {}
from the index.d.ts it works as expected.
Can you provide some example documentation on how you are utilizing the typings?
Nic
Hi @lgleim
We have recently started a dedicated community initiative to provide mxGraph type definitions through the DefinitelyTyped project.
Would you agree to join?
Your repository is probably the most forked and used on GitHub, has received several external contributions so we would be pleased to get your feedbacks on mxgraph type definitions and usages.
I have a generated a new Angular CLI project and want to use mxgraph in this project. For that, I have installed mxgraph and your typings with:
npm install mxgraph --save
npm install -D lgleim/mxgraph-typings
The mxgraph package contains a single mxClient. When I use your example code of your REAME.md file, I get the following error:
ERROR in ./src/app/graph-editor/graph-editor.component.ts
Module not found: Error: Can't resolve 'mxgraph'
I have also tried to copy the mxgraph git repo to the directory src/mxgraph and src/assets/mxgraph, but this did not fix the error above.
Maybe you can give me some hints what I have to do to use mxgraph in an Angular CLI project with your typings?
Is there a plan to update to the latest mxgraph version?
Hi,
we would really like to use your project but unfortunately, you do not provide a license.
Could you add an open source license like Apache 2.0 (the one mxgraph uses) or similar?
It would be much appreciated.
Thank you for providing the bindings!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.