-
Notifications
You must be signed in to change notification settings - Fork 2.1k
npm install #175
Comments
yes! that is a problem. same as things, I try |
I believe I am having the same issue when trying to do Seems to be related to #180 |
There is a yet to be merged fix for this in a fork of the upstream mxgraph bitbucket repository. C.f. #169 |
This comment has been minimized.
This comment has been minimized.
@davidjgraph has this issue been resolved? Why is it marked as closed? Many thanks |
A shit of solution, but it works:
Now copy And so it works ... Basically they have not published the correct packages on Working on |
So how do we fix the deploy? |
@davidjgraph I think that the owners of this repository should do |
The problem is we get vague "do this, do that" without specifics. If someone submits an exact patch, fine, we'll accept it. But, we don't use npm and never will. We're not going to waste our time learning how it works. If you want it fixed, you have to fix it. Whining without a specifc solution waste everyone's time. |
https://bitbucket.org/jgraph/mxgraph2/src/master/etc/build/deploy.sh is the deploy script, you want |
@davidjgraph It's your problem, not mine, I try to give a solution, So do not come asking me for a solution as if you were my boss, do not be inconsiderate, it's incredible that the repository owners do not know how to execute two commands before publishing to ...
# Publish mxgraph to NPM
npm install
npm run prepare
npm publish --access public
cd ..
... |
I think you're one confused. I don't care at all about npm support. You're the people asking for it. Then you tell me I should go and work out how to do it when it's you who wants the functionality, not me. Until someone submits a correct patch I'll continue not to care and the package will be broken. Merry Christmas 8-). |
OK, 3.9.12 pushed with the suggested change. |
I just tried installing via npm and I am unable to do:
When debugging, I get messages like "mxClient is not defined". I tried @nameszian solution but it did not work. Any ideas about how to solve this? Thanks EDIT: The code of the anchors.js file works just fine:
Maybe it is just for cosmetic reasons, but is there a way to transform all of that into the "import {} from" syntax? Thanks
|
Hey @fleskovar @davidjgraph, below code worked for me ->
|
When I use the code example from @KevinLeigh . Do I need to use it in every class of my mxgraph tool, beceause when I do this my register custom shapes is not working and I was thinking that this is the problem of me creating a new mxgraph instance in every file. |
mxgraph exports not the library itself but kind of its factory. So I've created script mxgraph.js: import mxgraphFactory from 'mxgraph'
export default mxgraphFactory({
// here should be your paths to mxgraph's assets (it's optional)
mxImageBasePath: 'assets/mxgraph/images',
mxBasePath: 'assets/mxgraph'
}) Then I can import mxgraph wherever I want like that: import mxgraph from './mxgraph'
new mxgraph.mxGraph() |
@become-iron |
@become-iron, Code:
Thanks |
@nickyxu Script which manages bundle building: https://github.com/jgraph/mxgraph/blob/master/etc/build/Gruntfile.js |
Aside from my zero understanding of npm, what is the current problem with the npm package. I see #313 where 11 people want the latest pushed. I'm assuming they have it working. Is the problem that's it's working, but hard to use? |
Thanks very much for your response.
|
I solve the problem learning from the project here: https://github.com/jinzhanye/pokemon-diagram. |
You solved the problem but didn't tell anyone how. Really? |
@dsonwy "I solve the problem learning from the project here: https://github.com/jinzhanye/pokemon-diagram. My project is react ,and learing from the project of pokemon-diagram, is ok in version 3.1.12,but upgrade to 4.0.1 or 4.0.2 ,it does not work,(error message : cant resove mxgraph), I cant find the dist/build.js in the node-modules directory, but it can find it in the version 3.9.12. And I try to use version 3.9.1 , it's also dont work. |
@paper-play yeah,,,
yeah, I dont know how to make it work in other versions, either. And I use it in the version of 3.9.12... |
Don't know why but when I do
npm install mxgraph
I'm unable to import "mxgraph"But the
npm install mxgraph-js
everything works fine (aside from the fact that this one is an outdated fork)Is anybody having issues with the npm install ? I'm currently trying to use it in a react project.
The text was updated successfully, but these errors were encountered: