nadavrot / layout

Layout is a rust library and a tool that renders Graphviz dot files.
MIT License
656 stars 39 forks source link

[Feature request] Make SVG arrowheads match the line color #28

Closed holtjma closed 5 months ago

holtjma commented 5 months ago

Hello,

Fairly simple problem: when I generate an SVG image with a directed edge that is some non-black color (e.g., red blue etc.), the arrow head that is generated seems to always be black. I did not see an option to change this via API.

I manually modified the output files and added fill="context-stroke" to each marker and that resolved it, while also allowing for multiple edge colors in the output graph. I hypothesize that it's as simple as modifying the static at this line to resolve this: https://github.com/nadavrot/layout/blob/573248c3fc690650d83bd41fdb1a917676c6dae3/layout/src/backends/svg.rs#L19

Happy to submit a PR myself if it is that simple, but I wasn't sure if there are some non-obvious issues with those changes.

nadavrot commented 5 months ago

Hi @holtjma , thanks for reporting the issue. Please submit a PR. Make sure to run cargo fmt before sending the patch. Thank you.