-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
generate deterministic IDs for SVG elements to facilitate diff #1968
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
Comments
Thanks for creating this issue! This is something we've discussed internally with no real resolution so far... Plotly.py delegates to https://github.com/plotly/orca for SVG-generation, so we would need an Orca flag to modulate this behaviour or at least fix the random seed that it uses or something. Heads-up @antoinerg :) |
Great to see you here @gvwilson ! ;-) Would love to know more about how you're using plotly.py one of these days! |
Thanks - I'm regenerating a lot of figures for lessons using command-line scripts and getting a linearly-increasing number of spurious diffs because of this. |
@emmanuelle I'm trying to re-learn some basic statistics, mostly out of shame :-) |
Well at least it's RE-learning for you :-). |
You'd be amazed how much math someone can forget in (checks) 37 years. |
I agree that generating deterministic IDs should absolutely be a feature. If it requires work on Orca, I would gladly undertake it myself. However, I think it might be better to implement this directly in plotly.js. If I'm not mistaken, there might already an issue for this in https://github.com/plotly/plotly.js but I can't seem to find it at the moment (@etpinard can you point me to it?). |
Here -> plotly/orca#133 |
When saving figure as SVG using

write_image
, Plotly Express generates random unique IDs for elements. As a result,git diff
thinks re-generated figures have changed even when they haven't (see screenshot). If the IDs were generated in some deterministic way depending solely on figure contents, so that they only changed when the figure itself had visually changed,git
would be a lot happier.see #3393
The text was updated successfully, but these errors were encountered: