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

Feature chart auto zoom #58

Merged
merged 4 commits into from
Dec 4, 2019
Merged

Feature chart auto zoom #58

merged 4 commits into from
Dec 4, 2019

Conversation

RalphSteinhagen
Copy link
Member

Added new auto zoom feature that limits zooms to X, Y, or XY depending on whether the mouse is dragged predominantly in X, Y, or XY (ie. diagonally). See ZoomerSample for details and how to use.

Added also an ObservableDeque to allow to monitor the zooming state stack. This may be used to trigger other UI actions in response to zooms (ie. pausing acquisitions/update).

@dedeibel and @ennerf you might be interested in this.

N.B. the auto-zoom is optional but we may consider making this the default...

Enjoy!

@ennerf
Copy link
Collaborator

ennerf commented Dec 2, 2019

I wouldn't make it the default yet, but I think that's a nice feature.

I did notice a bug though that causes the zoom to no longer work when dragging outside the chart area if it has already zoomed in.

https://youtu.be/E8IqK22UAS0?t=14

The initial zoom (14s) works as expected, but subsequent ones don't change the view. It does add a frame though, so I need to right-click multiple times to return.

@RalphSteinhagen
Copy link
Member Author

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- chartfx-chart/src/main/java/de/gsi/chart/ui/ObservableDeque.java  4
         

See the complete overview on Codacy

@RalphSteinhagen
Copy link
Member Author

I wouldn't make it the default yet, but I think that's a nice feature.

I did notice a bug though that causes the zoom to no longer work when dragging outside the chart area if it has already zoomed in.

https://youtu.be/E8IqK22UAS0?t=14

The initial zoom (14s) works as expected, but subsequent ones don't change the view. It does add a frame though, so I need to right-click multiple times to return.

@ennerf thanks for having a look at it. I tried to reproduce your observations with a modified RollingBufferSample (ie. adding the Zoomer plugin, enabling the auto-zoom feature) but could not reproduce it and/or I may have misunderstood this. Could you maybe elaborate... Thanks in advance and much appreciated.

@ennerf
Copy link
Collaborator

ennerf commented Dec 2, 2019

Sorry, it's a bit tough to explain. Below is a picture

image

Action
Drag from point A (5.0 @ 18s) to point B (axis area @ 18s)

Expected Behavior
Zoom Y range from 5.0 to the minimum shown value on the chart

Actual Behavior
(1) When fully zoomed out this works as expected
(2) Once some sort of zoom is active, dragging to below the chart area (orange zone) no longer has any effect

@RalphSteinhagen
Copy link
Member Author

... strange. With the modified RollingBufferSample it works for me as expected ... 'zoom in V' (-> reduces y range), then another zoom in V (-> further reduces y range). ??
I also tried to finish the drag/zoom at different locations and it works as expected.

@ennerf
Copy link
Collaborator

ennerf commented Dec 2, 2019

I just tried this again with a simplified example and couldn't reproduce it anymore.

It's weird that dragging between two points on the viewable screen always works as expected, but the X-Axis area can break. Anyways, it seems that the issue is somewhere else. Sorry for the false alarm!

@RalphSteinhagen
Copy link
Member Author

Sorry for the false alarm!
No worries... your feedback is always welcome!

@RalphSteinhagen RalphSteinhagen removed the request for review from dedeibel December 4, 2019 16:58
@RalphSteinhagen RalphSteinhagen merged commit fc5422e into master Dec 4, 2019
@RalphSteinhagen RalphSteinhagen deleted the feature-chart-auto-zoom branch December 4, 2019 21:36
RalphSteinhagen added a commit that referenced this pull request Dec 10, 2019
added auto-zoom and ObservableDeque feature to Zoomer plugin
dedeibel pushed a commit that referenced this pull request Dec 17, 2019
added auto-zoom and ObservableDeque feature to Zoomer plugin
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.

None yet

2 participants