Constructor
new LabelFactory(positionGetter)
Name | Type | Description |
---|---|---|
positionGetter | function | Default position getter. |
- Source
Classes
Methods
create(annotation, style) → {Konva.Label}
Creates the konva label.
Name | Type | Description |
---|---|---|
annotation | Annotation | The associated annotation. |
style | Style | The drawing style. |
- Source
The Konva label.
- Type:
- Konva.
Label
getClosestPoints(points1, points2) → {Array.<Point2D>}
Get the two closest points of two points lists.
Name | Type | Description |
---|---|---|
points1 | Array.<Point2D> | The first point list. |
points2 | Array.<Point2D> | The second point list. |
The closests points.
- Type:
- Array.<Point2D>
getConnector(connectorsPos, label, style) → {Konva.Line}
Get the connector between this label and its shape.
Name | Type | Description |
---|---|---|
connectorsPos | Array.<Point2D> | The shape connectors positions. |
label | Konva. | The label. |
style | Style | The drawing style. |
The connector.
- Type:
- Konva.
Line
getLabelAnchorsPosition(label) → {Array.<Point2D>}
Get the anchors positions for the label.
Name | Type | Description |
---|---|---|
label | Konva. | The label. |
The connectors positions.
- Type:
- Array.<Point2D>
getPosition(annotation) → {Point2D}
Get the annotation label position.
Name | Type | Description |
---|---|---|
annotation | Annotation | The annotation. |
- Source
The position.
- Type:
- Point2D
updateConnector(group, connectorsPos)
Update the connector between a label and its shape.
Name | Type | Description |
---|---|---|
group | Konva. | The associated shape group. |
connectorsPos | Array.<Point2D> | The shape connectors positions. |
updateContent(annotation, group)
Update the shape label.
Name | Type | Description |
---|---|---|
annotation | Annotation | The associated annotation. |
group | Konva. | The shape group. |
updatePosition(annotation, group)
Update the shape label position.
Name | Type | Description |
---|---|---|
annotation | Annotation | The associated annotation. |
group | Konva. | The shape group. |
- Source