Converts a keyed map of LinkLabel definitions into the array of JointJS labels a link expects, running each through linkLabel. The map key becomes the label's stable id, so you can address a label later without relying on array order.
id
The map of label id to its simplified definition.
Optional
Shared styling merged into every label before its own values.
The labels array — each entry is a JointJS label whose id is its map key.
import { LinkModel, linkLabels } from '@joint/react';const link = new LinkModel({ source: { id: 'a' }, target: { id: 'b' }, labels: linkLabels( { name: { text: 'orders' }, card: { text: '1..*', position: 0.9 } }, { fontSize: 12 } // applied to every label ),}); Copy
import { LinkModel, linkLabels } from '@joint/react';const link = new LinkModel({ source: { id: 'a' }, target: { id: 'b' }, labels: linkLabels( { name: { text: 'orders' }, card: { text: '1..*', position: 0.9 } }, { fontSize: 12 } // applied to every label ),});
Converts a keyed map of LinkLabel definitions into the array of JointJS labels a link expects, running each through linkLabel. The map key becomes the label's stable
id, so you can address a label later without relying on array order.