Skip to main content

DiagramPaletteComponent

Provides a palette for a diagram.

Implements​

  • AfterViewInit

Methods​

ngAfterViewInit()​

ngAfterViewInit(): void

A callback method that is invoked immediately after Angular has completed initialization of a component's view. It is invoked only once when the view is instantiated.

Returns​

void

Implementation of​

AfterViewInit.ngAfterViewInit

Properties​

allowClickToAdd?​

optional allowClickToAdd: boolean

When in tap mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)

Input​


allowDropOnEdge?​

optional allowDropOnEdge: boolean | CanDropOnEdgeFilter = false

Whether or not to allow drop on edge. Defaults to false.

Input​


allowRotation?​

optional allowRotation: boolean = true

Whether or not to allow rotation of elements being dragged. Defaults to true.

Input​


autoEdgeConnect?​

optional autoEdgeConnect: boolean | AutoEdgeConnectOptions

Controls whether the palette will automatically connect a new vertex being dragged onto the canvas to existing vertices, if the shape definitions for the new vertex and/or the existing vertices have source/target elements. You can set this to simply 'true', and use defaults, or you can provide values for various options.

Input​


autoExitDrawMode?​

optional autoExitDrawMode: boolean

Defaults to true: when in 'tap' mode and a new group/node has been drawn on the canvas, the UI is set back to pan mode.

Input​


dragSize?​

optional dragSize: Size

Optional size to use for dragged elements.

Input​


fill?​

optional fill: string

Optional fill color to use for dragged elements. This should be in RGB format, not a color like 'white' or 'cyan' etc.

Input​


iconSize?​

optional iconSize: Size

Optional size to use for icons. Defaults to 150x100 pixels. If you provide this but not dragSize this size will also be used for an icon that is being dragged.

Input​


inputDiagram?​

optional inputDiagram: Diagram

Optional diagram to attach to. It is not generally necessary to supply this as it will be retrieved from the context.

Input​


inspector?​

optional inspector: boolean

When true, selecting an element in the canvas will cause its related shape to be selected in the palette. Defaults to true.

Input​


mode?​

optional mode: PaletteMode

Mode to operate in - 'drag' or 'tap'. Defaults to 'drag' (PALETTE_MODE_DRAG).

Input​


onCellAdded()?​

optional onCellAdded: (dc) => any

Callback to invoke when a new diagram cell has been added.

Parameters​

dc​

DiagramCell

Returns​

any

Input​


onVertexAdded?​

optional onVertexAdded: OnVertexAddedCallback

Optional callback that will be invoked after a new vertex has been dropped and added to the dataset.

Input​


outline?​

optional outline: string

Optional color to use for outline of dragged elements. Should be in RGB format.

Input​


paletteStrokeWidth?​

optional paletteStrokeWidth: number

Stroke width to use for shapes in palette. Defaults to 1.

Input​


preparedShapes?​

optional preparedShapes: PreparedShape[]

Optional set of prepared shapes to show in the palette. When this is provided, the palette will only render these shapes, and not the contents of the shape library.

Input​


rotationSpeed?​

optional rotationSpeed: number = 2000

The number of milliseconds required to complete a full rotation of an element when the trigger key is held down. Defaults to 2000.

Input​


selectAfterAdd?​

optional selectAfterAdd: boolean

When true (which is the default), a newly dropped shape will be set as the underlying model's selection.

Input​


showAllMessage?​

optional showAllMessage: string

Message to use for the 'show all' option in the shape set drop down when there is more than one set of shapes. Defaults to Show all.

Input​


showGroups?​

optional showGroups: boolean = true

Whether or not to show groups in the palette. Defaults to true.

Input​


showLabels?​

optional showLabels: boolean

Optionally show each shape icon's label underneath it

Input​


updateTypeOnPaletteTap?​

optional updateTypeOnPaletteTap: boolean

When true, clicking on an entry in the palette will change the type of any selected vertices to that type. Defaults to false. This is a potentially destructive operation if the properties of the new shape type are not compatible with the old one.

Input​