FrontInstanceGroup
FrontInstanceGroup[] _FrontInstanceGroupconstructs a group container for frontend expressions (or symbols).
Normally one can append objects on existing plots using FrontSubmit, this group container allows to undo those action by disposing the created instances (even if they are nested). It does also support batch operations.
To add expressions into created group, use the following pattern
g = FrontInstanceGroup[];
g[{Red, Disk[]}]This expression is immutable
Methods
FrontSubmit
Evaluates the group on the frontend
group = FrontInstanceGroup[];
FrontSubmit[group[expr_], scene]one can submit multiple groups as well
...
FrontSubmit[{group1[expr_], group2, ...}, scene]Delete
Disposes created group (s)
Delete[_FrontInstanceGroup | __FrontInstanceGroup]FrontInstanceGroupRemove
Akin to Delete but allows to specify the window
FrontInstanceGroupRemove[_FrontInstanceGroup | __FrontInstanceGroup | {__FrontInstanceGroup}, opts___]where opts can be
"Window"
By the default is CurrentWindow
Example
The common use case is to be able to add and remove groups of expressions from the some frontend instance. For example to add and then remove primitives from a plot
scene = FrontInstanceReference[];
Plot[x, {x,0,1}, Epilog->{scene}]now add an object
group = FrontInstanceGroup[];
FrontSubmit[{Red, Disk[]} // group, scene];and dispose created instanced and revert any side effects
FrontInstanceGroupRemove[group]