lotas / contentful-graph

Visual representation of contentful content models in form of graphs
https://www.contentful.com/blog/2017/08/08/how-to-quickly-visualize-your-content-model/
MIT License
59 stars 7 forks source link

Output to diagrams.net #20

Open s5no5t opened 3 years ago

s5no5t commented 3 years ago

It would be super useful to support the file format of diagrams.net, which would allow editing the graphs after exporting them from Contentful.

lotas commented 3 years ago

Hi @jugglingthebits I'm not familiar with diagrams.net, but it looks like it is a drawio underneath? If I remember correctly it was using xml-like documents. I tried importing SVG but it doesn't recognize them.

Idea of contentful-graph was simple, it was creating *.dot text files which are later being parsed and converted into nice diagrams with graphviz. So the main work was actually done by that wonderful tool.

In order to export it to drawio format, one can either use (quick googling) something like this graphviz2drawio, or implement whole layouting from scratch. Maybe also there is a way to convert SVG into a drawio XML structure, not sure.

My problem with that would still be that once you export and start edit the schema, it would not be possible to re-sync, if structure would change on Contentful side.

I wish contentful would implement such a UI designer directly in their product :)

s5no5t commented 3 years ago

I'm not familiar with diagrams.net, but it looks like it is a drawio underneath?

That's right.

In order to export it to drawio format, one can either use (quick googling) something like this graphviz2drawio, or implement whole layouting from scratch.

I tried graphviz2drawio today and it didn't work for me at all. Besides, I think this functionality would nicely fit into contentful-graph.

My problem with that would still be that once you export and start edit the schema, it would not be possible to re-sync, if structure would change on Contentful side.

I agree, although I don't see it as a big issue. My use case would be to take whatever is the latest model in Contentful and use diagrams.net to evolve it to the next step - this doesn't require re-sync.

I wish contentful would implement such a UI designer directly in their product :)

I agree :-)

Would you take PRs that implement a --format=drawio param for contentful-graph?

lotas commented 3 years ago

Would you take PRs that implement a --format=drawio param for contentful-graph?

That would be amazing! Thank you.