PlutoUI -Recompute button (reactive trigger) #2423
-
I love this functionality! But I would love there to be a similar button for "Compute" rather than "Recompute" (i.e. the cell does not evaluate by default. It does evaluate every time the button is clicked, but the first evaluation occurs after the first click) EDIT: I want it to allow downloading plots only when they look exactly like the user wants. The download button does not work for me (error message below), so fixing that would also solve my case. However, I do think that having cells that only evaluate on command would be very cool (especially while building a notebook). This is my error message:
And this is my cell script:
Changing the backend did not solve it. Should I wrap my plot inside something? I was thinking something like
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
You could do something like: @bind should_compute Checkbox() if should_compute
do_thing()
end or: @bind clicked CounterButton() if clicked > 0
do_thing()
end |
Beta Was this translation helpful? Give feedback.
-
About the download button: it currently only supports a repr(MIME("image/png"), p) so you button would look like: DownloadButton(repr(MIME("image/png"), p), "plot.png") |
Beta Was this translation helpful? Give feedback.
-
Thanks! Didn't think about MIME... That is a great and neat solution :D The problem with using For the sake of context, the notebook uses I'd considered the question answered, thanks! |
Beta Was this translation helpful? Give feedback.
About the download button: it currently only supports a
String
or aVector{UInt8}
(byte array) as input. You can render a plot to png data like so:so you button would look like: