-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Restore tooltip behavior when grouped #2684
Conversation
94e414e
to
4b64a87
Compare
Codecov Report
@@ Coverage Diff @@
## master #2684 +/- ##
==========================================
+ Coverage 81.01% 82.52% +1.51%
==========================================
Files 59 59
Lines 4640 4659 +19
==========================================
+ Hits 3759 3845 +86
+ Misses 881 814 -67
Continue to review full report at Codecov.
|
aaa19fb
to
e77e40e
Compare
I added more tests but codecov did not re-run, not sure if possible to make it re-run manually. |
f46d9b8
to
ce4c62a
Compare
@kt3k I was thinking about fixing #1658 too by moving data_onclick outside the loop and simply calling it once with What do you think? |
@panthony Thank you for tackling this. This was one of the most requested fixes in c3js! The examples seem working nicely on chrome and firefox 👍 Testing with mouse interaction looks so great! I left a few comments.
Sounds good to me. |
1. config is called 'onmouseover' and not 'mouseover' 2. need to pass the event-rect as parameter to properly trigger event
This is not a boolean but rather the currently hovered data. Once 'mouseout' is triggered this value is set to be undefined so let's use this as default value.
Also add a bunch of tests around interaction with bar and line charts.
As timeseries uses 'Date' objects as 'x' value.
I believe it was necessary when we had multiple event rect across the chart (maybe not?) Tried en several charts and $$.d3.mouse(shape) always returns the same values as pos.
da592bd
to
02421ce
Compare
5d1dc29
to
1e66104
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.
LGTM!
Is there a way to avoid this behavior? I have charts with large tooltips, and with this new behavior where tooltips appear when you're not hovering a point/bar, the tooltips get in the way. In particular they get in the way of drag-selections and sometimes even seeing the data point you're trying to hover. I know that I can set |
In previous version of
c3js
whentooltip_grouped
was true, the simple act of hovering above a category would highlight/show the data point(s) of that particular category.But it was broken when c3js started to use a single rect for the whole chart.
This PR aims to restore this important behavior.
It also includes the fix proposed in #2151.
Closes #2362
Closes #1745
Closes #2641
Closes #1201
It removes one of the usage of pathSegList (#2075)
Left to do: