mdaines / viz-js

Graphviz in your browser
https://viz-js.com/
MIT License
4.1k stars 353 forks source link

Support specifying image sizes #233

Closed mdaines closed 9 months ago

mdaines commented 9 months ago

This adds support for an images option, similar to the previous version. See #191.

Sizes of images referenced by the image attribute can be specified using an "images" render option:

viz.render("graph { a[image=\"test.png\"] }", {
  images: [
    { name: "test.png", width: 300, height: 200 }
  ]
});

The property "name" is used instead of "path" to match the Graphviz documentation.