Skip to content

Fix Point.extents for empty and label-only markers#228

Merged
tshead2 merged 2 commits intosandialabs:mainfrom
eaton-lab:point-extents-text-clip-fix
Mar 19, 2026
Merged

Fix Point.extents for empty and label-only markers#228
tshead2 merged 2 commits intosandialabs:mainfrom
eaton-lab:point-extents-text-clip-fix

Conversation

@eaton-lab
Copy link
Contributor

Summary

This fixes a scatterplot regression introduced by the recent point extent changes.

Point.extents() was assuming that every marker had a truthy shape and could be handled as a shape-
based marker. That breaks when cartesian finalize requests point extents for clipping and the scatterplot
contains markers like None, "", or label-only markers. In that case the extent code ends up indexing
shape[0] and crashes.

Fix

This change makes Point.extents() match actual marker rendering behavior more closely:

  • skip markers that are None or ""
  • treat label-only markers as text extents instead of shape extents
  • union shape and label extents when a marker has both
  • handle all point series correctly during extent calculation

The label extent styling also now mirrors the defaults already used by the HTML marker renderer, so extent
calculation matches rendered output.

Reproducer

This was reported with:

behave -i scatterplot -n "@1.1"

and specifically the axes-scatterplot-markers scenario.

## Tests

Added a focused regression test for cartesian finalize with None, "", and label-only markers, and verified
that:

behave -i scatterplot -n "@1.1"
behave features/cartesian-coordinates.feature -n "Scatterplot markers with empty and label-only values do
not break cartesian finalize"
behave features/scatterplot-visualization.feature

all pass.

@tshead2 tshead2 merged commit d06e432 into sandialabs:main Mar 19, 2026
0 of 6 checks passed
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.

2 participants