-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: add option for stacked line layers #119
Conversation
37bfba7
to
e031438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really awesome timmy!
i particularly love this:
Notice also the tooltip has an additional column named "cumulative" which reflects the value of the hovered points, while the "_value" is the original single values of the points.
just some requests to shore up some potential undefined accesses. i think this is deserving of some tests as well - i commented where i think some might be good to put.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it! 🍰 🍰 🍰
e031438
to
52ad452
Compare
Aside from the reviews, I noticed upon further testing that sometimes a line's data will not be in the tooltip when the _value is 0. This happens intermittently, as sometimes the tooltip will correctly display the entire line's data when _value is 0. Will investigate this and report back. |
This is a data issue. The sample test data does not have enough records to allow the hover points to be found with high precision when a line has a _value 0 (and thus causing two line layers to intersect when stacked). Increasing the number of records in the sample data makes this issue un-reproduceable. Intersecting lines will have their own hover points. In real applications, this issue is moot as the data volume is expected to be much higher than the sample test data in storybook. |
52ad452
to
7d48c5b
Compare
7d48c5b
to
a1e37cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, as usual! Top quality code!
@@ -28,13 +51,17 @@ export const lineTransform = ( | |||
for (let i = 0; i < table.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a blocker, just a thought for the future: might consider converting this to forEach
function if at all possible and unless there's a strong reason to use a for
loop - manually iterating is sooooooooo 1989
Closes #43