-
Notifications
You must be signed in to change notification settings - Fork 601
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
Pointer interaction review #1687
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Mark `OnPointMeasured` in `ConditionalDrawExtensions` as obsolete. - Remove nullable type from `point` parameter in `ChartPointHandler`. - Add `EventExtensions.cs` with MIT License and new namespace. - Implement extension methods in `EventExtensions` for `Series` events.
A new parameter to costimize the tooltip/pointer events logic, there are many olpen issues in the library that could be fixed if we let the user customize the logic to find points in a series based on a given position
The changes introduce a new parameter `FindPointFor findPointFor` to the `FindHitPoints` method across various chart classes and interfaces. This parameter specifies the trigger that initiated the search for hit points, such as a tooltip or a pointer event. - Updated `FindHitPoints` method in `ISeries` interface and implementations to include the new parameter. - Modified `GetPointsAt` method in `CartesianChart`, `PieChart`, and `PolarChart` to accept and pass the `findPointFor` parameter. - Enhanced `FindPointsInPosition` method in `Series` class to handle the new parameter. - Ensured correct context (tooltip or pointer) is used for hit detection, improving accuracy and functionality.
The HoverArea property in the ChartPointContext class has been modified to change its setter access modifier from internal to public. This allows the HoverArea property to be set from outside the assembly, whereas previously it could only be set within the assembly.
this sample will be only on avalonia for now, the idea is to only show the view mmodel in the docs, thus we dont need all the views on all frameworks
Added a new section in the documentation explaining how to override the default tooltip finding strategies by defining a custom `HoverArea` for each point. Included a code snippet and visual examples to demonstrate the behavior of the custom tooltip.
Renamed `Tooltip` to `HoverEvent` and `Pointer` to `PointerDownEvent` in the `FindPointFor` enum. Updated all method parameters and return types accordingly. Changed the return type of the `Fetch` method in the `ISeries` interface from `ChartPoint[]` to `IEnumerable<ChartPoint>`. Modified the `GetPointsAt` method in `PieChart`, `PolarChart`, and `CartesianChart` to default the `findPointFor` parameter to `HoverEvent`. These changes enhance clarity and specificity in event handling and point-finding logic within the charting library.
This is only added to avalonia for now, the intentions is to use the view model of this sample i docs, it is not necessary to add an exammple for all platfomrms because the vm works for all.
improve bounce logic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to fix most of issues on https://github.com/users/beto-rodriguez/projects/3
fixed issues: