Incorrect iframe
height on some diagrams like pie
#4289
Labels
Graph: Pie
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
With
securityLevel: "sandbox"
, mermaid will output aniframe
, but it appears that on some charts like pie, this iframe's height does not match the SVG element. In the example below, svg height is 254px, but iframe height is 450px.The iframe height does match the height value in
viewBox
but does not take into account that the SVG is scaled down, so its viewbox height does not match the rendered height. I think the fix will be to take into account the scaling of the SVG when calculating iframe height.Steps to reproduce
https://mermaid.live/edit#pako:eNp1T7sOwjAM_BXLcwcYyQxISMBCB4YspnHBokmq1OUh1H8nbcXITafz3Vn3wSo6RoOtMKhow3DclNv97mwD_GCxFM_QtRwUmhjvEq5QxwQ-PoQtgoHV4p__SVrdxoDo5FwusEDPyZO4_Pcz5izqjX1uMpk6SneLxax3XPVJ9L3nBzfzvaPgLvFl0YYhV1Gv8fQOFRpNPRfYt46U10LXRB5NTU2XVXaiMR3mrdPk4Qsk6lBB
(Click cancel to preserve config)
Screenshots
(color issue in iframe is a separate bug and can be fixed by adding
color-scheme:normal
to the iframe's CSS).Setup
The text was updated successfully, but these errors were encountered: