Conversation
…omparison page Co-authored-by: gatopeich <7722268+gatopeich@users.noreply.github.com> Agent-Logs-Url: https://github.com/gatopeich/plotly.js/sessions/606bb8e7-b426-43ec-95fa-94f5c3615a59
Copilot
AI
changed the title
[WIP] Address review comments and create visual comparison page
Address PR #7653 review comments: restore symDef.n, rename/clean demos, add marker visual regression page
Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses all outstanding review comments on PR plotly#7653. Restores the symbol numbering approach to use
symDef.nfrom the definition object, cleans up demo files, and adds a self-contained visual comparison page for all 55 default markers.Changes
src/components/drawing/index.js— Removevar _n = 0counter; restorevar n = symDef.n(reading number from the symbol definition, not an implicit positional counter)src/components/drawing/symbol_defs.js— Re-add explicitn: 0–n: 54to each symbol definition (circle=0 … arrow-wide=54)devtools/demos/all_demos.html→ renamed tocustom_marker_demos.htmldevtools/demos/backward_compatibility_test.html→ deleted (redundant)devtools/demos/marker_comparison.html→ new self-contained comparison page (no external deps)Marker comparison page
Renders all 55 symbols at r=20 with 5 columns side-by-side:
f(r=20, 0, 0)functions, 2-decimal roundingp:path strings fromsymbol_defs.jsSymbols with purely integer multipliers (circle, square, diamond, cross, …) show Δ=0 between Old and New(r0). Symbols using irrational multipliers (√2, √3, trig) show small diffs; the r1 column consistently reduces those.
Original prompt
Goal
Address all review comments on PR plotly#7653, and produce a self-contained visual comparison page for all default markers rendered at r=20, comparing the old function-driven output vs the new integer-path output (and optionally 1-decimal rounding).
Review comments to address
1.
devtools/demos/all_demos.html→ rename tocustom_marker_demos.htmlThe file
devtools/demos/all_demos.html(blob sha199efc872ccd4b9babcf791c2135e35814459369) should be renamed todevtools/demos/custom_marker_demos.html. Keep all content identical — only the filename changes.2.
devtools/demos/backward_compatibility_test.html→ deleteThe file
devtools/demos/backward_compatibility_test.html(blob shabcd2dec375e0951934d12c0a690dc9c626577f26) is redundant and should be deleted.3.
src/components/drawing/index.js→ restoresymDef.ninstead of_n++In
src/components/drawing/index.js, the symbol loop currently uses avar _n = 0counter andvar n = _n++. Restore the original patternvar n = symDef.n(readingnfrom the symbol definition object), and remove thevar _n = 0line.The relevant code block (lines 341–377) currently reads:
Change to:
This requires that
src/components/drawing/symbol_defs.jsbe updated to includen:on each symbol definition again (they were removed in the PR). Add backn: 0throughn: 54on each symbol in order, matching the upstreamplotly/plotly.jsmaster numbering (circle=0, square=1, diamond=2, ... arrow-wide=54).The current
symbol_defs.jsin the PR (gatopeich/plotly.js master) contains onlyp:(and optionallynoDot,needLine,noFill,backoff) per symbol. Each symbol needs its sequentialn:value added back. The order is:4.
package-lock.jsonandpackage.json→ revert if only reorderingIf the only changes to
package-lock.jsonand/orpackage.jsonrelative to upstreamplotly/plotly.jsmaster (928ad9209e3141f40b46d03470cc674f6c8b86f7) are line reorderings (no version changes, no new/removed packages), revert those files to the upstream versions.New file:
devtools/demos/marker_comparison.htmlCreate a fully self-contained HTML file (no external dependencies beyond inline SVG rendering — no Plotly.js, no Canvas libraries) that visually compares every default marker symbol at r=20.
Columns for each symbol
For each of the 55 symbols (0–54), render 3 columns side by side, plus 2 pixel-diff columns:
Old — path produced by calling the upstream
f(r, angle, standoff)function directly in JS withr=20, angle=0, standoff=0. These functions are copied verbatim (unmodified) fromplotly/plotly.jsmastersrc/components/drawing/symbol_defs.js. The paths useround(x, 2)(2 decimal places). Do NOT round further.New (r0) — the integer path string from the PR's
src/components/drawing/symbol_defs.jsp:field, scaled from r=20: since the PR stores paths at r=20, these are used directly as-is.New (r1) — paths recomputed from the same upstream functions but with the result coordinates rounded to 1 decimal place (i.e., replace
round(x, 2)withround(x, 1)in the function). This gives an intermediate rounding.Diff Old→New(r0) — pixel-by-pixel canvas difference image between column 1 and column 2, shown as a red-channel heatmap. Display the count of differing pixels below.
Diff Old→New(r1) — same but between column 1 and column 3.
Layout
Implementation notes
f()functions from upstream depend on...This pull request was created from Copilot chat.
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.