| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
scattermap, scattergeo, and scattermapbox had all colorbar properties with editType='calc' instead of 'colorbars', causing the entire plot to recalculate when colorbar properties changed during initialization. This broke map rendering for scattermap/scattergeo/scattermapbox when marker.colorbar properties (e.g. tickfont.textcase) were set on initial render. Changes: - Added restoreColorbarEditTypes() function to each map trace type - Restores colorbar properties to editType='colorbars' after overrideAll - Regenerated test/plot-schema.json with corrected editTypes Fixes plotly#5616 Closes plotly#5616
|
Thanks for the PR! Our team will take a look and follow up with you. |
Sorry, something went wrong.
|
@yqtian-se Thanks for the PR! I haven't yet been able to reproduce the linked issue (see my comment here) so I'm not able to test this PR until I can reproduce. If you're able to create a Codepen which demonstrates the issue, that would be super helpful. You can also use the live link to this PR build (https://plotly.github.io/plotly.js-dev-builds/upload/pr-7684/latest/plotly.min.js) to demonstrate this fix. |
Sorry, something went wrong.
|
@yqtian-se just following up in case you have a chance to create the reproduction @emilykl asked about. Thanks! |
Sorry, something went wrong.
Exact-head verification of the schema-level fix (head b4dc27ac)I verified this PR's attribute-module changes at the exact head commit, and they do what the description says. I also traced what I believe is the actual root cause — which may remove the blocker @emilykl hit (not being able to reproduce the visual symptom). What I verified at head b4dc27acRequiring the three attribute modules directly from the PR head in Node:
Root cause (why this is correct even without a visual repro)The 'calc' pollution comes from overrideAll(attrs, 'calc', 'nested') wrapping these three modules. overrideOne() in src/plot_api/edit_types.js recurses into every nested container and rewrites all editTypes — including the borrowed marker.colorbar subtree, whose members otherwise correctly declare 'colorbars'. Compare heatmap, whose root-level colorbar isn't wrapped that way and keeps 'colorbars' throughout. So regardless of whether the initial-render blanking in plotly.py #5616 (plotly.js #7869) reproduces on demand, the schema inconsistency is objective: today, editing e.g. marker.colorbar.tickfont.size on a map trace triggers a full calc (data recompute), while every other trace type treats colorbar edits as 'colorbars' (redraw colorbars only). That asymmetry is worth fixing on its own. Suggestions
A Codepen demonstrating the original visual symptom may still help reviewers, but the items above make the PR verifiable without it. |
Sorry, something went wrong.
Keep the colorbar edit-type fix on supported map traces. Drop the removed scattermapbox trace and regenerate the schema.
|
Thanks for the detailed verification and suggestions. I incorporated the proposed changes in 0475c41:
I kept the scatter3d case out of this PR to keep the scope focused. It can be addressed in a follow-up. I will also describe this PR as a schema and update-path fix. The current evidence does not prove that the edit type caused the initial-render timing reported in #7869. The schema drift check, lint, typecheck, and syntax tests pass locally. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix colorbar editType for map traces (Issue #5616)
Overview
This PR fixes a bug where setting marker.colorbar properties (e.g., tickfont.textcase='normal') during scattermap/scattergeo/scattermapbox initialization would cause the map to blank on the initial render.
Related Issue: Fixes #5616 in plotly.py
Root Cause
The three map trace types (scattermap, scattergeo, scattermapbox) had all marker.colorbar properties incorrectly configured with editType='calc' instead of editType='colorbars'.
When a property has editType='calc', it triggers a full plot recalculation. For map traces, this recalculation during initial render was causing the map rendering to fail, leaving only the colorbar visible.
In contrast, non-map traces like scatter use editType='colorbars' for colorbar properties, which only redraws the colorbar without recalculating the entire plot. This is the correct behavior for both map and non-map traces.
Solution
Files Changed
Testing
Backward Compatibility
✓ This is a bug fix with no breaking changes
✓ Existing valid figures continue to work
✓ Previously broken figures (blanking maps) now work correctly
Features, Bug fixes, and others:
Before opening a pull request, developer should:
After opening a pull request, developer: