Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Area mark not passing along null value when only specifying "y" channel #1875

Closed
jzavala-gonzalez opened this issue Sep 24, 2023 · 1 comment

Comments

@jzavala-gonzalez
Copy link

Hi! Thank you for this library. Notebook replicating this issue is at this link. I was just using the areaY mark and found that when using null values in the data to signify cutoffs between rendered regions, that the area includes two extraneous points that should have been filtered out. The resulting shape is trapezoidal rather than rectangular. It's hard to notice when data density is high but visible otherwise. One workaround is by specifying both y1 and y2, and including nulls in both when necessary.

@Fil
Copy link
Contributor

Fil commented Sep 25, 2023

This is due to the implicit stackY transform called by the areaY mark. What happens when a value is NaN or 0 (null being transformed into NaN) is decided here https://github.com/observablehq/plot/blob/main/src/transforms/stack.js#L109

This allows for example this test to work, by making an area show something for isolated dates. It's also explicitly test in integerIntervalAreaZ (#1775).

A different way to address this would be to use a filter transform:

filter: d => d.y > 10,

@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2023
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

No branches or pull requests

2 participants