Skip to content

stack invalid values as NaN#2390

Open
Fil wants to merge 1 commit intomainfrom
fil/stack-nan
Open

stack invalid values as NaN#2390
Fil wants to merge 1 commit intomainfrom
fil/stack-nan

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Mar 19, 2026

We have originally stacked invalid values as 0 height segments (where X1[i] == X2[i] is the current height of the stack). But I think they should be ignored instead (X1[i] = X2[i] = NaN). This feels more principled.

Pros:

  • cleaner information (an invalid value is kept throughout)
  • allows to draw interrupted stacked lines

Con:

  • gaps appear when an area "suddenly disappears" instead of vanishing in a continuous way (but this is "wrong", and can be solved by mapping NaNs to zeroes if the user wants, so it's not removing any feature).
before after
before after

blocks #2133

@Fil Fil requested a review from mbostock March 19, 2026 11:52
@Fil Fil mentioned this pull request Mar 19, 2026
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.

1 participant