4
$\begingroup$

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...

$\endgroup$

1 Answer 1

4
$\begingroup$

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"]
$\endgroup$
1
  • 1
    $\begingroup$ Cool! That is perfect! $\endgroup$
    – Igor Rivin
    Oct 14, 2019 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.