Skip to main content

Home > @jsplumbtoolkit/browser-ui > SurfaceRenderOptions > shapes

SurfaceRenderOptions.shapes property

Optional shape library that can render SVG shapes into node elements. When you provide a shape library to a surface, two things happen:

  1. The surface registers a jtk-shape tag that your templates can use. The type of each node is used to extract an appropriate SVG shape definition from the shape library. 2. The 'exportToSvg()' method becomes available. Note that as of 6.5.1 SVG export is experimental, and has a few constraints/requirements - see the Toolkit docs for a discussion.

Signature:

shapes?: {
library?: ShapeLibrary<ObjectData>;
labelAttribute?: string;
showLabels?: boolean;
strokeWidth?: number;
tagName?: string;
};