Converts a simplified LinkLabel (text, color, position, …) into the dia.Link.Label JSON JointJS expects in a link's labels array.
dia.Link.Label
labels
The simplified link label to convert.
A JointJS label entry ready to drop into link.labels.
link.labels
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 })],}); Copy
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 })],});
Converts a simplified LinkLabel (text, color, position, …) into the
dia.Link.LabelJSON JointJS expects in a link'slabelsarray.