Ir al contenido

Palette

Defined in: export/Palette.ts:10

A palette shows templates that can be dragged onto a diagram. Dragging a template item onto the diagram adds a new node.

new Palette(container, diagram?, templates?, options?): Palette

Defined in: export/Palette.ts:17

HTMLElement

Diagram

Template[]

boolean

Palette

destroy(): void

Defined in: export/Palette.ts:170

Destroy the palette and clean up.

void


getDiagram(): Diagram

Defined in: export/Palette.ts:55

Get the diagram this palette is connected to.

Diagram


getElement(): HTMLDivElement

Defined in: export/Palette.ts:50

Get the palette DOM element.

HTMLDivElement


handleDropOnDiagram(templateId, diagramX, diagramY): NodeData | null

Defined in: export/Palette.ts:157

Handle a drop of a template onto the diagram. Called externally by the diagram’s drop handling.

string

number

number

NodeData | null


setTemplates(templates): void

Defined in: export/Palette.ts:60

Set the templates shown in this palette.

Template[]

void