@joint/react
    Preparing search index...

    Function linkAttributes

    • Expands the declarative React link shorthand (style, labelMap) into the native attributes JointJS understands, so you can describe a link with the friendly preset fields instead of raw attrs and labels.

      • style → SVG attrs via linkStyle.
      • labelMap → a native labels array via linkLabels.
      • labels (array) → passed through unchanged.

      Parameters

      • link: LinkAttributes

        The link record to convert.

      Returns Attributes

      JointJS-compatible cell attributes.

      When link is not an object, or when both labelMap and labels are set on the same link.

      Expand the declarative preset input into native attributes and hand them to a cell model:

      import { LinkModel, linkAttributes } from '@joint/react';

      const link = new LinkModel(
      linkAttributes({
      source: { id: 'a' },
      target: { id: 'b' },
      style: { color: '#333', width: 2 }, // preset shorthand
      labelMap: { mid: { text: 'edge', position: 0.5 } },
      })
      );