Skip to main content

DiagramCell

A cell in a diagram, offering methods to set/get its position and size, and to update its backing data.

Accessors​

color​

Get Signature​

get color(): number

Gets the cell's text color

Returns​

number


fill​

Get Signature​

get fill(): string

Gets the cell's fill color.

Returns​

string


height​

Get Signature​

get height(): number

Get the height of the cell.

Returns​

number


id​

Get Signature​

get id(): string

Gets the cell's ID.

Returns​

string


label​

Get Signature​

get label(): string

Gets the cell's label. May be null

Returns​

string


outline​

Get Signature​

get outline(): string

Gets the cell's outline color.

Returns​

string


outlineWidth​

Get Signature​

get outlineWidth(): number

Gets the cell's outline width.

Returns​

number


position​

Get Signature​

get position(): PointXY

Gets the cell's position relative to the canvas origin.

Returns​

PointXY


size​

Get Signature​

get size(): Size

Get the size of the cell.

Returns​

Size


width​

Get Signature​

get width(): number

Get the width of the cell.

Returns​

number


zIndex​

Get Signature​

get zIndex(): any

Gets the cell's current z index.

Returns​

any

Methods​

remove()​

remove(): void

Removes the cell, and the model object it represents.

Returns​

void


setColor()​

setColor(color): void

Sets the cell's label color

Parameters​

color​

string

Returns​

void


setFill()​

setFill(fill): void

Sets the cell's fill color.

Parameters​

fill​

string

Color to set. Use a value in hex or rgb format, not a color name, if you want to export SVG or an image.

Returns​

void


setLabel()​

setLabel(label): void

Sets the cell's label.

Parameters​

label​

string

Returns​

void


setOutline()​

setOutline(outline): void

Sets the cell's outline color.

Parameters​

outline​

string

Color to set. Use a value in hex or rgb format, not a color name, if you want to export SVG or an image.

Returns​

void


setOutlineWidth()​

setOutlineWidth(outlineWidth): void

Sets the cell's outline stroke width.

Parameters​

outlineWidth​

number

Returns​

void


setPosition()​

setPosition(p): void

Sets the position of the cell

Parameters​

p​

PointXY

The new position to set.

Returns​

void


setSize()​

setSize(s): void

Sets the size of the cell

Parameters​

s​

Size

The new size to set.

Returns​

void


toBack()​

toBack(): void

Send this cell to the back.

Returns​

void


toFront()​

toFront(): void

Bring this cell to the front.

Returns​

void


update()​

update(updates): void

Update the cell's backing data. If you want to change the position or size of the cell, use setSize or setPosition in preference to this.

Parameters​

updates​

ObjectData

Returns​

void

Properties​

el​

el: BrowserElement

The DOM element pertaining to the cell. Will be null until rendering has completed.