MAIDR JavaScript API
    Preparing search index...
    • Normalizes one end of a link to the node's name.

      d3.forceLink mutates the links it is given: before the simulation runs link.source is whatever the author wrote (usually an id), and afterwards it is the node object that id resolved to. A binder called after the layout — which is the only time the lines exist to select — therefore sees objects, and reading them as names is the difference between "Ada — Grace" and "[object Object] — [object Object]".

      Parameters

      • raw: unknown

        The value the accessor produced for this end

      • endpoint: "node" | "source" | "target"

        Which end, for the error message -- or 'node' for a node element's own datum, which a directed graph names the same way

      • index: number

        Position of the link (or node) in the selection

      Returns string | number

      The node's name

      Error when an object end carries none of NODE_NAME_KEYS