WLJS LogoWLJS Notebook

MMAView

Wolfram Kernel
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

Blocking function. Avoid using it in timers like SetTimeout, external event handlers such as InputButton or Button, or within AsyncFunction. Use MMAViewAsync instead.

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

For example

Plot3D[(*SpB[*)Power[x(*|*),(*|*)2](*]SpB*) (*SpB[*)Power[y(*|*),(*|*)2](*]SpB*), {x,0,1}, {y,0,1}] // MMAView

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, 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]
]

Interactive 3D view cannot be exported to any portable format

Manipulate

There is a similar wrapper for Manipulate

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

It literally streams uncompressed raster images in real-time. Please do not overuse it.

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

On this page