tfiers / PkgGraph.jl

Visualize the dependency graph of a Julia package
https://tfiers.github.io/PkgGraph.jl
MIT License
43 stars 2 forks source link

svg: gray time-info subtext not aligned (a fix: `-Tsvg:cairo`) #103

Open tfiers opened 1 year ago

tfiers commented 1 year ago

After 4a5bcd72d1f3b2cc572e29bc34c80c8fc7a43af1 (using html for gray subtext w/ "[$time ms]"), noticed svg looks wonky (PNG is fine)

btw, document that :pdf works nicely too :) (and add link to the above outputs page) Maybe a new arg (see #-T link above): renderer (:cairo, or nothing)

tfiers commented 1 year ago

-Tsvg

-Tsvg:cairo

(and -Tpng for good measure)

tfiers commented 1 year ago

the cairo svg draws each character as a path (it does dedup: has a library of 'glyphs' (letters & numbers) at the top it reuses).

another possible fix: more postprocessing of the svg. like in the graphviz gitlab thread: "align center and set x to center of node"

tfiers commented 1 year ago

also lol click the above svg's to open as standalone images in firefox. both are effed up. png good old just works.

if you want both light and dark, you can, with png, btw: (documenter too?) https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#specifying-the-theme-an-image-is-shown-to i.e.

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="dark.png">
  <source media="(prefers-color-scheme: light)" srcset="light.png">
<picture>

(the extra (nonDRY) img attribute is for: 1) accesibility? can't picture or source have alt text? 2) backwards compat?. Is it necessary?)

tfiers commented 1 year ago

Hm maybe the edges should be gray in the above. (They're too noisy. Scaling (average of neighbour relsizes?) was first idea, but is hardee)