fuelen / ecto_erd

A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.
Apache License 2.0
210 stars 13 forks source link

Styles configuration #18

Open jaimeiniesta opened 2 years ago

jaimeiniesta commented 2 years ago

I'm using the Graphviz Interactive Preview VS Code extension to visualize DOT files.

It would be great to be able to configure the styles for the generated diagrams, in terms of colors, border thickness, etc. By now I think it's only possible to change the font.

fuelen commented 2 years ago

In current implementation, customization of font is a requirement, as monospaced font is required for proper rendering of tables in nodes. It would be great if you point to things that you really need to customize. And examples of desired API are also welcome.

From what I remember, filling nodes with color doesn't look good in nodes with rounded corners, which we use.

jaimeiniesta commented 2 years ago

What I would like to have is better styles to differentiate between selected nodes in that extension. Take a look at this image from the extension page:

151164049-9c89e167-d0c1-43eb-ae96-0f5004847bde

I don't like those styles particularly, but they do a good job in highlighting the selected nodes. As that extension lets you click on a node or search for it to highlight it, it really helps in understanding the diagram.

I think that it would be enough being able to define the background color, border thickness and font weight, both for the selected / unselected states.

fuelen commented 2 years ago

I tried this plugin, it is very interesting. However, selected/unselected states are solely plugin terms. We can add configuration for "unselected" states, but it doesn't mean that this improves readability, as colors for "selected" state are defined by the plugin.

jaimeiniesta commented 2 years ago

That's something we could use then, if at least we can configure the base style, we can then play with the plugin to produce a better contrast between "unselected" and "selected".

Configuring the base style would be interesting also to define a general look, even when we don't use this kind of plugins.