Tour API Demos Download Tests
Aperture version 1.0
Generated by: JsDoc Toolkit 2.4.0

Namespace aperture.graph

Aperture graph utility functions.

Namespace Summary
Constructor Attributes Constructor Name and Description

Method Summary

Namespace Detail


Method Detail

  • <static> aperture.graph.linkNodes(nodes, links, options)
    Takes an array of nodes and links in typical data representation form with id references and creates an enhanced view of them with direct object references. Links are enhanced with an object reference to each node, source and target, and given a unique id if they don't already have one. Nodes are enhanced with arrays linksOut and linksIn if directed or array links if undirected. The existing node and link arrays are updated in place with the enhanced node and link views, where each updated node or link has the original node or link as its prototype. Using views enables any original properties of the node or link to be extended without modification to the original objects.
    an array of nodes
    an array of links
    options Optional
    an optional set of directives
    options.nodeId Optional, Default: 'id'
    the node field representing the id
    options.linkId Optional, Default: 'id'
    the link field representing the id, or the name of one to create
    options.sourceId Optional, Default: 'sourceId'
    the link field representing the source node id
    options.targetId Optional, Default: 'targetId'
    the link field representing the target node id
    options.nodeMap Optional
    the optional node map updated with enhanced nodes and used to lookup nodes when enhancing links
    options.undirected Optional, Default: false
    if undirected, each node will be given a single list of links instead of one for linksIn and linksOut
  • <static> aperture.graph.weightNodes(nodes, weights, sum)
    Takes an array of nodes and a specification of weights to sum from link weight and set in the node objects.
    an array of nodes
    weights Optional, Default: {weight:{links: 'weight'}, weightIn:{linksIn: 'weight'}, weightOut:{linksOut: 'weight'}}
    the specification of weights to calculate
    sum Optional
    the optional name of a node field to set with the sum of all calculated weights