linkLabel()
function linkLabel(label): Label;
Converts a simplified LinkLabel (text, color, position, …) into the
dia.Link.Label JSON JointJS expects in a link's labels array.
Parameters
| Parameter | Type | Description |
|---|---|---|
label | LinkLabel | The simplified link label to convert. |
Returns
Label
A JointJS label entry ready to drop into link.labels.
Example
import { LinkModel, linkLabel } from '@joint/react';
const link = new LinkModel({
source: { id: 'a' },
target: { id: 'b' },
labels: [linkLabel({ text: 'flows to', color: '#333', position: 0.5 })],
});