kaishuu0123 / erd-go

Translates a plain text description of a relational database schema to a graphical entity-relationship diagram.(convert to dot file)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support calling Graphviz to process .dot output into image

dvins opened this issue · comments

First, just want to say this is a fantastic project you've brought forth. My question pertains to output, is there a way you could support (provided properly configured) having erd-go natively pass the .dot output to Graphviz and have it product the resultant image as part of calling erd-go?

This would be similar I believe to what the legacy erd project already does. It also reduces the hoops someone has to jump though to produce a resultant image. Right now we're looking to bake our images into a markdown output file. We can use Markdown Preview Enhanced to call erd-go, but we can't easily have it call Graphviz to produce a PNG in the same pipeline.

@dvins
Sorry for the late comment.

Thank you for the great comment. I'm honored.

I was thinking separately from graphviz to separate functions as much as possible.
Now I'm thinking of implementing an option to call the dot command internally.
Do you want to expect same behavior as the erd project?

I will try.

Thanks. I believe the answer is yes. Look at https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk?id=demo. This is what we wish to do, but using erd-go.

An example in Markdown Preview Enhanced would be:

```erd-go {cmd=true output="html" args=["-i", "$input_file" "-f", "svg"]}

[Person]
*name
height
weight
+birth_location_id

[Location]
*id
city
state
country

Person *--1 Location```

@kaishuu0123 Any thoughts on enabling erd-go to suppor the use case I outlined above?