fair-acc / chart-fx

A scientific charting library focused on performance optimised real-time data visualisation at 25 Hz update rates for data sets with a few 10 thousand up to 5 million data points.
GNU Lesser General Public License v3.0
488 stars 90 forks source link

Zoomer: add a user definable predicate for panning #631

Closed ichaus-we closed 9 months ago

ichaus-we commented 9 months ago

This commit adds a user-definable predicate for panning to the Zoomer plugin.

It allows to replace the default predicate (middle mouse button) to something else, like it was possible with the now removed Panner plugin.

Sample code: zoomer.setPanMouseFilter(event -> MouseEventsHelper.isOnlyPrimaryButtonDown(event) && MouseEventsHelper.isOnlyCtrlModifierDown(event));

This is demonstrated in a new chart in the ZoomerSample.

sonarcloud[bot] commented 9 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

codecov[bot] commented 9 months ago

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (7164e6b) 48.09% compared to head (27a078b) 48.07%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #631 +/- ## ============================================ - Coverage 48.09% 48.07% -0.02% + Complexity 6224 6219 -5 ============================================ Files 374 374 Lines 38304 38309 +5 Branches 6117 6117 ============================================ - Hits 18422 18417 -5 - Misses 18727 18732 +5 - Partials 1155 1160 +5 ``` | [Files](https://app.codecov.io/gh/fair-acc/chart-fx/pull/631?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fair-acc) | Coverage Δ | | |---|---|---| | [.../main/java/io/fair\_acc/chartfx/plugins/Zoomer.java](https://app.codecov.io/gh/fair-acc/chart-fx/pull/631?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fair-acc#diff-Y2hhcnRmeC1jaGFydC9zcmMvbWFpbi9qYXZhL2lvL2ZhaXJfYWNjL2NoYXJ0ZngvcGx1Z2lucy9ab29tZXIuamF2YQ==) | `25.87% <20.00%> (-0.06%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/fair-acc/chart-fx/pull/631/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fair-acc)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.