-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Shape drawing doc #2407
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
Shape drawing doc #2407
Conversation
doc/python/images.md
Outdated
|
||
In order to enable shape drawing, you need to | ||
- define a dragmode corresponding to a drawing tool (`'drawline'`,`'drawopenpath'`, `'drawclosedpath'`, `'drawcircle'`, or `'drawrect'`) | ||
- add modebar buttons corresponding to the drawing tools you wish to use. |
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.
link to the config doc 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.
done!
doc/python/images.md
Outdated
img_height = 900 | ||
scale_factor = 0.5 | ||
fig.add_layout_image( | ||
dict( |
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 dict
here is redundant I'm pretty sure, as add_layout_image
accepts these values as kwargs
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.
yes!
doc/python/shapes.md
Outdated
|
||
_introduced in plotly 4.7_ | ||
|
||
You can create layout shapes programatically, but you can also draw shapes manually by setting the `dragmode` to one of the shape-drawing modes: `'drawline'`,`'drawopenpath'`, `'drawclosedpath'`, `'drawcircle'`, or `'drawrect'`. If you need to switch between different shape-drawing or other dragmodes (panning, selecting, etc.), modebar buttons can be added in the `config` to select the dragmode. If you switch to a different dragmode such as pan or zoom, you will need to select the drawing tool in the modebar to go back to shape drawing. |
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.
add link to config doc?
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.
done!
The CI is now green! |
💃 ! |
I've prepared the tutorials for shape drawing in preparation JS 1.54 / py 4.7. The CI will obviously fail until we upgrade the code to 1.54.
If you wish to test these tutorials locally, you should fetch this branch and run
to get the right plotly.js branch