-
Notifications
You must be signed in to change notification settings - Fork 35
Allow selectZoom to be adaptive #67
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
Open
janekfleper
wants to merge
8
commits into
huww98:master
Choose a base branch
from
janekfleper:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d228cc
Implement adaptive selectZoom
janekfleper bed460f
Fix application of zoom onMouseUp event
janekfleper 784e324
Improve selection conditions
janekfleper ca7b774
Add private properties for the select flags
janekfleper 3e5b30e
Handle special case of equal width and height
janekfleper 700df87
Rename w and h to width and height
janekfleper f029408
Add inputs for the select thresholds
janekfleper 62c78b7
Merge branch 'huww98:master' into master
janekfleper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this condition
w >= his confusing. The preview is shown, but the zoom will not be executed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, there was a huge oversight on my part since I only tested the feature with very small thresholds...
The application of the zoom did not match the visual indicator if the height and/or width were below their respective thresholds. But the problem was not in the
onMouseMove()event as you suggested. Instead I adapted theonMouseUp()event to work exactly like the zoom indicator suggests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And regarding the documentation. I could add a section that introduces the
SelectZoomPluginjust after theTimeChartZoomPluginhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally do not like this. As you can see, the if statement becomes rather complex, and can be hard to reason about. But fine if you insist and it is properly documented.
You may add a link there. But I believe the main documentation should live at https://github.com/huww98/TimeChart/blob/master/src/plugins_extra/README.md#select-zoom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to increase the readability of the if statement and I introduced private properties for the boolean flags that decide whether an axis should be selected or not. This ensures that the same rules are applied in the events onMouseMove and onMouseUp.
I also added two inputs for the threshold in the select-zoom demo. I have never worked with forms so I just tried to copy the way you handled the checkboxes.
Do you want me to add any inline comments to explain the thresholds? And do you want me to also add documentation to the link you posted in your last comment? Or is it sufficient to have the threshold inputs in the demo?