Skip to content
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

Add includeInvisible option to interaction to manage negative spacing options #148

Merged
merged 5 commits into from
Oct 16, 2022

Conversation

stockiNail
Copy link
Collaborator

@stockiNail stockiNail commented Oct 15, 2022

Fix #146.

This PR is also raising the minimum version of CHART.JS to 3.8.0, where includeInvisible option has been added to interaction.

@stockiNail stockiNail added the bug Something isn't working label Oct 15, 2022
@stockiNail stockiNail added this to the 2.1.1 milestone Oct 15, 2022
@stockiNail
Copy link
Collaborator Author

@kurkle I have a doubt if it's a breaking change, due to new minimum needed CHART.JS version.

Copy link
Owner

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still bothers me a little, because those rects are visible. I think in Chart.js interactions it's assumed that x/y are the center point of the element, which is not always the case.

We should either fix Chart.js (could require using getCenterPoint, which would be bad for performance) or update the mode so that x/y in parsed data are center points of the rects.

@kurkle kurkle merged commit 6953f29 into kurkle:main Oct 16, 2022
@stockiNail stockiNail deleted the fixNegSpacing branch October 17, 2022 06:33
@stockiNail
Copy link
Collaborator Author

This still bothers me a little, because those rects are visible. I think in Chart.js interactions it's assumed that x/y are the center point of the element, which is not always the case.

I think CHART.JS is checking that whole rect (or shape) is in the chart area. Maybe it could check if a part of the element is in area to go on, instead of whole element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interactions don't seem to work on rects that have x:0 or y:0
2 participants