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

Pointer interaction review #1687

Merged
merged 27 commits into from
Nov 5, 2024
Merged

Pointer interaction review #1687

merged 27 commits into from
Nov 5, 2024

Conversation

- 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.
@beto-rodriguez beto-rodriguez changed the title Events review Pointer interaction review Nov 3, 2024
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.
Scatter series should not use the axis "unit width" to
define hover areas, instead the drawn shape dimension is used.
@beto-rodriguez beto-rodriguez merged commit 9f01530 into dev Nov 5, 2024
4 checks passed
@beto-rodriguez beto-rodriguez deleted the events-review branch November 5, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant