aduh95 / viz.js

A hack to put Graphviz on the web.
http://aduh95.github.io/viz.js-playground/
MIT License
39 stars 8 forks source link

image support does not work in sync mode #16

Closed christianvoigt closed 3 years ago

christianvoigt commented 3 years ago

After testing the image support in async mode, I switched to sync mode and it stopped working.

I have created a minimal example to demonstrate this: https://github.com/christianvoigt/sync-vizjs-images-test

If you run node async.js everything is fine. If you run node sync.js you will get the error No or improper image file="https://github.com/christianvoigt/argdown/raw/master/argdown-arrow.png?raw=true" in label of node n0.

This means that vizjs did not find the image size information I gave it using the following code:

const settings = {
    images: [{path: "https://github.com/christianvoigt/argdown/raw/master/argdown-arrow.png?raw=true", width: 100, height: 100}]
}
vizRenderStringSync(dot, settings);
aduh95 commented 3 years ago

Thanks for the report, that's indeed a bug!