Create a CDF file with a plot that cannot be edited by double-clicking

5

2

I have created a CDF file that contains a Manipulate object with a plot. I intend to embed the file in a web site, so that users can use interactive sliders to change the parameters of the plot.

My problem is that when opening the CDF file in a browser, the user can double-click on the plot and edit it (move lines, move points, etc.). The only interactive content I want in the web site are the sliders produced by Manipulate. How can I create a CDF file that doesn't allow the user to edit the plot?

Joe

Posted 2012-04-19T09:03:35.633

Reputation: 1 451

Could you be more specific on the 'buggy behaviour' part? Perhaps you could post a simplified example so that we can investigate it more closely. – István Zachar – 2012-04-19T13:21:36.497

Answers

7

Wrap the output of the CDF (the Plot command in your case) into Deploy, or add the Deployed -> True option to your Manipulate.

Using the Deployed option however does not solve all the problems. The documentation states, that Deployed -> True disables:

...general editing and selection in a cell

General editing/selection means that in the following example one can not select individual expressions of the list (e.g. "text"), but still graphics editing is possible, as the screenshot clearly shows:

Manipulate[{"text", Plot[x^n, {x, 0, 3}]}, {n, 0, 10}, Deployed -> True]

Mathematica graphics

Thus to make output really bulletproof, wrap each Graphics object into Deploy as well:

Manipulate[{"text", Deploy@Plot[x^n, {x, 0, 3}]}, {n, 0, 10}, Deployed -> True]

István Zachar

Posted 2012-04-19T09:03:35.633

Reputation: 44 135

Adding the Deploy->True option to Manipulate doesn't lead to the desired result and produces buggy behavior. Wrapping the Plot command with Deploy, however, does exactly what I need - thank you! – Joe – 2012-04-19T12:18:13.237

To answer @István-Zachar, the buggy behavior is manifested, for example, in the output of: Manipulate[Plot[x^n,{x,0,3}],{n,0,10},Deployed->True]. Usually when I evaluate this expression, I can edit the result once by double clicking, and only after the first edit it becomes immune to further editing. I say 'usually' because the result is not completely predictable. I'm using version 8.0.4.0. – Joe – 2012-04-19T13:40:56.347

@Joe please see my update. I wasn't aware of this situation, though I'm pretty sure that I ran into this before, and that's why now I prefer Deploy over Deployed. – István Zachar – 2012-04-19T14:10:44.737

You have answered my question completely, I'm just curious: Why do you use both Deploy and Deployed? What do you achieve by using the Deployed->True option, that is not already achieved by wrapping the Plot function with Deploy? – Joe – 2012-04-20T11:40:42.513

@Joe: As you see, the actual output of the Manipulate (that is displayed) is a list: the Deployed option prevents e.g. selecting members of this list, but does not prevent editing Graphics, so the Plot must be wrapped in Deploy. Just try the whole thing withouth the Deployed->True option, and you will see that you can select "text", or different parts of the list. – István Zachar – 2012-04-20T11:44:12.463

Yes I see, but in the case I'm considering the output of the Manipulate is only a Plot, and not a list, so I think I don't need the Deployed option. – Joe – 2012-04-20T21:27:41.647

@Joe: that is correct. – István Zachar – 2012-04-21T09:03:35.940