How customizable is Draw.io when hosted

514 views
Skip to first unread message

Christoph Boget

unread,
May 23, 2018, 11:51:00 AM5/23/18
to draw.io
If I download Draw.io from git and host it on my server for use, how customizable is it (if at all)?  Can I limit the menu options (e.g., Extras) available to the users through some sort of configuration?  Or would I need to alter the source?  What about the usable shapes?

thnx,
Christoph

Gaudenz Alder

unread,
May 23, 2018, 12:12:20 PM5/23/18
to draw.io
Some parts are configurable via Editor.configure (see https://desk.draw.io/support/solutions/articles/16000058316) for the rest you can alter the source.

Christoph Boget

unread,
May 23, 2018, 12:24:40 PM5/23/18
to draw.io
Some parts are configurable via Editor.configure (see https://desk.draw.io/support/solutions/articles/16000058316) for the rest you can alter the source.

Does this work only in Confluence?  What if I am using/hosting just the Github Webapp source? 

Somewhat tangentially, is there documentation somewhere about writing plugins?

thnx,
Christoph

Gaudenz Alder

unread,
May 23, 2018, 12:52:26 PM5/23/18
to draw.io
No, this is a function in the Editor "class", you can use it anywhere. For plugins, there are examples in https://github.com/jgraph/drawio/tree/master/src/main/webapp/plugins and some documentation is at https://jgraph.github.io/mxgraph/

Christoph Boget

unread,
May 23, 2018, 2:29:03 PM5/23/18
to draw.io
No, this is a function in the Editor "class", you can use it anywhere. For plugins, there are examples in https://github.com/jgraph/drawio/tree/master/src/main/webapp/plugins and some documentation is at https://jgraph.github.io/mxgraph/

Hmm, ok. I saw that directory for the plugins.  I saw in the documentation that you can load plugins using the ``p`` GET parameter.  I was hoping that there was a way to automatically load the plugins outside of that.  To ensure the plugin was loaded without having to manually load it using the Extras -> Plugins... menu option.  It doesn't look like that capability exists.

I guess another question.  Is there somewhere I can find that lists all the files included in the various .min files (app.min, atlas.min, reader.min, et. al.)?  I'm loathe to modify the source for obvious reasons.  I just need to change/enhance parts of the functionality to meet my needs.  Though I need plugins for other things, I can't, say, alter the available menu items via a plugin.  By the time a plugin is loaded, all the base functionality has been run.  I can see, for example, that the menu has already been created.  But if I can control how the files are loaded by the browser, I can make changes (say, to the Menus.prototype.defaultMenuItems) before the menus.createMenuBar() is executed.

thnx,
Christoph

Christoph Boget

unread,
May 23, 2018, 3:45:57 PM5/23/18
to draw.io
I guess another question.  Is there somewhere I can find that lists all the files included in the various .min files (app.min, atlas.min, reader.min, et. al.)?  I'm loathe to modify the source for obvious reasons.  I just need to change/enhance parts of the functionality to meet my needs.  Though I need plugins for other things, I can't, say, alter the available menu items via a plugin.  By the time a plugin is loaded, all the base functionality has been run.  I can see, for example, that the menu has already been created.  But if I can control how the files are loaded by the browser, I can make changes (say, to the Menus.prototype.defaultMenuItems) before the menus.createMenuBar() is executed.

Never mind.  I see that this information is available in the etc/build/build.xml file.

Still curious what the answer might be about my auto loading of plugins w/o user interaction question above.

thnx,
Christoph 

Gaudenz Alder

unread,
May 24, 2018, 1:09:05 AM5/24/18
to draw.io
You can specifiy the plugins in the configure call, but the timing problem still exists. In general, anything can be overridden after loading app.min.js and before calling App.main if you host your own instance. Eg. to change the menus, extend Menus.init and modify or replace the respective entry.

Christoph Boget

unread,
May 24, 2018, 8:07:14 AM5/24/18
to draw.io
You can specifiy the plugins in the configure call, but the timing problem still exists. In general, anything can be overridden after loading app.min.js and before calling App.main if you host your own instance. Eg. to change the menus, extend Menus.init and modify or replace the respective entry.

You've definitely put me on the right track.  I really, really appreciate all your help.  I'll dig in to all of this, get elbows deep in the code, and let you know if I have any more questions.

Thanks again!

thnx,
Christoph 

Christoph Boget

unread,
May 24, 2018, 8:10:41 AM5/24/18
to draw.io
You can specifiy the plugins in the configure call, but the timing problem still exists.

Actually, re-reading this, I do have one more question -- which configure call?  What class' configure would I utilize to specify those plugins that should automatically load?

thnx,
Christoph

Gaudenz Alder

unread,
May 24, 2018, 8:31:24 AM5/24/18
to draw.io
Actually, re-reading this, I do have one more question -- which configure call?  What class' configure would I utilize to specify those plugins that should automatically load?
 

Christoph Boget

unread,
May 24, 2018, 8:37:43 AM5/24/18
to draw.io
Actually, re-reading this, I do have one more question -- which configure call?  What class' configure would I utilize to specify those plugins that should automatically load?
 

I'm not sure why I missed that.  I was going down the rabbit hole trying to figure out how the "p" GET parameter was processed.  Thanks again for all your help!

thnx,
Christoph 
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages