Skip to main content
Version: 4.3

SelectionFramesOptions

Options for the frames prop of Selection — the HTML frame box drawn around each selected cell.

Generic over the cell model so the style callback's model is typed. Model defaults to dia.Cell, so the bare SelectionFramesOptions is unchanged. Pass a model type, e.g. SelectionFramesOptions<ElementModel<ElementRecord<MyData>>> to get a typed model (so model.get('data') carries MyData).

Extends

  • Options<Model>

Type Parameters

Type ParameterDefault typeDescription
Model extends dia.Celldia.Cellthe cell model passed to style (defaults to dia.Cell).

Properties

allowCellInteraction?

optional allowCellInteraction?: boolean;

cellClassName?

optional cellClassName?: string | ((model) => string);

CSS class added to each selected cell's root via highlighters.addClass. String for a static value, function for per-cell. Empty / falsy (globally or for an individual cell) skips the highlighter.

Default

'jj-is-selected'

className?

optional className?: string | ((model) => string);

Extra CSS class names added to each rendered HTML overlay box (on top of the parent's 'jj-selection-frame' class). String for a static value, function for per-cell. Whitespace-separated multiple names are supported. Skipped when empty / falsy.


margin?

optional margin?: Margin;

rotate?

optional rotate?: boolean;

shouldRender?

optional shouldRender?: (model) => boolean;

Predicate run per cell. When true, the cell also gets an HTML overlay box (parent behavior). The highlighter class (cellClassName) is applied independently of this predicate. Default: () => false (class only, no boxes).

Parameters

ParameterType
modelCell

Returns

boolean


style?

optional style?: ItemStyle<Model>;

useModelGeometry?

optional useModelGeometry?: boolean | UseModelGeometryCallback;