jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
685 stars 62 forks source link

bundle text and shape into one object #310

Closed bhomass closed 1 year ago

bhomass commented 1 year ago

can we bundle a shape like a rectangle with a few lines of text inside, just like how you would group elements together in powerpoint?

martinRenou commented 1 year ago

You could draw your rectangle and text on a separate canvas that you don't display on the screen, and then draw this separate canvas on your main canvas. Maybe that would fit your needs?

bhomass commented 1 year ago

Hi thanks, I can't find a direct api call to paint a member canvas to the main canvas. which method do you suggest?

martinRenou commented 1 year ago

You can draw a canvas on another one with draw_image https://ipycanvas.readthedocs.io/en/latest/drawing_images.html?highlight=draw_image#from-another-canvas

bhomass commented 1 year ago

thanks worked!