Graphity for TypeScript 3.0.0
    Preparing search index...

    Type Alias AttributeHook

    AttributeHook: (id: number, attributes: Map<string, string>) => void

    A hook that puts the attributes of one node or edge, by node ID or edge index, for DotWriter.nodeAttributes and DotWriter.edgeAttributes (Java: a functional interface with the method accept).

    The attributes, such as color or shape, are those of DOT (the language of Graphviz). The writer passes a map from attribute name to value. It holds the label from DotWriter.nodeLabel or DotWriter.edgeLabel as the attribute label, if there is one, and nothing else; the hook can add attributes, and replace or remove the label. The writer writes the attributes in the order they were put and escapes their values; a name that is not an identifier or is a DOT keyword makes DotWriter.write throw an Error. The writer reuses the map for every node and edge, so the hook must not keep it.

    Puts the attributes of the node or edge id into attributes.

    Type Declaration

      • (id: number, attributes: Map<string, string>): void
      • Parameters

        • id: number

          node ID or edge index

        • attributes: Map<string, string>

          the attributes to write, by name

        Returns void