Repository navigation
Conversation
calc_errors kept the lower log error bound of the first point with an error bar instead of the lowest one, so the autorange cut off error bars when the smallest point was not first. The value also stayed on the axis between plots, so Plotly.react kept a stale bound. Keep the minimum and clear the bound before the scene updates its traces. Fixes plotly#8185 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3
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.
Fixes #8185.
On a log axis,
calc_errors.jsstored the lower error bound of the first point that had one and never lowered it:scene.jsreads_lowerLogErrorBoundfor the autorange, so the range depended on the order of the points. The value also stayed on the axis between plots, soPlotly.reactwith new error bars kept the old bound.Changes:
src/traces/scatter3d/calc_errors.js: keep the minimum in_lowerLogErrorBoundand drop the unused_lowerErrorBound.src/plots/gl3d/scene.js: clear_lowerLogErrorBoundon the three axes before the scene updates its traces, so each plot computes it from the current data.Tests:
scatter3d_test.js(log error bars): the z range is the same for both point orders, andPlotly.reactgives the same range asPlotly.newPlot. Both fail onmain.scatter3d_test.js(16 of 16 pass) andgl3dlayout_test.js(22 of 22 pass) in headless Chrome with SwiftShader. Ingl3d_plot_interact,gl3d_hover_clickandgl3d_annotations, 71 of 72 pass. The failing test,should allow text and tail position edits under editable: true, fails the same way onmainin my environment.npm run lint,npm run typecheckandnpm run test-syntaxpass.error_z(or x/y error bars) on a log axis where the lowest bar is not on the first point.Before and after, rendered from local bundles with the example from the issue (rows sorted largest first). The z range starts at 10^1.01 before and at 10^0.52 after, so the lower bar of D (12 ± 8) is visible:
The draftlog is
draftlogs/XXXX_fix.md; I will rename it to this PR's number in the next commit.I used Claude to help write and test this change, and reviewed the diff before opening the PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hq1ACTsK85bRrY28fUQ7b3