MSPManipulate
generates interactive web controls that allow interactive manipulation of the value of u
allows the value of u to vary between umin and umax in steps du
takes the initial value of u to be uinit
labels the controls for u with ulbl
allows u to take on discrete values u1,u2,…
provides controls to manipulate each of the u, v, …
DetailsDetails
- MSPManipulate provides a web version of the function Manipulate.
- You must load the MSPManipulate` package to use the webMathematica interactive tools.
- MSPManipulate automatically formats the expression expr into an image.
- MSPManipulate creates the following controls by default.
-
{u, min, max} slider ranging in value from min to max {u, min, max, step} slider ranging in value from min to max in increments of step {u, {True, False}} checkbox {u, {u1, u2, …}} setter bar for few elements; popup menu for more {u} blank input field {{u,uinit},…} control with initial value uinit {{u,uinit,ulbl}, …} control with label ulbl - MSPManipulate takes the following options.
-
ContainerStyle formatting for the web page container ControlPlacement placement of controls ControlType type of controls to use FormatType the type of formatting to use OutputSize the size in pixels for the entire interactive control - ControlType and ControlPlacement pos options can be given separately for each control.
- The option setting ControlPlacement pos specifies that controls should be placed at positionpos relative to expr. Possible settings forpos are Bottom, Left, Right, and Top.
- The option setting gives styles for the web container. Possible style settings are:
-
"BorderColor" Black color to draw the border "BorderThickness" 1 thickness for the border "BorderStyle" solid style to draw the border "PaddingTop" 10 padding on the top "PaddingBottom" 10 padding on the bottom "PaddingLeft" 10 padding on the left "PaddingRight" 10 padding on the right - The option setting ControlsRendering type specifies the style used to render sliders. The default setting forpos is "Generic" which gives standard Flash sliders. Alternatively, it can be set to "FrontEnd.Windows" or "FrontEnd.Macintosh" which will display with the sliders similar to those used by the notebook front end on Windows or Macintosh respectively. A setting of "FrontEnd" will display with Macintosh sliders in browsers on Macintosh platforms otherwise it will use the front end Windows style.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
The following creates an interactive plot controlled by a slider and a checkbox.
<msp:evaluate>
MSPManipulate[
Plot[ Cos[var+x], {x,0,2Pi}, Frame -> frame],
{var, 0,20}, {frame, {True,False}}]
</msp:evaluate>
You can change the default style of some of the controls using the ControlType option. The following example uses a PopupMenu to represent the choices; without the option a SetterBar would be used.
<msp:evaluate>
MSPManipulate[ Plot[ fun[x],{x,0,20}], {fun, {Sin, Cos}},
ControlType -> PopupMenu]
</msp:evaluate>
MSPManipulate always formats its argument into an image; by default it uses StandardForm. However, it can be changed to format into TraditionalForm; which is shown in the following.
<msp:evaluate>
MSPManipulate[ Integrate[ 1/(1^-num),x], {num, 1,20,1},
FormatType -> TraditionalForm]
</msp:evaluate>
The size of the finished interactive web output can be controlled by the OutputSize option. This has a default that tries to keep track of the number of controls. If there is not enough space then scrollbars will be added automatically. In the following example a size of 800 by 800 pixels is used.
<msp:evaluate>
MSPManipulate[ Integrate[ 1/(1^-num),x], {num, 1,20,1},
OutputSize -> {800,800}]
</msp:evaluate>
- Services
- Technical Consulting
- Corporate Consulting
- Company
- Events
- About Wolfram
- Careers
- Contact
- Connect
- Wolfram Community
- Wolfram Blog
- Newsletter