-
Notifications
You must be signed in to change notification settings - Fork 75
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
Added line annotations. #681
Conversation
Rectangle annotations can be created by clicking opposite points rather than dragging the outline. This allows them to be created on a touch device. Added style and editstyle convenience functions to annotations -- rather than have to ask for annotation.options('style'), you can do annotation.style(). Fix an issue with the touch handler that produced an offset to the touch event. Fix an issue in the line feature that didn't recompute the search data when just styles were changed. Fix an issue with the lines demo where the tooltip wouldn't always show.
Codecov Report
@@ Coverage Diff @@
## master #681 +/- ##
==========================================
+ Coverage 95.14% 95.24% +0.09%
==========================================
Files 83 83
Lines 8678 8850 +172
==========================================
+ Hits 8257 8429 +172
Misses 421 421
Continue to review full report at Codecov.
|
@@ -482,8 +499,6 @@ var annotationLayer = function (args) { | |||
case 'point': | |||
position = [feature.position()(data, data_idx)]; | |||
break; | |||
default: |
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.
Cannot see in diff.. but i guess we do not need return here?
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.
There are only three conditions, so we don't need to.
], function (keyidx, key) { | ||
$.each([ | ||
'closed', 'fill', 'fillColor', 'fillOpacity', 'line', | ||
'lineCap', 'lineJoin', 'polygon', 'position', 'radius', |
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.
should we maintain this list explicitly as some object?
if (evt.pageX === undefined && evt.center !== undefined && evt.center.x !== undefined) { | ||
evt.pageX = evt.center.x + offset.left; |
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.
No need for offset now? Or is that included now.
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.
We just talked about, but I'll add a note for the historical record: I was mistaken in adding the offset originally, but didn't notice until I added lines. This fixed it.
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 the example and everything worked as expected.
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.
LGTM
Added line annotations.
Rectangle annotations can be created by clicking opposite points rather than dragging the outline. This allows them to be created on a touch device.
Added style and editstyle convenience functions to annotations -- rather than have to ask for
annotation.options('style')
, you can doannotation.style()
.Fix an issue with the touch handler that produced an offset to the touch event.
Fix an issue in the line feature that didn't recompute the search data when just styles were changed.
Fix an issue with the lines demo where the tooltip wouldn't always show.