featherbit UI
    Preparing search index...

    Function policyToNodes

    • Converts a gateway Policy into ReactFlow nodes.

      Saved position values on policy nodes win; nodes without one get an auto-layout position: starting from the listener node, each success-port successor is placed one column (250px) to the right on the same row, while an error-port successor drops 1.5 rows (225px) below. Nodes unreachable from the listener are appended in subsequent columns at y=300.

      Parameters

      • policy: Policy

        Policy whose nodes/edges describe the graph.

      • onSelect: (id: string) => void

        Callback wired into each node's data so clicking a rendered PluginNode selects it in the canvas.

      • portSpecs: PortSpecLookup

        Catalog-derived lookup threaded into each node's PluginNodeData.ports so PluginNode can render the declared handles; a type missing from the lookup leaves ports undefined and PluginNode synthesizes the default success+error pair.

      • showPortNames: boolean

        Current value of the persisted port-names preference, threaded into every node's PluginNodeData.showPortNames.

      • supernodes: Supernode[] = []

        Resolved supernode definitions, used to derive a supernode instance's actual ports via supernodePortSpec rather than the (non-existent) catalog entry for the supernode type.

      Returns Node[]

      ReactFlow nodes of type pluginNode carrying PluginNodeData.