Skip to main content

ShapesOptions

Options for a shape library, for use with a Surface or Paper component.

Properties

categoryParameter?

optional categoryParameter: string

The property to use to map an object's category (ie which shape set to use). Defaults to "category".


defaultColor?

optional defaultColor: string

Optional default for text color. If not provided, text is set to #000000.


defaultFillColor?

optional defaultFillColor: string

Optional default for fill color. If not provided, fill is set to #FFFFFF.


defaultOutlineColor?

optional defaultOutlineColor: string

Optional default for outline color. If not provided, outline is set to #000000.


font?

optional font: FontSpec

Optional spec for font size/style to apply to all shapes. Shapes that have their own font spec will override this.


labelAttribute?

optional labelAttribute: string

The attribute containing each vertex's label. Defaults to 'label'


labelBackground?

optional labelBackground: boolean | LabelBackgroundOptions

Options for label background. Use true for defaults, or supply your own values (which will be merged on top of the defaults)


labelFillRatio?

optional labelFillRatio: number

How much of the width of a shape a multiline label will take up before wrapping. Defaults to 0.8. You can set this to a number greater than 1, if you like, but that will allow the label to overflow.


labelPosition?

optional labelPosition: LabelPosition

Position for labels. Defaults to "center".


library?

optional library: ShapeLibrary<ObjectData>

The shape library to use. You must provide either this or sets.


multilineLabels?

optional multilineLabels: boolean

Defaults to true - labels are split across multiple lines to fit inside their shape. Set this to false if you want labels to always be a single line.


sets?

optional sets: ShapeSet | ShapeSet[]

List of shape sets - or a single set - to support. Provide this or library. If you provide library and this, library will take precedence.


showLabels?

optional showLabels: boolean

Whether or not to show labels. Defaults to true.


strokeWidth?

optional strokeWidth: number

Stroke width to use when drawing svg shapes.


tagName?

optional tagName: string

The name of the tag to make available to node/group renderers. Defaults to vjs-shape. Only used with certain advanced usages of Vanilla VisuallyJs. If you're using an integration there's a dedicated shape component you will use instead.

Advanced


typeParameter?

optional typeParameter: string

The property to use to map an object's type. Defaults to "type".