@joint/react
    Preparing search index...

    Function linkLabels

    • 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.

      Parameters

      • labels: Record<string, LinkLabel>

        The map of label id to its simplified definition.

      • OptionallabelStyle: Partial<LinkLabel>

        Shared styling merged into every label before its own values.

      Returns (Label & { id: string })[]

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