-
Hi, I am developing a custom viewer for the drawio diagrams, it is based on the App.min.js library and I am able to load and display diagrams but some objects are rendered as square, for example circles and triangles. In my page I have the following links: what else I need to make all shapes display correctly in my application as they do in drawio application? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
I made some investigations and find that in App.js the module shapes-14-6-5.min.js is loaded (instead of shapes.min.js) but trying to load it gives this error |
Beta Was this translation helpful? Give feedback.
-
"I eventually arranged a test enviroment with JSitor where you can experiment the problem. At the moment I have configured only the main JS library (app.min-js) of draw.io, extracted from the official WAR file 16.x and deployed on my own server. Uncaught ReferenceError: mxUtils is not defined at line 1 col 119 If you can give it a a look would be very helpful" DID 4625 |
Beta Was this translation helpful? Give feedback.
-
Ok, I found what is the problem. The culprit is the 'style' attribute or, better, the shape value in the xml diagram definition. For example, the following tag is not rendered properly
but adding 'shape=' in the style attribute as in: style="shape=triangle;whiteSpace=wrap;html=1" solves the problem. |
Beta Was this translation helpful? Give feedback.
-
As a general rule use "shape=....". There are a few shapes that have their own style, but you cannot depend on that mechanism. |
Beta Was this translation helpful? Give feedback.
-
You're probably not loading the default.xml stylesheet |
Beta Was this translation helpful? Give feedback.
-
Hi David, in my viewer I am referencing App.min.js and I see that it
dinamically load the default.xml throught this line:
mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement()
do you suspect that it can't find the file? In this case I should see some
404 errors in the browser console but they there aren't. Have you a tip on
how I could deeper investigate this aspect?
thanks,
Marco
Il giorno mer 13 apr 2022 alle ore 17:47 David Benson <
***@***.***> ha scritto:
… You're probably not loading the default.xml stylesheet
—
Reply to this email directly, view it on GitHub
<#2536 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMGULSKMBSOKQ3WOTGAZJE3VE3UBFANCNFSM5LUGOESQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Ok, I found what is the problem. The culprit is the 'style' attribute or, better, the shape value in the xml diagram definition. For example, the following tag is not rendered properly
but adding 'shape=' in the style attribute as in: style="shape=triangle;whiteSpace=wrap;html=1"
solves the problem.
I'd like to know why in some cases the shape value is expliceted and sometimes it is not...