Open draw.io with custom library

2,788 views
Skip to first unread message

glaucco

unread,
Feb 5, 2018, 6:06:23 AM2/5/18
to draw.io
Hi,

I'm trying to open draw.io from embedded mode and show a custom library of shapes.

This is the url I'm using:

var url = 'https://www.draw.io/'
+ '?embed=1'
+ '&ui=atlas'
+ '&spin=1'
+' &modified=unsavedChanges'
+ '&proto=json'
+ '&libraries=1'
+ '&clibs=Uhttp%3A%2F%2Fapp.test%2Fxml%2Fshapes.xml';

When draw.io opens, there is an additional templates library (I think it is loaded by default) but the custom one does not show up.

Attached is the shapes file.

I'm able to open the shapes.xml file from the browser so permissions are ok.

Thanks.


shapes.xml

Gaudenz Alder

unread,
Feb 6, 2018, 2:24:55 AM2/6/18
to draw.io

glaucco

unread,
Feb 7, 2018, 6:21:18 AM2/7/18
to draw.io
Hi Gaudenz,

Its not working for me.
Can it be related with the library file not being available under an http secure url?

Thanks!

Gaudenz Alder

unread,
Feb 7, 2018, 6:26:37 AM2/7/18
to draw.io
Using http for the example library works for me, so not sure. Check the browser console for errors.

glaucco

unread,
Feb 7, 2018, 6:40:53 AM2/7/18
to draw.io
Good tip!

ERROR:
Failed to load resource: the server responded with a status of 500 ()

I think that trailing code (red) is causing the problem. Don't know where that's coming from.

Gaudenz Alder

unread,
Feb 7, 2018, 6:47:49 AM2/7/18
to draw.io
Ah, we add this URL parameter to bypass the browser cache when using the proxy. The proxy is used if we think the resources does not have the required CORS headers, and apparently - being a local name - our proxy cannot access the resource. We could add a cors URL parameter to add entries to the list of domains that can be used directly (ie that have the required CORS headers).

glaucco

unread,
Feb 7, 2018, 6:59:32 AM2/7/18
to draw.io
Thanks!

I think that would be very useful for using draw.io in intranet environments.

Do you have an estimate for releasing that feature?

Thanks again!

Gaudenz Alder

unread,
Feb 7, 2018, 7:24:40 AM2/7/18
to draw.io
This will be added in the next release.

Alex

unread,
Jul 18, 2018, 11:26:45 AM7/18/18
to draw.io
I cannot seem to make it work with a custom library on OneDrive. Here is what I have:

File -> Open Library from -> OneDrive...
Message has been deleted

Alex

unread,
Sep 20, 2018, 8:35:44 AM9/20/18
to draw.io
I uploaded the libraby file (GTA121.xml) to a server. It is accessible from this address :


I can add the library from URL without creating a new project.  

However, I still cannot load the library on startup with the following URL : 

Gaudenz Alder

unread,
Sep 20, 2018, 8:47:48 AM9/20/18
to draw.io

Alexandre Moïse

unread,
Sep 20, 2018, 10:20:03 AM9/20/18
to Gaudenz Alder, dra...@googlegroups.com
It now works. Many thanks! 😀

On Thu, Sep 20, 2018 at 8:47 AM Gaudenz Alder <ald...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "draw.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/drawio/481118a6-ca78-4bda-95df-c65a64d6618b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex

unread,
Sep 20, 2018, 2:41:59 PM9/20/18
to draw.io
What URL property disables all other shapes? I want to avoid clicking on "More Shapes..." and uncheck the cheched libraries by default. I just want a particular custom library called from the clibs property. 


Le jeudi 20 septembre 2018 10:20:03 UTC-4, Alex a écrit :
It now works. Many thanks! 😀

On Thu, Sep 20, 2018 at 8:47 AM Gaudenz Alder <ald...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+unsubscribe@googlegroups.com.

David Benson

unread,
Sep 21, 2018, 8:52:37 AM9/21/18
to draw.io


On Thursday, 20 September 2018 19:41:59 UTC+1, Alex wrote:
What URL property disables all other shapes? I want to avoid clicking on "More Shapes..." and uncheck the cheched libraries by default. I just want a particular custom library called from the clibs property. 


Le jeudi 20 septembre 2018 10:20:03 UTC-4, Alex a écrit :
It now works. Many thanks! 😀

Alexandre Moïse

unread,
Sep 21, 2018, 11:30:12 AM9/21/18
to david...@gmail.com, dra...@googlegroups.com
It works. Thnaks. 

On Fri, Sep 21, 2018 at 8:52 AM David Benson <david...@gmail.com> wrote:
libs defines the built-in libraries used. libs=0 will do it, https://www.draw.io/?splash=0&libs=0&clibs=Uhttp%3A%2F%2Fgta121.espaceweb.usherbrooke.ca%2FGTA121.xml

On Thursday, 20 September 2018 19:41:59 UTC+1, Alex wrote:
What URL property disables all other shapes? I want to avoid clicking on "More Shapes..." and uncheck the cheched libraries by default. I just want a particular custom library called from the clibs property. 


Le jeudi 20 septembre 2018 10:20:03 UTC-4, Alex a écrit :
It now works. Many thanks! 😀

On Thu, Sep 20, 2018 at 8:47 AM Gaudenz Alder wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+un...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "draw.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/drawio/18cef082-e024-489e-86b0-c33891ac622c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages