You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SVG backend is assigning same id to clipPath elements #4349
and then using the developer tools in Chrome, you delete one of the images and zoom in (or zoom out), the remaining image has a problem with the clipping paths:
Before deleting image:
After deleting image and zooming in:
The reason is that both figures share the same id attribute in their clipPath elements. This is the same issue that @moble found after plotting a couple of matplotlib figures and then removing or hiding one of them. Matplotlib currently assign the same id to their clipPath elements for figures that have the same content in its _make_id method and this causes tricky bugs in the browser.
Essentially, Firefox and Chrome behave differently depending on the complexity of the figure but this can be solved by assigning different ids to the clipPath elements in matplotlib (which is good practice anyway.)
I was suggesting to add a random value before generating ids (but maybe your tests are relying on the current behavior in some way).
Why is not re-using clip paths good practice? I would naively have thought that reusing them (which reduces file size) would be good practice. Never mind, I am confused.
Isn't this more like a namespace collision issue? The files by themselves
are fine, but when both appear in the same document, the ids collide?
On Apr 18, 2015 1:44 AM, "Thomas A Caswell" notifications@github.com
wrote:
Why is not re-using clip paths good practice? I would naively have thought
that reusing them (which reduces file size) would be good practice.
—
Reply to this email directly or view it on GitHub #4349 (comment)
.
Activity
tacaswell commentedon Apr 18, 2015
Why is not re-using clip paths good practice? I would naively have thought that reusing them (which reduces file size) would be good practice.Never mind, I am confused.WeatherGod commentedon Apr 18, 2015
Isn't this more like a namespace collision issue? The files by themselves
are fine, but when both appear in the same document, the ids collide?
On Apr 18, 2015 1:44 AM, "Thomas A Caswell" notifications@github.com
wrote:
BUG : fix svg corner case