Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG labels #2038

Closed
jda3000 opened this issue Jan 12, 2024 · 4 comments
Closed

SVG labels #2038

jda3000 opened this issue Jan 12, 2024 · 4 comments
Labels
crash Problems preventing documents from being rendered
Milestone

Comments

@jda3000
Copy link

jda3000 commented Jan 12, 2024

There is something that breaks rendering svg charts in the latest version, the svg charts have been created using highcharts and contain labels... reverted back to 60.1 and do not have the problem

@liZe
Copy link
Member

liZe commented Jan 12, 2024

Hi!

Could you please share a SVG file that has the problem?

@mjmay
Copy link

mjmay commented Jan 13, 2024

Same kind of issue here, SVGs are output from plotly.py. Reverting to 60.1 works.
Exception is thrown by:

".../weasyprint/pdf/stream.py", line 236, in pop_state
    assert self._ctm_stack

SVG content is:

<svg class="main-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="700" height="400" style="" viewBox="0 0 700 400"><rect x="0" y="0" width="700" height="400" style="fill: rgb(255, 255, 255); fill-opacity: 1;"/><defs id="defs-264f0b"><g class="clips"><clipPath id="clip264f0bxyplot" class="plotclip"><rect width="630" height="315"/></clipPath><clipPath class="axesclip" id="clip264f0bx"><rect x="60" y="0" width="630" height="400"/></clipPath><clipPath class="axesclip" id="clip264f0by"><rect x="0" y="5" width="700" height="315"/></clipPath><clipPath class="axesclip" id="clip264f0bxy"><rect x="60" y="5" width="630" height="315"/></clipPath></g><g class="gradients"/><g class="patterns"/></defs><g class="bglayer"><rect class="bg" x="60" y="5" width="630" height="315" style="fill: rgb(242, 242, 242); fill-opacity: 1; stroke-width: 0;"/></g><g class="layer-below"><g class="imagelayer"/><g class="shapelayer"/></g><g class="cartesianlayer"><g class="subplot xy"><g class="layer-subplot"><g class="shapelayer"/><g class="imagelayer"/></g><g class="minor-gridlayer"><g class="x"/><g class="y"/></g><g class="gridlayer"><g class="x"><path class="xgrid crisp" transform="translate(150,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="xgrid crisp" transform="translate(240,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="xgrid crisp" transform="translate(330,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="xgrid crisp" transform="translate(420,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="xgrid crisp" transform="translate(510,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="xgrid crisp" transform="translate(600,0)" d="M0,5v315" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/></g><g class="y"><path class="ygrid crisp" transform="translate(0,244.48)" d="M60,0h630" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="ygrid crisp" transform="translate(0,184.72)" d="M60,0h630" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="ygrid crisp" transform="translate(0,124.95)" d="M60,0h630" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/><path class="ygrid crisp" transform="translate(0,65.19)" d="M60,0h630" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 1px;"/></g></g><g class="zerolinelayer"><path class="yzl zl crisp" transform="translate(0,304.25)" d="M60,0h630" style="stroke: rgb(255, 255, 255); stroke-opacity: 1; stroke-width: 2px;"/></g><path class="xlines-below"/><path class="ylines-below"/><g class="overlines-below"/><g class="xaxislayer-below"/><g class="yaxislayer-below"/><g class="overaxes-below"/><g class="plot" transform="translate(60,5)" clip-path="url(#clip264f0bxyplot)"><g class="scatterlayer mlayer"><g class="trace scatter trace53eb9e" style="stroke-miterlimit: 2; opacity: 1;"><g class="fills"/><g class="errorbars"/><g class="lines"><path class="js-line" d="M0,297.92Q64.58,296.31 90,272.44C133.26,231.81 136.01,48.48 180,16.91C205.35,-1.29 241.62,6.06 270,15.75C302.07,26.7 328.55,69.31 360,87.17C388.78,103.52 420.07,109.52 450,121.27C480.07,133.07 511.16,140.99 540,157.84Q571.37,176.17 630,229.4" style="vector-effect: none; fill: none; stroke: rgb(255, 211, 47); stroke-opacity: 1; stroke-width: 2px; opacity: 1;"/></g><g class="points"/><g class="text"/></g><g class="trace scatter trace74a46f" style="stroke-miterlimit: 2; opacity: 1;"><g class="fills"/><g class="errorbars"/><g class="lines"><path class="js-line" d="M0,299.25Q63.07,307.13 90,291.84C125.27,271.81 147.6,200.7 180,165.76C208.18,135.37 237.83,104.91 270,90.68C298.32,78.15 329.93,80.56 360,78.2C389.93,75.85 420.1,79.28 450,76.5C480.1,73.7 511.61,53.81 540,61.36Q572.05,69.88 630,135.11" style="vector-effect: none; fill: none; stroke: rgb(84, 182, 78); stroke-opacity: 1; stroke-width: 2px; opacity: 1;"/></g><g class="points"/><g class="text"/></g></g></g><g class="overplot"/><path class="xlines-above crisp" d="M0,0" style="fill: none;"/><path class="ylines-above crisp" d="M0,0" style="fill: none;"/><g class="overlines-above"/><g class="xaxislayer-above"><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(60,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">16</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(150,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">18</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(240,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">22</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(330,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">25</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(420,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">27</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(510,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">30</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(600,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">33</text></g><g class="xtick"><text text-anchor="middle" x="0" y="334" transform="translate(690,0)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">36</text></g></g><g class="yaxislayer-above"><g class="ytick"><text text-anchor="end" x="59" y="4.55" transform="translate(0,304.25)" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;">0</text></g><g class="ytick"><text text-anchor="end" x="59" y="4.55" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;" transform="translate(0,244.48)">5</text></g><g class="ytick"><text text-anchor="end" x="59" y="4.55" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;" transform="translate(0,184.72)">10</text></g><g class="ytick"><text text-anchor="end" x="59" y="4.55" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;" transform="translate(0,124.95)">15</text></g><g class="ytick"><text text-anchor="end" x="59" y="4.55" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 1;" transform="translate(0,65.19)">20</text></g><g class="ytick"><text text-anchor="end" x="59" y="4.55" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; opacity: 0;" transform="translate(0,5.42)">25</text></g></g><g class="overaxes-above"/></g></g><g class="polarlayer"/><g class="smithlayer"/><g class="ternarylayer"/><g class="geolayer"/><g class="funnelarealayer"/><g class="pielayer"/><g class="iciclelayer"/><g class="treemaplayer"/><g class="sunburstlayer"/><g class="glimages"/><defs id="topdefs-264f0b"><g class="clips"/><clipPath id="legend264f0b"><rect width="145" height="30" x="0" y="0"/></clipPath></defs><g class="layer-above"><g class="imagelayer"/><g class="shapelayer"/></g><g class="infolayer"><g class="legend" pointer-events="all" transform="translate(302.5,351.5)"><rect class="bg" shape-rendering="crispEdges" style="stroke: rgb(68, 68, 68); stroke-opacity: 1; fill: rgb(255, 255, 255); fill-opacity: 1; stroke-width: 0px;" width="145" height="30" x="0" y="0"/><g class="scrollbox" transform="" clip-path="url(#legend264f0b)"><g class="groups"><g class="traces" transform="translate(0,14.950000000000001)" style="opacity: 1;"><text class="legendtext" text-anchor="start" x="40" y="5.07" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre;">GA1</text><g class="layers" style="opacity: 1;"><g class="legendfill"/><g class="legendlines"><path class="js-line" d="M5,0h30" style="fill: none; stroke: rgb(255, 211, 47); stroke-opacity: 1; stroke-width: 2px;"/></g><g class="legendsymbols"><g class="legendpoints"/></g></g><rect class="legendtoggle" x="0" y="-9.950000000000001" width="69.734375" height="19.900000000000002" style="fill: rgb(0, 0, 0); fill-opacity: 0;"/></g><g class="traces" transform="translate(72.234375,14.950000000000001)" style="opacity: 1;"><text class="legendtext" text-anchor="start" x="40" y="5.07" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 13px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre;">GA2</text><g class="layers" style="opacity: 1;"><g class="legendfill"/><g class="legendlines"><path class="js-line" d="M5,0h30" style="fill: none; stroke: rgb(84, 182, 78); stroke-opacity: 1; stroke-width: 2px;"/></g><g class="legendsymbols"><g class="legendpoints"/></g></g><rect class="legendtoggle" x="0" y="-9.950000000000001" width="69.734375" height="19.900000000000002" style="fill: rgb(0, 0, 0); fill-opacity: 0;"/></g></g></g><rect class="scrollbar" rx="20" ry="3" width="0" height="0" style="fill: rgb(128, 139, 164); fill-opacity: 1;" x="0" y="0"/></g><g class="g-gtitle"/><g class="g-xtitle"/><g class="g-ytitle"><text class="ytitle" transform="rotate(-90,16.768749999999997,162.5)" x="16.768749999999997" y="162.5" text-anchor="middle" style="font-family: \'Open Sans\', verdana, arial, sans-serif; font-size: 16px; fill: rgb(42, 63, 95); opacity: 1; font-weight: normal; white-space: pre;">Fruit %</text></g></g></svg>

@liZe liZe closed this as completed in a4a6c7d Jan 14, 2024
@liZe liZe added the crash Problems preventing documents from being rendered label Jan 14, 2024
@liZe liZe added this to the 61.0 milestone Jan 14, 2024
@liZe
Copy link
Member

liZe commented Jan 14, 2024

Thanks for the report.

This issue should now be fixed, feedback is welcome!

@mjmay
Copy link

mjmay commented Jan 14, 2024

Thanks Guillaume, that fixes it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

3 participants