Open gvwilson opened 4 years ago
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?).
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