vscode-interactive-graphviz icon indicating copy to clipboard operation
vscode-interactive-graphviz copied to clipboard

Node images not showing in preview

Open fumal4evr opened this issue 3 years ago • 3 comments

With a test.dot file like:

digraph D { a [shape="none" label="Node a"; image="actor.png"]; b; a->b; }

and assuming actor.png is on the same folder as the dot file, the preview doesn't include an image object in the generated svg. Verified this by opening preview in the default browser. However, running this in the command line:

dot -Tsvg test.dot

makes graphviz to include the image when generating output, proving that graphviz does generate images for the node. Could I be missing an attribute, configuration or something?

fumal4evr avatar Dec 08 '21 03:12 fumal4evr

The extension does not use dot but d3-graphviz. D3-Graphviz already supports images in the API: https://github.com/magjac/d3-graphviz#images.

However, since VS Code shields file system access it's not that easy to bring images to the extension.

bigbug avatar Jan 11 '22 17:01 bigbug

I have a version that replaces reference to images in the workspace with protected reference names, but since involves replacing stuff in a script, I'm not sure how secure it would be.

image

I could submit a PR with my attempt.

fumal4evr avatar Jan 12 '22 01:01 fumal4evr

use unicode https://emojis.wiki/person-fencing/ :)

dzmitry-lahoda avatar Sep 30 '22 08:09 dzmitry-lahoda