Trilium: Draw.io support

Created on 29 Oct 2019  路  8Comments  路  Source: zadam/trilium

I am a former user of BookStack, a PHP based Knowledge Base tool. This tool has a very nice feature to save Draw.io diagrams as note.
That's very handy to write technical documentations (network diagrams) or for company structures. Would really love to see that feature in trilium.

https://www.bookstackapp.com/

Frontend code can be found here: https://github.com/BookStackApp/BookStack/blob/master/resources/js/services/drawio.js

Hard Enhancement

Most helpful comment

There is an official page which describes the embedding of DrawIO into other tools.

https://github.com/jgraph/drawio-integration/blob/master/README.md

It's also possible to save the diagramm inside of a PNG file.
Maybe that's interesting here: https://github.com/jgraph/drawio-integration/blob/master/diagram-editor.js

All 8 comments

I was checking out draw.io before as well and considered adding it since being able to draw diagrams would be very nice. But I had some concerns:

  • draw.io is a complex tool with rich interface and it would not fit well inside trilium
  • I'm cautious about adding various third party libraries because I'm afraid of bit rot - draw.io has complex and essentially proprietary format (meaning it's not really supported by anything else) and if it dies in the future, then all the data will die with it as well. Maybe it's a pipe dream but I want to keep the data in Trilium usable for decades.

Instead of adding such a complex tool I'm thinking to at least partially cover these use cases by some form of drawing support which would be also way more general.

I'm not 100% decided on this though and maybe I'll change my opinion in the future.

@zadam Thank you for sharing your opinion.

I found dagre[0] and viz.js[1] can parse Graphviz graphs (DOT language) in the browser.

[0]https://dagrejs.github.io/project/dagre-d3/latest/demo/interactive-demo.html

[1]http://viz-js.com/

there is an ugly workaround,
you can convert draw.io's rendered webpage with singlefile browser addon, then urlencode html page, wrap it into an iframe like this:

<iframe style="min-height: 85vh; width:100%; height:100%;" sandbox="" src="URLENCODED_PAGE_CONTENT"></iframe>

you write it into an html code note, and create a Render Note which renders this note. so you can visualize the whole page as it rendered in your browser

I found a mini view of drawio, that can be integrated to trilium ui , and seams comfortable.
Here is the way to switch to mini view (@popey456963 @zadam ):
the way to switch to mini view

Here is the mini view looks:
the mini view looks

That looks pretty nice.聽

Frankly I keep coming back to thoughts about graph drawing and it's possible I will integrate draw.io since it is probably the best solution out there. But it won't be very soon.

That looks pretty nice.

Frankly I keep coming back to thoughts about graph drawing and it's possible I will integrate draw.io since it is probably the best solution out there. But it won't be very soon.

That's great!

There is an official page which describes the embedding of DrawIO into other tools.

https://github.com/jgraph/drawio-integration/blob/master/README.md

It's also possible to save the diagramm inside of a PNG file.
Maybe that's interesting here: https://github.com/jgraph/drawio-integration/blob/master/diagram-editor.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TTtrace picture TTtrace  路  5Comments

zadam picture zadam  路  4Comments

munavirch picture munavirch  路  5Comments

thbkrshw picture thbkrshw  路  4Comments

lanslans picture lanslans  路  3Comments