Skip to main content

MMAView

Wolfram Kernel
Execution environment
MMAView[head_[args__]]
MMAView[_Animate]
MMAView[_Manipulate]
MMAView[_Graphics3D]

attempts to use Mathematica's frontend (technically backend) to render given expression to a raster Image and return it back.

Note: MMAView has HoldFirst attribute

WLJS Notebook does not support all possible styling and diagram types compared to Wolfram Mathematica. Here we give a user a workaround, which might be suitable for many cases.

For example

Graphics3D

We have a special wrapper for Graphics3D -like plots to make them interactive in the session

With[{p = Plot3D[x^2 y, {x,0,10}, {y,0,10}]},
MMAView[p]
]
note

Note, that it is important to pass it using With, since MMAView has HoldFirst attribute. Otherwise the direct pass will give your a static plot

How to force static view

One can bypass UpValue for Graphics3D by

With[{p = Plot3D[x^2 y, {x,0,10}, {y,0,10}]},
MMAView[p // Rasterize]
]
warning

Interactive 3D view cannot be exported to Dynamic HTML or MDX. Use static only

Manipulate

There is a similar wrapper for Manipulate

Manipulate[Plot[Sin[x y], {x,0,1}], {y,0,5}] // MMAView

warning

It literally streams uncompressed raster images in real-time. Please do not overuse it, and try to use WLJS dynamics in general if possible.

If it detect Graphics3D inside Manipulate it also provides mouse controls over it

Manipulate[Plot3D[Sin[n x] Cos[n y], {x,-1,1}, {y,-1,1}], {n, 1, 5, 1}] // MMAView

Animate

The same as before but for Animate

Animate[Plot[Sin[x y], {x,0,1}], {y,0,5}] // MMAView