SwimlaneTransform
The SwimlaneTransform
element tool allows you to resize lanes in bpmn2.Pool or bpmn2.HeaderedPool shape,
from the UI. It renders 4 handles around selected lane which you drag and use to resize lane in particular direction.
See usage of the SwimlaneTransform
element tool in the learn section.
constructorβ
constructor(opt: SwimlaneTransform.Options);
The elementTools.SwimlaneTransform
constructor accepts an Options
object that encapsulates multiple parameters:
widthβ
[optional] The width of the scrollbar thumb. The default value is 8.
laneIdβ
Specifies the lane group for which the tool should be rendered.
paddingβ
Specifies how much the boundary area of handles should be visually inflated. Default is 10
({left: 10, top: 10, right: 10, bottom: 10}
).
minSizeβ
Specifies the minimal height of the lane after which the tool will not allow it to shrink further. Default is 30
.
constraintsPaddingβ
Specifies the padding around constraint points. Default is 10
.
minSizeConstraintsβ
Callback function that is expected to return an array of minimal constraint points (in the form: {x: number, y: number}
), relative to the paper.
Minimal constraint points are points that should always be kept inside selected lane when resizing. If this option is left undefined, the
default minSizeConstraints
function is used instead which creates those points automatically from embedded shapes. Callback is called each time a
handle starts to be dragged, the arguments passed are:
model | dia.Element | Pool shape that the tool was added to. |
laneId | string | Id of the lane that the tool was initialized with. |
handleSide | "left" | "top" | "right" | "bottom" | Position of the dragged handle (relative to the lane). |
maxSizeConstraintsβ
Callback function that is expected to return an array of maximum constraint points (in the form: {x: number, y: number}
), relative to the paper.
Maximum constraint points are points that should always be kept outside selected lane when resizing. If this option is left undefined, the
default maxSizeConstraints
function is used instead which creates those points automatically from embedded shapes. Callback is called each time a
handle starts to be dragged, the arguments passed are:
model | dia.Element | Pool shape that the tool was added to. |
laneId | string | Id of the lane that the tool was initialized with. |
handleSide | "left" | "top" | "right" | "bottom" | Position of the dragged handle (relative to the lane). |
stopPropagationβ
Should be events stopped from propagating to the paper? Default is true
.
Typesβ
Optionsβ
interface Options extends dia.ToolView.Options {
laneId: string;
minSize?: number;
handleClass?: any;
padding?: dia.Sides;
stopPropagation?: boolean;
constraintsPadding?: number;
minSizeConstraints?: (model: Pool, laneId: string, handleSide: dia.OrthogonalDirection) => Array<dia.Point>;
maxSizeConstraints?: (model: Pool, laneId: string, handleSide: dia.OrthogonalDirection) => Array<dia.Point>;
}