Open sidharthv96 opened 1 year ago
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days
@sidharthv96 I think this issue needs to be fixed from the mermaid repository, over here when we are calculating the image width and height we are getting the result as 0,0 from the getBoundingClientRect()
because of max-width: 100% in file src/dagre-wrapper/nodes.js
.
I think here to calculate the exact width height we need to render the image temporarily in shadowDom (so no style can interfere) and remove it afterward.
Please let me know your thought.
There was one related PR in mermaid. https://github.com/mermaid-js/mermaid/pull/4268 I thought this would solve the issue, but it doesn't. Images were working previously, but stopped later.
Image are rendered they are not just not visible.
Workarround:
They can be shown by wrapping img tag into a div.
aws_db(<div style="width:250px;height:250px"><img src="https://icons.terrastruct.com/azure/Databases%20Service%20Color/Azure%20Database%20for%20PostgreSQL%20servers.svg"/></div>)
Another solution is to add text:
aws_db(<div><img src="https://icons.terrastruct.com/azure/Databases%20Service%20Color/Azure%20Database%20for%20PostgreSQL%20servers.svg"/></div>TEXT)
For sure, a fix and more CSS control on this would be nice!
Describe the bug
Images aren't rendered.
To Reproduce Link to Live Editor: https://mermaid.live/edit#pako:eNrNVF1r2zAU_StCMLKBv2LHS2LawkjLGKTQNW8lEBTpxhazLSPJydIk_31XcdJ1sAfvbS_2udK5V-ceX-tAuRJAM7op1Y4XTFsyf17WhJh2nWvWFITtjIuJAyux_ngjq5wYzW8HhbWNycJQclWbwILWzFjdchtwVYXstdUQ3jPL1syA-RBHC9BbyQHRTJVKh18cA6MrB-FGaXw-KWNzDYvvcwwMZoE2gdnmA7KTwha3gyQekAJkXtgOh3efOo2c8QL-UeJqpqqG1RLMm6KZK4PvZxDSKX_SSmASIleonxTgcX8hOxOuvmrVNnjEN0cJH2axL2tjWc3BxxXLZA16VbqT_HXeWwO58f27Yw6WNOiiNBYEEWj48fI9_0K0UDVKs_LCO3vqaFCLPyYj56VqRVegw__5fFwa6Bonrt014z_a5vhbvtsXsO3dBRgDtZWsNGEUpX6jFXpTVaD76MmlLdr-jqGusEvpUxzZ5xaNKY7u-75fc4ZJVRM3V1qVx4sS6lFUXjEp8EI4uIQltQVUsKQZQgEb1pZ2Sb1uywBvtbT7OWyh7CilUgbZy_qEtdoGBwgehLRK02yDHoFHWWvVYl9zmmFjcCXdS-Z8e2Ph__iiVHUlYUizA_1Js2EaB-noczKKpqM4mcQTj-5plg6DZJom0yQZD9NJHCUnj76e86NgPE2iOMGddDRMo3HsUTgreuzuvfP1d_oF-ICrHQ
Expected behavior Images are rendered when securityLevel : loose is set.
Screenshots