zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

Draw.io support #676

Closed cmuench closed 2 years ago

cmuench commented 4 years ago

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

zadam commented 4 years ago

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:

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.

cmuench commented 4 years ago

@zadam Thank you for sharing your opinion.

JohnWang1023 commented 4 years ago

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/

nil0x42 commented 4 years ago

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

chncho commented 4 years ago

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

zadam commented 4 years ago

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.

chncho commented 4 years ago

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!

cmuench commented 3 years ago

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

cmuench commented 2 years ago

Found a workaround. Just used the Open note externally function.

Short blog post (in German language), but snippets can be copied.

https://muench.dev/post/2022/05/drawio-direkt-aus-trilium-oeffnen/

zadam commented 2 years ago

Note that in 0.52 (beta released yesterday) we integrate excalidraw which can be used to draw diagrams (among others).

zadam commented 2 years ago

Since we have excalidraw, draw.io is not going to happen, closing.

SiriusXT commented 1 year ago

Now, a weiget plugin allows you to use drawio drawing in trilium. https://github.com/SiriusXT/trilium-drawio