Render shape label while drawing - #6608
Merged
Merged
Conversation
emilykl
commented
May 18, 2023
| @@ -0,0 +1,268 @@ | |||
| 'use strict'; | |||
Contributor
Author
There was a problem hiding this comment.
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.
emilykl
commented
May 18, 2023
| } | ||
|
|
||
| var isOpenMode = openMode(dragmode); | ||
| var newShape = createShapeObj(outlines, dragOptions); |
Contributor
Author
There was a problem hiding this comment.
The only actual change here is moving some of the logic into a separate createShapeObj() function
Contributor
|
Nicely done. |
Contributor
Author
|
Tagging @JulianWgs as well! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.jsinto its own file; that makes up the bulk of the changes in terms of # of lines. No changes to that function itself.Outstanding changes: