QAMichaelPeng / obsidian-graphviz

Graphviz plugin for obsidian md.
MIT License
73 stars 10 forks source link

[FR] Add support for rendering graphs with the native obsidian theme #19

Open tnichols217 opened 5 months ago

tnichols217 commented 5 months ago

It would be nice if you would pass the current obsidian theme (background color, text color, etc.) into graphviz so that the generated images will integrate nicely into obsidian.

I would be open to make a PR after familiarizing myself with the code if this is of interest

chadmiller-saq commented 1 month ago

This will be quite complicated. CSS interpretation comes much later after using dot to generate a picture file. At that point, the colors are already made, so PNG output won't work.

But, maybe you could make the plugin emit a SVG document inline (instead of the current "IMG" tag!) inside the document, and there use normal CSS rules to style it. You will need a way to have this plugin amend the CSS styling on the document somehow too.

chadmiller-saq commented 1 month ago

I made a little progress in #25 . It makes the generated SVG refer to a non-existent CSS file. I don't have much interest in figuring out what and where that should go, or making the SVG primitives style to the colors.