jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
40.7k stars 7.57k forks source link

developing and debugging shape files #16

Closed jdittrich closed 7 years ago

jdittrich commented 7 years ago

Task: I would like to build improve and/or add shapes (the kind with handles and other interactive functions which are defined in /war/shapes) Problems:

davidjgraph commented 7 years ago

Run using the dev=1 URL parameter and the non-minified version of the code will be used. Note that you will need to map

document.location.protocol + '//devhost.jgraph.com/mxgraph2'

to the mxGraph project. We have mxGraph locallly, but I guess mapping it to Github should also work.

If you want things like handles, then yes, you'll need to implement in JS. You can follow the basic idea for the sidebar code, as you've seen. The build.xml does need to be updated, currently, for new additions. We probably should just wildcard that if the minifier allows it.

The other place stencils are referenced is in com.mxgraph.online.EmbedServlet2.initLibraries, which is the embed server-side code. If you're using embedding, you could override the class and add another init that calls this one.

jdittrich commented 7 years ago

Thanks, I’ll go with that! If you paste it to the wiki it would be great since it would be easy to find for others (and me to refind it, too :smiley: )

alderg commented 7 years ago

See also: https://github.com/jgraph/mxgraph/blob/master/javascript/examples/grapheditor/www/js/Shapes.js