Skip to main content

CreateFrontEndObject

Wolfram Kernel
Execution environment
Notebook`Editor`FrontendObject`
Context

creates a reference to the inner expression and stores it into frontend objects storage shared with Kernel and Notebook

CreateFrontEndObject[expr_, id_String | Null, opts___Rule] _FrontEndExecutable

Returns FrontEndExecutable object with a given id or generated.

See more about it in Frontend Objects

This is a fundamental component for Graphics, InputRange... and other interactive elements, which are too large to be stored inline in the editor.

tip

If you do not want to apply CreateFrontEndObject on your symbol manually, consider to define MakeBoxes for StandardForm. Then it can be applied automatically once it goes to the output cell.

Options

"Store"

Specifies which to storage to use for an expression ("Frontend", "Kernel", or All). The default values is All.

Each time you create Graphics or any other frontend object, it makes two copies of it: the first one is shared with a browser (WLJS), while the second one is a private copy used by Wolfram Kernel once fetched by FrontEndRef or evaluated for a second time (see ViewBox).

Applications

It is mostly used for storing heavy expressions to be executed as WLJS Functions such as Graphics, Graphics3D, Audio and etc.

Other use cases are provided by its derivative - FrontEndExecutable, which has an UpValue for StandardForm and WLXForm used for printing the data for output wolfram language cells and Slides.

Exporting

Created stored objects are fully portable and can be automatically exported to Static HTML, Dynamic HTML, Slides or as Figures