DocumentTools/Canvas/Script/SetOption - Maple Help

DocumentTools[Canvas][Script]

 SetOption
 set canvas or canvas element properties

 Calling Sequence SetOption(script,property,value)

Parameters

 script - DocumentTools:-Canvas:-Script object property - string; property name value - property value

Description

 • The SetOption command allows you to set properties of the active canvas element and/or the entire canvas.   The options set by this command only control script playback within the Maple Learn environment, and are invisible to operation within Maple.
 • The options that can be set are as follows:

 Option Value Default Description "ANGLE" "RAD","DEG" "RAD" Set angles to radians or degrees "DELAY" 0 .. 5000 200 Set delay between script commands in milliseconds "ISTEXT" truefalse false Toggle between Math and Text. In Text mode, content is not evaluated and no result or plot is displayed "PLOT" truefalse true Enable/disable showing the current expression on the plot preview "READONLY" truefalse false Enable/disable read-only setting on math container. If read-only is set, that also disables calculator results "RESULT" truefalse true Enable/disable showing the calculator result on the currently active math content "SHOWERROR" truefalse true Enable/disable showing of error messages next to math cell "SLIDER" truefalse true Enable/disable slider on currently active (math) content. Also has effect on any subsequently created math content "SLIDER:INC" numeric 1 The increment value is not currently used, except for deciding whether the slider is discrete (integer value) or continuous (float value) "SLIDER:MAX" numeric 10 Set the maximum endpoint of the slider for the currently active math content "SLIDER:MIN" numeric -10 Set the minimum endpoint of the slider for the currently active math content

 • A "canvas" is an interactive section of a Maple document created by the NewCanvas command, or a shared web-based Maple Learn document.   See the Script command for a more complete description.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Canvas}\right):$
 > $\mathrm{sc}≔\mathrm{Script}\left('\mathrm{mode}'='\mathrm{Learn}'\right):$
 > $\mathrm{SetOption}\left(\mathrm{sc},"ANGLE","DEG"\right)$
 > $\mathrm{SetActive}\left(\mathrm{sc},"1:0"\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"PLOT",\mathrm{true}\right)$
 > $\mathrm{SetActive}\left(\mathrm{sc},"1:1"\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"SLIDER",\mathrm{true}\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"SLIDER:MIN",0\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"SLIDER:MAX",360\right)$
 > $\mathrm{SetActive}\left(\mathrm{sc},"1:2"\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"PLOT",\mathrm{true}\right)$
 > $\mathrm{SetActive}\left(\mathrm{sc},"1:3"\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"PLOT",\mathrm{true}\right)$
 > $\mathrm{SetActive}\left(\mathrm{sc},"1:4"\right)$
 > $\mathrm{SetOption}\left(\mathrm{sc},"PLOT",\mathrm{true}\right)$
 > $\mathrm{cv}≔\mathrm{NewCanvas}\left(\left["Unit Circle",\mathrm{Group}\left(\left[{x}^{2}+{y}^{2}=1,n\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&:=\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}360,P\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&:=\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Point}\left(\mathrm{cos}\left(n\right),\mathrm{sin}\left(n\right)\right),\mathrm{Segment}\left(\mathrm{Point}\left(0,0\right),P\right),\mathrm{Segment}\left(\mathrm{Point}\left(\mathrm{cos}\left(n\right),0\right)\right)\right]\right)\right],\mathrm{sc}\right):$
 > $\mathrm{ShareCanvas}\left(\mathrm{cv}\right)$

Compatibility

 • The DocumentTools[Canvas][Script][SetOption] command was introduced in Maple 2021.