-
Notifications
You must be signed in to change notification settings - Fork 8
add more detailed setup information #28
Comments
Hi @zhujik About the current documentation status, it is clearly missing details and should be straightforward for anybody |
Hi @zhujik, |
Hi @tbouffard and @hungtcs and thank you for your quick reply. My setup is currently as follows: package.json:
My tsconfig.json without changes looks like so:
I tried adding the following:
or
with the same result. My sample app looks like so:
With this setup, the applications tarts and mxgraph is displayed. I also noticed that compile-time type checkings work. For example, if I change |
Hi @zhujik, I did some attempts, but there are still many shortcomings, we will create a new issues to discuss these problems. https://github.com/hungtcs/react-with-mxgraph--ts-factory |
MoveTo #29 |
@hungtcs I suggest to keep this issue opened @zhujik, What I currently do (this is what https://github.com/ivamax9/angular-mxgraph-demo does as well)
I am planning to create a demo vanilla typescript project to demonstrate that, but I don't have time for that now mxgraph settings // options to set
const options = {
mxLoadResources: false,
mxLoadStylesheets: false,
};
// available options
const optionKeys = [
'mxBasePath',
'mxDefaultLanguage',
'mxForceIncludes',
'mxImageBasePath',
'mxLanguage',
'mxLanguages',
'mxLoadResources',
'mxLoadStylesheets',
'mxResourceExtension',
];
optionKeys.forEach(key => {
window[key] = options[key];
}); |
@tbouffard sorry for the late response. I settled for the solution with the subrepository right now because I have to use the latest commit on master for my project, but I want to revisit the npm package later again and also check out that new solution "typed-mxgraph". I really appreciate all the work that has been put in here by you guys and if I find something to contribute, I'll gladly do so. |
Hi, I'm developing a react app with typescript and want to use mxgraph. I'm not super proficient in typescript but so far I had no trouble setting up libraries. With mxgraph-type-definitions however it seems this is targeted to advanced typescript programmers who exactly know where to make some adjustments.
I followed the instructions for the usage (using npm) and in my Intellij IDEA, the type definitions appear and in the code it is parsed. However, when running the app the objects are undefined. For example,
mxClient.isBrowserSupported()
is parsed by the IDE and I can click on the function to go to the definition (which is the mxgraph-type-definitions module). However, on runtime I get the error "Cannot read property 'isBrowserSupported' of undefined". I'm importing the mxgraph elements like so:import { mxClient } from 'mxgraph'
Please advice on how to setup the project so that the definitions are compiled.
The text was updated successfully, but these errors were encountered: