Controlling Manipulate in cloud deployment

4

2

Suppose I want to create a web app which duplicates (for simplicity), something like

Manipulate[Plot[Sin[n x], {x, 0, Pi}], {n, 3, 10, 1}]

FormFunction seems similar, but I can't see how to give it ranges of values. This must be trivial...

Igor Rivin

Posted 2019-10-13T19:57:32.217

Reputation: 4 896

Answers

3

Read examples in docs carefully (CloudDeploy, FormFunction, FormPage) and see related tutorials. Two options.

1) Outsource control to FormFunction / FormPage:

CloudDeploy[
    FormPage[
        {"n" -><|"Interpreter" -> Restricted["Real",{3,10}], "Control" -> Slider|>}, 
        Plot[Sin[#n x],{x,0,Pi}]&],
"test"]

2) Keep control in Manipulate and simply CloudDeploy:

CloudDeploy[Manipulate[Plot[Sin[n x], {x, 0, Pi}], {n, 3, 10}], "tmp"]

Vitaliy Kaurov

Posted 2019-10-13T19:57:32.217

Reputation: 66 672

1Cool! That is perfect! – Igor Rivin – 2019-10-14T17:24:37.983