KonvaShapePainter
Source: shapePainters.js:28
Base class for Konva shape entries.
Provides default no-op implementations of createExtras and updateExtras so that subclasses only override what they need.
Instance Methods
createShape(_annotation: Annotation, _style: Style): Konva.Shape
Create the main Konva shape node for an annotation. Must be overridden by subclasses.
Parameters
_annotation(Annotation) — The annotation._style(Style) — The drawing style.
Returns
Konva.Shape— The created shape.
updateShape(
_node: Konva.Node,
_annotation: Annotation,
_style: Style,
)
Update the main Konva shape node in-place. Must be overridden by subclasses.
Parameters
_node(Konva.Node) — The existing Konva node._annotation(Annotation) — The updated annotation._style(Style) — The drawing style.
createExtras(
_annotation: Annotation,
_style: Style,
): Array.<Konva.Shape>
Create auxiliary Konva nodes (ticks, arrowhead, arc, …). Default: no extras.
Parameters
_annotation(Annotation) — The annotation._style(Style) — The drawing style.
Returns
Array.<Konva.Shape>— Empty array.
updateExtras(
_group: Konva.Group,
_annotation: Annotation,
_style: Style,
)
Update auxiliary Konva nodes in-place. Default: nothing to update.
Parameters
_group(Konva.Group) — The shape group._annotation(Annotation) — The updated annotation._style(Style) — The drawing style.