Skip to content

Keep splom dimensions aligned with categorical colors - #2515

Open
M-Colley wants to merge 1 commit into
plotly:masterfrom
M-Colley:fix/splom-categorical-colors
Open

M-Colley wants to merge 1 commit into
plotly:masterfrom
M-Colley:fix/splom-categorical-colors

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 5, 2026

Copy link
Copy Markdown

Summary

Keep scatterplot matrix dimensions and per-point marker values aligned when plot_ly(type = "splom") splits observations by a categorical color. Send singleton dimensions as arrays so their points and legend entries render. Keep axis and colorbar metadata intact when splitting observations.

Input rows  1  2  3  4  5
Color       a  b  a  c  b

a gets rows 1 and 3
b gets rows 2 and 5
c gets row 4

Closes #2506.

Evidence

  • On the upstream base, the first two color groups received consecutive rows and the single-row group failed to render. The testthat regression checks the coordinates, marker sizes, and JSON array shape.
  • The fix passed all 28 focused assertions. Bundled Plotly.js in headless Chrome rendered the original observations with their marker sizes and line widths. A two-row plot preserved both axis ranges, colorscale stops, and colorbar labels in each group.
  • On R 4.5.3 with ggplot2 4.0.4, the full suite passed 1,495 assertions. The same 59 skips and 20 warnings occurred on the upstream base.

Merge risk

The change affects scatterplot matrices split into groups. The row alignment overlaps with #2511 in the build step. The numeric colorbar fix in #2504 merges cleanly with this change.

Prepared with Codex assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plot_ly with type = "splom" renders color parameter incorrectly

1 participant