PrateekKumarSingh / AzViz

⚡ ☁ Azure Visualizer aka 'AzViz' : A #powershell module to automatically generate Azure resource topology diagrams by just typing a PowerShell cmdlet and passing the name of one or more Azure Resource groups
MIT License
584 stars 146 forks source link

SVG output file is not portable #102

Open crabtree opened 1 year ago

crabtree commented 1 year ago

I rendered the diagram using the SVG output. Unfortunately it references the png icons, so it will not display correctly without AzViz module installed. The possible solution to solve the problem, is to render the diagram using icons embedded using the base64 encoding. Unfortunately graphviz does not support base64 encoded images - I first tried such implementation which can be found here. I finally managed to workaround the problem replacing the icons paths in the SVG file to its base64 encoded versions (the implementation). I can open the PR if you don't mind the workaround.

I think this also sorts out the problem described in #97

zhangtbj commented 1 year ago

Hi @PrateekKumarSingh ,

Glad to find this Azviz tool for our project, it is really helpful. But we found a limitation above ^^

Could you please help see if our proposal is good for Azviz?

Thanks!

rebelinux commented 1 year ago

I rendered the diagram using the SVG output. Unfortunately it references the png icons, so it will not display correctly without AzViz module installed. The possible solution to solve the problem, is to render the diagram using icons embedded using the base64 encoding. Unfortunately graphviz does not support base64 encoded images - I first tried such implementation which can be found here. I finally managed to workaround the problem replacing the icons paths in the SVG file to its base64 encoded versions (the implementation). I can open the PR if you don't mind the workaround.

I think this also sorts out the problem described in #97

I applied this fix to my project and it worked like a charm! Thanks https://github.com/rebelinux/Veeam.Diagrammer/blob/1b560cd052b78231c8c6f7c84e6a15446f0fe090/Src/Public/New-VeeamDiagram.ps1#L380

zhangtbj commented 1 year ago

Thanks rebelinux!

CC @crabtree ^^.