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
Enable interaction mode support for events #659
Enable interaction mode support for events #659
Conversation
Looks ok for that use case. Not sure if it is the only use case though, maybe we need interaction modes here too? |
make sense to enable the interaction mode. I think we could use Furthermore I think we should add this new option to What do you think? |
Yes, I think the option should apply to all annotations. It could also fall back to chart.js interaction options, so we'd use the same mode by default. Need to decide what mode is "default" and what mode(s) to implement. So, I think it makes sense to have a sub-node, and probably would be good to implement the same options too. The other options can be delt with later, but maybe its just some copied code from chart.js that is needed. Maybe the end result can be generalized so it can be used in chart.js too and thus be available to other plugins. |
This could probably be in v1.4 if we keep the current behavior as default. |
I think we should leave the current behavior (nearest) as default, to avoid breaking change. Nevertheless I need to go more in deep in interactions code (and implementation) of CHART.JS.
👍
Let me take time to have a look to that PR. I need some days because busy in other stuff.
Yes, we could but maybe it's not so important to release it soon therefore it could wait for version 2 where there are already important updates to do. Anyway, if you agree, let's wait for feedback about version 1.3 and if possible issues will come. |
If we can release an enhancement as a non breaking change, we should do it before releasing the breaking changes. That way users can have that enhancement and not need to deal with the breaking changes just yet. Could also provide some feedback that requires another breaking change, which we can then do in v2 instead of v3. Another thing is the number of changes, in 1.3 we already have quite a lot. |
Ok for me!! |
I have started working on the interaction mode. |
I'm not using any API exposes by CAHRT.JS, as starting point. Anyway, having a look to those APIs, it seems to me there are accessing to dataset elements and it seems not configurable. Anyway, put it in my TODO. |
@kurkle apart the review, there are 2 CC issues:
|
This is fine, we can fix it in another PR.
This one can be ignored, reporting duplication of one (or 3) line(s) is just silly. |
I'm doing |
multipleElementsForEvent Conflicts: src/types/ellipse.js
multipleElementsForEvent Conflicts: src/helpers/helpers.core.js src/types/box.js src/types/label.js
multipleElementsForEvent Conflicts: src/types/line.js
Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
This PR is addressing the discussion #658
This PR is enabling the interaction mode support, similar to CHART.JS.
Similar to CHART.JS because this PR is implementation
'nearest'
,'point'
,'x'
and'y'
modes (not all the others, more related to dataset elements). The fallback is tochart.options
.For
axis
option,'x'
,'y'
and'xy'
values are supported, if'r'
is set (not supported), the plugin will use'xy'
.TODO