cloudformation-graph icon indicating copy to clipboard operation
cloudformation-graph copied to clipboard

Images referenced in graphviz output aren't able to be exported to the current directory

Open Nitrodist opened this issue 6 years ago • 1 comments

Using the cfn-graph tool after installing it with something like npm install --save cloudformation-graph --global has the referenced images in the generated graphviz output available at a path like this:

"ApplicationLoadBalancer" ["label" = < <table border="0" cellborder="0"><tr><td fixedsize="true" width="30" height="30">

<img src="/Users/mark.campbell/.nvm/versions/node/v11.7.0/lib/node_modules/cloudformation-graph/lib/icons/networkingcontentdelivery_elasticloadbalancing_applicationloadbalancer.png"/>

</td><td>ApplicationLoadBalancer</td></tr></table> >];

When this happens, I would have to manually find all of the referenced images and copy them around so that I can export it in a sane manner to wherever I need.

A more ideal scenario would be if I could supply a command line option to output all necessary image dependencies to a local directory and the graphviz output would use that relative path instead of a absolute path. i.e., a images/ directory with networkingcontentdelivery_elasticloadbalancing_applicationloadbalancer.png is created and the graphviz output uses that relative path.

The use case where I ran into this was because I cannot install graphviz on my Mac OS X Mojave install due to homebrew issues with removing options in homebrew-core formulas and a lack of support for graphviz on Mojave:

  1. Graphviz.app currently doesn’t build on OSX Mojave because of Apple API changes. It would be wonderful if someone can fix this.

So I opted to run graphviz in a docker container and the referenced images don't exist, so the dot invocation fails.

Nitrodist avatar Jan 28 '19 19:01 Nitrodist

GraphViz now supports Mojave: https://gitlab.com/graphviz/graphviz/issues/1515

PatMyron avatar Aug 25 '19 05:08 PatMyron