Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDocs for "hover"/interaction modes are too focused on tooltips #6200
Comments
|
Interaction settings are configured separately for I'm not sure why you think Hover effects are configured at element level though. I agree the documentation needs changes, first the Interaction settings talks only about hover while all those |
|
I think, simplifying my argument a bit, to begin with, what confuses me is that I consider the tooltip to be an integral part of the chart, and it is generally shown on hover. When I see The questions I would ask myself are:
Essentially, what I am proposing, is that the current I'm sorry if it's still unclear. |
|
I agree those interactions should both be configured by one set of options, by default. I don't think elements.point is the place though - consider bar and pie/doughnut charts for example. Considering backward compatibility, these things can't be changed until v3. |
|
Sounds good, yeah I've only been using line charts so don't have any insights into how it would work with the other types. At least, for now, it's been noted down, thanks for your patience! |


Documentation Is:
Please Explain in Detail...
Took me forever and a half to realize that the Interactions settings are not only for tooltips, but can also apply to points (and maybe other things, idk?). Wanted to have the point nearest to the hover location always render, and only measure on the x axis, which I already achieved for the tooltip by reading the docs on Interactions and the different modes and settings. This, turns out, is super simple to achieve for points by setting
options.hoverto:Maybe there is a more "point-specific" place to set these settings, but they didn't work in either
options.elementsoroptions.elements.point. Nonetheless, it was not obvious that these settings would affect the point.Your Proposal for Changes
I think there are a couple issues at hand here. The first one is that the docs on this are overly focused on the tooltips. All the examples on the Modes page are about tooltips, which is arguably fine, however, on the main Interactions page, the setting
modeis described as follows:Which combined with the fact that the Modes page only utilizes tooltip examples, led my brain to believe that these settings were only for tooltips (you could argue that I should have tried the global hover settings, but since I believed that it was only for tooltips, I didn't). I think that description should be changed to something more generic (similar to the other settings descriptions). Furthermore, I think that a list/sentence mentioning which objects these settings would/could apply to should be stated somewhere, either on the main Interactions page or somewhere on the Modes page. Is it only tooltips and points?
The second issue is that I think
options.elements.pointshould accept these settings, just howoptions.tooltipsaccept them. At some point, I did try adding a simplemode: nearestto the point section, thinking that maybe the point just use the same settings (and they just were never documented). That didn't work. I think it would be logical to have it accept the settings, where else do you set them if they're only supposed to affect the points rendering? (options.hoverdon't seem to be global either for that matter, it doesn't affect the tooltips?)Maybe I'm the only one who mixed all this up and to whom it doesn't come off as logical, but just figured I'd put it out there in case there are others that would agree.