Class: NetworkSubscriber

NetworkSubscriber

new NetworkSubscriber(options)

Subscribe to events within a Node's network.

Where a "network" is the entire graph, or a subgraph constructed from traversal options.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
node Node

the root node.

nodeEvents Object.<EventName, NodeEventSubscriberCb>

callbacks for Node emitted events.

edgeEvents Object.<EventName, EdgeEventSubscriberCb>

callbacks for Edge emitted events.

onlyNodeTypes Array.<NodeType> <optional>

only include Nodes of this type in the network.

onlyEdgeTypes Array.<EdgeType> <optional>

only include Edges of this type in the network.

excludeNodeTypes Array.<NodeType> <optional>

exclude Nodes of this type from the network.

excludeEdgeTypes Array.<EdgeType> <optional>

exclude Edges of this type from the network.

maxDepth Number <optional>
Infinity

nodes in the network should not be further than this distance from the root node.