-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Draw & adjust new shapes over image trace and cartesian subplots #4775
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
Merged
Merged
Changes from 68 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
ac75850
should not coerce shape.line.color and line.dash when line.width is zero
archmoj d5ee950
use Math.max instead of complex logic
archmoj 3ecddcb
refactor conditions - avoid using Bitwise NOT to invert -1
archmoj eee814e
refactor list of dragmodes
archmoj 0a0326c
reuse cartesian clearSelect function in mapbox and geo
archmoj 11879d1
add new icons and modebars to draw new shapes
archmoj ddfc1bd
add new dragmodes and helpers
archmoj 3ea4a25
add new attributes for drawing new shapes
archmoj d0ade83
handle scattergl and splom
archmoj 8fd8b0c
prep to handle mapbox and ternary
archmoj 07b07dc
add new shapes over cartesian traces
archmoj 0c495e1
enable new modebars by default for now i.e. to test
archmoj 1040786
improve edit open paths
archmoj 47870fa
prep to edit curves
archmoj 1106180
towards better handling of closing point
archmoj a585394
rename new dragmodes as well as modebar button names
archmoj 092a80e
improve shape type defaults considering path in template
archmoj 31209e7
init handle svg curves edits
archmoj feb7ab1
fix moving curve and handle multi-path e.g. smiley face on shapes mock
archmoj 396d7d3
fix drag start points on closed paths
archmoj 838bda9
revise description and use pre computed indices for circles
archmoj 90a7ec7
simplify shape activation
archmoj 618d138
fix date extra curve positions
archmoj c22bc77
simplify handle plotinfo axes and dates
archmoj 5e1c9d9
fix edits with paper anchor
archmoj adb65f6
fixup for traces that has select but not x and y axes
archmoj 38aef9e
do not change template shapes for now
archmoj 98c7e9a
better handle for multiple polygons - only one newShape at a time
archmoj fc1d347
improve type detection on edit
archmoj 569ce1c
fix circle on log
archmoj a20b290
fix closing point on path
archmoj 77bf203
fix edit shapes with refs to one cartesian axis as well as paper
archmoj 5f57d5c
create a reusable function to prepare options and plotinfo for arrayE…
archmoj 9a4f4bf
move makeOptionsAndPlotinfo to shape helpers
archmoj 18dd4f8
deactivate shape from pan and zoom dragmodes
archmoj 1fcd55a
handle other deactivation scenarios
archmoj 281666e
accept pre-defined draw buttons as string
archmoj 83b6cd2
apply _guiRelayout instead of relayout when adding a new shape
archmoj cedad52
improve description
archmoj b90d179
Ensure config.editable:true works as it was before
archmoj 7c26cd1
corce fillrule for all shape types
archmoj 4bcc06a
correct early return from shape drawOne
archmoj f0ae835
fixup ternary clearSelect call
archmoj f7643cc
fixup ternary select
archmoj 268aaaa
improve read shape positions
archmoj bea9230
add modebar test
archmoj dffe30a
draw shape test
archmoj ae24e27
active shape test
archmoj 8c8f724
fix double click path vertices
archmoj 852a7fb
add test for eraseshape button
archmoj 3eee6f1
Update test/jasmine/tests/draw_shape_test.js
archmoj 44dec73
update draw modebar button descriptions
archmoj d99b44b
update shape.editable description
archmoj 1f19699
clear ternary and add comment about mapbox
archmoj a666206
erase getAxId helper function
archmoj 63ef7aa
move newshape & activeshape attributes & defaults to components/shape…
archmoj d7e24b8
remove extra layer to activate shape on click
archmoj 1089cd4
move newshape draw functions from cartesian to components/shapes/draw…
archmoj 26def59
rename new tests to draw_newshape
archmoj 6dbbd5c
fixup remove vertex
archmoj a824d85
split new draw code into multiple files
archmoj c5ff5df
revise outline updates in shape eidts
archmoj 4039257
correct call to update vertices on click
archmoj 0662ae7
apply arrayEditor to produce the updates for shapes in layout
archmoj d017bb7
simplify ellipse edit updates
archmoj 9cd1ba1
simplify vertex buttons
archmoj 00b6ae2
no need to display vertex controllers while dragging
archmoj efc85d6
simplify - no need for special cursor handling for rects
archmoj c69244f
simplify controllers - no need for invisible draggers
archmoj 0ad14d1
split one big test into smaller tests to avoid side effects and futur…
archmoj 2911e4f
speed up interactive circle edits
archmoj 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* Copyright 2012-2020, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
exports.selectMode = function(dragmode) { | ||
return ( | ||
dragmode === 'lasso' || | ||
dragmode === 'select' | ||
); | ||
}; | ||
|
||
exports.drawMode = function(dragmode) { | ||
return ( | ||
dragmode === 'drawclosedpath' || | ||
dragmode === 'drawopenpath' || | ||
dragmode === 'drawline' || | ||
dragmode === 'drawrect' || | ||
dragmode === 'drawcircle' | ||
); | ||
}; | ||
|
||
exports.openMode = function(dragmode) { | ||
return ( | ||
dragmode === 'drawline' || | ||
dragmode === 'drawopenpath' | ||
); | ||
}; | ||
|
||
exports.rectMode = function(dragmode) { | ||
return ( | ||
dragmode === 'select' || | ||
dragmode === 'drawline' || | ||
dragmode === 'drawrect' || | ||
dragmode === 'drawcircle' | ||
); | ||
}; | ||
|
||
exports.freeMode = function(dragmode) { | ||
return ( | ||
dragmode === 'lasso' || | ||
dragmode === 'drawclosedpath' || | ||
dragmode === 'drawopenpath' | ||
); | ||
}; | ||
|
||
exports.selectingOrDrawing = function(dragmode) { | ||
return ( | ||
exports.freeMode(dragmode) || | ||
exports.rectMode(dragmode) | ||
); | ||
}; |
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.