Class ShapeLibraryComponent

Provides a means to render an SVG shape into a component.

Implements

  • AfterViewInit
  • OnChanges

Methods

  • 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

  • A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

    Parameters

    • changes: SimpleChanges

      The changed properties.

    Returns void

Properties

height: number

Current height. See notes for width.

label?: string

Optional label to use. It is better to use this than to rely on the component extracting the label from the object data, as there are some scenarios where the change detection is not invoked when relying on the labelProperty approach.

labelProperty?: string

Defaults to label. The name of the property inside each vertex that contains its label.

labelStrokeWidth?: string

The stroke width to use for labels. Optional. Defaults to the Toolkit's default.

obj: ObjectData

The data for the vertex to render. Required.

shapeLibraryId?: string = DEFAULT_SHAPE_LIBRARY_ID

The ID of the shape library to use. If not specified, a default will be used, which suffices for applications that are only using one shape library.

showLabels: boolean

Whether or not to show labels.

width: number

Current width for the shape. Although it may seem counterintuitive, this is required - you'll need to set it to [width]="obj.width". Angular's change detection will not pick up changes to this otherwise.

Version :