Skip to main content

ShapePaletteComponent

Provides a palette that renders a shape library, from which new vertices can be dragged onto a surface.

Properties​

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​


dataGenerator?​

optional dataGenerator: DataGeneratorFunction = undefined

Optional function you can use to set some initial data for an element being dragged. Note that you cannot override the object's type with this function.

Input​


dragSize​

dragSize: Size

Optional size to use for dragged elements.

Input​


fill?​

optional fill: string = ShapeLibraryDefaults.FILL

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

Input​


iconSize​

iconSize: Size

Optional size to use for icons.

Input​


initialSet?​

optional initialSet: string

When the shape library contains multiple sets, use this to instruct the palette that you want it to initially load just displaying this set. Optional.

Input​


inspector?​

optional inspector: boolean = true

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

Input​


onVertexAdded?​

optional onVertexAdded: OnVertexAddedCallback

Callback to invoke when a vertex has been dropped on the canvas

Input​


outline?​

optional outline: string = ShapeLibraryDefaults.STROKE

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

Input​


paletteStrokeWidth?​

optional paletteStrokeWidth: number = 1

Stroke width to use in shapes in the 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​


selectAfterDrop?​

optional selectAfterDrop: boolean = true

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

Input​


showAllMessage?​

optional showAllMessage: string = "Show all"

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​


updateTypeOnPaletteTap?​

optional updateTypeOnPaletteTap: boolean = false

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​