JuliaPluto / PlutoUI.jl

https://featured.plutojl.org/basic/plutoui.jl
The Unlicense
302 stars 55 forks source link

Canvas to draw on #9

Open fonsp opened 4 years ago

fonsp commented 4 years ago

This can be based on the rectangle drawing demo in the Interactivity sample notebook inside Pluto.

~Speed might not be great yet, but this should improve a lot once Pluto uses MsgPack instead of JSON.~

RensDimmendaal commented 4 years ago

I'm excited about this feature. I augmented the box drawing feature for a small demo: https://twitter.com/R_Dimm/status/1305251396669800448

I don't know javascript but potentially this might serve as inspiration: https://github.com/andfanilo/streamlit-drawable-canvas they had a similar usecase but in python.

I'd be happy to take a stab at this feature someone can help specify the requirements.

fonsp commented 4 years ago

Sorry I already kind of wrote this myself: https://github.com/fonsp/disorganised-mess/blob/master/drawoncanvas.jl

🙂 let's turn it into a PlutoUI element after #3 is done

RensDimmendaal commented 4 years ago

Super. Keep up the great work!

shashankp commented 4 years ago

Great to see already something in the works.. I was prototyping about a 2D slider

image

fonsp commented 4 years ago

@dpsanders asked for that once

shashankp commented 4 years ago

Create another issue to track it?

fonsp commented 4 years ago

yep!

DhruvaSambrani commented 1 year ago

Sorry I already kind of wrote this myself: https://github.com/fonsp/disorganised-mess/blob/master/drawoncanvas.jl

slightly_smiling_face let's turn it into a PlutoUI element after #3 is done

Hi @fonsp what's the scene on this issue? Is it just a matter of someone formalizing your code?

fonsp commented 1 year ago

WIP at #234!

aplavin commented 1 year ago

@fonsp this thread and examples have been helpful! The only thing I cannot make to work is to draw an image on the canvas from julia. https://gist.github.com/RensDimmendaal/2cb0ada5750b00d703c3976df1716e14 has an example of an image from a URL, but I have the image in Julia as a regular matrix of RGB colors. How to send it to JS and draw?