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

[Question] Plotting null values in XYFrame #35

Closed
bengarvey opened this issue Sep 16, 2017 · 3 comments
Closed

[Question] Plotting null values in XYFrame #35

bengarvey opened this issue Sep 16, 2017 · 3 comments

Comments

@bengarvey
Copy link

screen shot 2017-09-16 at 11 25 40 am

For the green and red lines in this chart, I don't have data prior to 1982, so those values are null in my dataset. Semiotic still plots them at the bottom of the y axis. I tried making the line formatting conditional to hide them, but that didn't seem to work.

Is this considered a bug or is there a way around it?

@emeeks
Copy link
Member

emeeks commented Sep 16, 2017

You can use the defined attribute to set rules for when a value means a gap. So in your case you should be able to set:
defined={d => d.yourValue !== null}
If that doesn't work let me know. That will work for any gaps in the data.
Love the sketchy rendering in looks so hand-drawn.

@bengarvey
Copy link
Author

💥
screen shot 2017-09-16 at 4 02 11 pm

That worked perfecly, thanks.

@bengarvey
Copy link
Author

bengarvey commented Jan 7, 2019

@emeeks Upgraded to 1.16.3 and I think this is broken again.

With this code:
defined={d => d.yourValue !== null}

It seems to ignore the nulls completely instead of skipping them, making it span the data across the whole chart even where it shouldn't be. I fixed this by explicitly setting the xExtent, which solved the problem, but I figured I'd let you know this behavior changed. Feel free to close if this is intentional or not a big issue.

The problem explained visually:
With no xExtent set, but null values for earlier datapoints.
screen shot 2019-01-06 at 10 08 59 pm

With explicit xExtent set, correctly not plotting the nulls.
screen shot 2019-01-06 at 10 09 10 pm

@bengarvey bengarvey reopened this Jan 7, 2019
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