Skip to content

Comments

Support gaps in data (null, NaN, etc)#46

Open
motiz88 wants to merge 11 commits intoborisyankov:masterfrom
motiz88:gaps
Open

Support gaps in data (null, NaN, etc)#46
motiz88 wants to merge 11 commits intoborisyankov:masterfrom
motiz88:gaps

Conversation

@motiz88
Copy link
Contributor

@motiz88 motiz88 commented Apr 12, 2016

I'm submitting this PR to gauge interest in the completed feature and get some feedback before I go ahead and implement it all.
The idea is to graphically represent data with in-band nulls, NaNs or infinite values by drawing the valid (finite numeric) segments separately from one another.

@borisyankov
Copy link
Owner

That is a really good idea. 👍

@motiz88
Copy link
Contributor Author

motiz88 commented Apr 13, 2016

Whew! OK, I think this thing is quite complete. Any thoughts?

As for me, I still wonder about the gaps prop. Right now it's not treated very consistently in the code and I'm thinking about removing it entirely. So the equivalent of gaps={true} would be the default and only behavior. I'd appreciate your opinion here.

@motiz88 motiz88 changed the title WIP: Support gaps in data (null, NaN, etc) Support gaps in data (null, NaN, etc) Apr 13, 2016
@borisyankov
Copy link
Owner

I agree, this being the default options, sounds like a good idea.

@motiz88
Copy link
Contributor Author

motiz88 commented Apr 14, 2016

I implemented this and one existing test was broken - this one. I'll rebase this on master in a minute, so we can use Travis here again.

It's your call, @borisyankov. As a user, I'm comfortable with this change, but I'm just one data point. Having this on by default should probably be semver-major to avoid breaking others' code.

@jarib
Copy link

jarib commented Sep 3, 2016

@borisyankov Any thoughts on getting this merged? I could use it :)

@timelyportfolio
Copy link
Contributor

@motiz88 any interest in getting this current with master? I am trying to pull this my branch but am late to the party and unsure of status. Thanks.

@borisyankov
Copy link
Owner

@motiz88 Has been a while. I am committed to merging it into master.

tobilg pushed a commit to tobilg/react-sparklines-next that referenced this pull request Nov 10, 2025
, borisyankov#122, borisyankov#130

- PR borisyankov#46: Add gap support for null/NaN/Infinity values in data
  - Modified dataToPoints to mark invalid values with valid flag
  - Created segmentPoints utility to split data into valid segments
  - Updated SparklinesLine, SparklinesCurve, and SparklinesBars to handle gaps
  - Added comprehensive tests for gap handling

- PR borisyankov#113: Add fillInvert style option to SparklinesLine
  - Allows inverting the fill direction for line charts

- PR borisyankov#119: Add SparklinesInteractiveLayer component
  - New component for interactive hover/click with visual feedback
  - Shows active point with circle and vertical line

- PR borisyankov#122: Remove empty onMouseMove handler from SparklinesLine
  - Made tooltips conditional on onMouseMove presence

- PR borisyankov#130: Update README with improved code examples
  - Use proper JSX syntax highlighting
  - Wrap examples in function components

All tests passing (25 tests across 5 test files)
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.

4 participants