-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Render shape label while drawing #6608
Conversation
@@ -0,0 +1,268 @@ | |||
'use strict'; |
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.
This is just the drawLabels()
function which used to be in shapes/draw.js
being moved into its own file (in order to call it elsewhere without circular imports). No code changes.
@@ -70,8 +62,65 @@ module.exports = function newShapes(outlines, dragOptions) { | |||
} | |||
} | |||
|
|||
var isOpenMode = openMode(dragmode); | |||
var newShape = createShapeObj(outlines, dragOptions); |
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.
The only actual change here is moving some of the logic into a separate createShapeObj()
function
Nicely done. |
Tagging @JulianWgs as well! |
Closes #6540
Render shape label text during initial shape draw.
Codepen demo here: https://codepen.io/emily_plotly/pen/eYLrKNV
This PR leverages the existing newshape code to render the shape label while the shape is being drawn.
@alexcjohnson @archmoj I'm very interested to get your feedback on whether this approach makes sense and whether there might be any unintended side effects.
Note: I moved the
drawLabels()
function fromshapes/draw.js
into its own file; that makes up the bulk of the changes in terms of # of lines. No changes to that function itself.Outstanding changes: