Skip to main content
Version: 4.3

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

ParameterTypeDescription
labelLinkLabelThe 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 })],
});

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub