Repository navigation
Conversation
clean_2d_array lays z out on all the axis categories, so the bricks must start at 0. The one-value shortcut started them at the category index, which moved the column a second time. Fixes plotly#8175
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 #8175.
A heatmap trace with one
xvalue on a category axis now sits at its category.Cause
On a category axis,
clean_2d_array.jslays outzon all the axis categories. So the bricks of every trace must start at 0, as they do for a trace with two or morexvalues. For a trace with one value,make_bound_array.jsstarted the bricks at that value, the category index. The column then moved a second time, from index 2 to position 4 in the issue example. The same shortcut applies toy, and the same fix covers it.Change
make_bound_array.jsskips the one-value shortcut on a category axis. Other axis types keep the shortcut.Tests
The new case in
heatmap_test.jsplots the two traces from the issue. It expects the bricks of the second trace at[-0.5, 0.5, 1.5, 2.5]and the x axis range at[-0.5, 2.5]. Onmain, the case fails withExpected 1.5,2.5,3.5,4.5 to be close to -0.5,0.5,1.5,2.5andExpected -0.5,4.5 to be close to -0.5,2.5.Local runs on Windows 11 with Chrome 157:
heatmap_test.js: 51 of 51 passcontour_test.jsandhistogram2d_test.js: 48 of 48 passnpm run lintandnpm run typecheckpassnpm run test-syntaxfails on thewindow.getComputedStylecount on this machine, with and without the change. I did not run the image baseline tests.