plotly / plotly/plotly.py

generate deterministic IDs for SVG elements to facilitate diff

Open
#1,968 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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.
Screen Shot 2019-12-04 at 11 14 33 AM

see #3393

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the write_image entry point for SVG output and review the related discussion in issue #3393. Determine how element IDs are currently generated and define a deterministic scheme based solely on figure contents; done means regenerating an unchanged figure produces stable SVG IDs and git diffs only reflect visual changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.