py-spy icon indicating copy to clipboard operation
py-spy copied to clipboard

svg width defaults to 300px instead of 100%

Open drewp opened this issue 4 years ago • 2 comments

I run like this: sudo py-spy record -o /tmp/flame.html --pid 123 and the resulting flame.html contains this <svg version="1.1" width="1200" height="634" onload="init(evt)" viewBox="0 0 1200 634" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fg="http://github.com/jonhoo/inferno">

In chrome 95.0.4621.4 (or firefox 91.0.2), this svg element draws at 300px wide.

2021-09-17_10-16

As a workaround, I inspect it and add 'width:100%' to the svg element, then bump my window width slightly to trigger a redraw. That makes the flame graph full-width.

2021-09-17_10-17

drewp avatar Sep 17 '21 17:09 drewp

We're using the inferno project to write out these SVG files - I think to fix this issue you'll have to raise an issue there.

However, I don't see this behaviour myself - it renders at full width with for me on firefox v92.0.1 on osx: Screen Shot 2021-09-27 at 9 26 37 PM

What version of py-spy are you running? Also what OS is this on?

benfred avatar Sep 28 '21 04:09 benfred

This is in chrome on linux, but firefox (92.0, linux) behaves the same, as does chrome incognito.

py-spy 0.3.10

drewp avatar Sep 28 '21 17:09 drewp