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

Class aperture.layout

Aperture layout APIs. Provides access to a server-side layout service. Depending on the layout type specified in the parameters, the corresponding layout service and algorithm is chosen.

Each layout accepts a data object containing two arrays. The first contains a list of nodes, the second, a list of links between the nodes (if applicable).

{
  nodes : [],
  links : [],
  defaultNodeSize : {width: w, height: h} // optional. can also be specified per node
 };
 
{Array} nodes
An array of Node objects to be arranged by the layout service.
An example point object would be defined as follows:
{
  id: 'Node_1',
  width: 20, // The width of given node in the layout.
  height: 20 // The height of given node in the layout.
}
{Array} links
An array of of objects containing a source and target node id.
An example link object would be defined as follows:
{
  sourceId: 'Node_1',
  targetId: 'Node_2
}

Additionally, an optional 'options' object, containing any customizations of layout attributes.

Class Summary
Constructor Attributes Constructor Name and Description
 
aperture.layout(namespace)

Method Summary

Class Detail

aperture.layout(namespace)
Parameters:
namespace
Requires:
an Aperture layout service, jQuery, json2 as a JSON shim if running old browsers

Method Detail

  • <static> aperture.layout.circle(data, extents, options, callback)
    Arranges nodes around a central, circular path.
    Parameters:
    {Object} data
    The object containing the list of nodes and links.
    {Object} data.nodes
    An array of node objects, with id and optional Number properties x, y, width, height and weight (indicating its scale of importance).
    {Object} data.links
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {Number} options.linkLength Optional
    The ideal minimum length of a given link in the layout
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.htree(data, extents, options, callback)
    Arranges the nodes left to right, as a hierarchical, horizontal tree.
    Parameters:
    {Object} data
    The object containing the list of nodes and links.
    {Object} data.nodes
    An array of node objects, with id and optional Number properties x, y, width, height and weight (indicating its scale of importance).
    {Object} data.links
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {String} options.rightToLeft Optional
    If true, reverses the layout direction of the tree
    {Number} options.nodeDistance Optional
    The ideal minimum spacing between nodes
    {Number} options.treeLevelDistance Optional
    The ideal distance between levels of the tree
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.multipass(data, extents, layouts, callback)
    Executes a series of layouts, such as a node layout followed by a tag layout.
    Parameters:
    {Object} data
    The object containing the list of nodes.
    {Object} data.nodes
    An array of node objects, with id and Number properties x, y, and weight (indicating its scale of importance).
    {Object} data.links Optional
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Array} layouts
    An array of layout objects, each with at minimum a field of name type indicating the type of layout, and optionally any other fields indicating options.
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.organic(data, extents, options, callback)
    The organic layout style is based on the force-directed layout paradigm. Nodes are given mutually repulsive forces, and the connections between nodes are considered to be springs attached to the pair of nodes. The layout algorithm simulates physical forces and rearranges the positions of the nodes such that the sum of the forces emitted by the nodes and the links reaches a (local) minimum.
    Resulting layouts often expose the inherent symmetric and clustered structure of a graph, and have a well-balanced distribution of nodes with few edge crossings.
    Parameters:
    {Object} data
    The object containing the list of nodes and links.
    {Object} data.nodes
    An array of node objects, with id and optional Number properties x, y, width, height and weight (indicating its scale of importance).
    {Object} data.links
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {Number} options.nodeDistance Optional
    The ideal minimum spacing between nodes
    {Number} options.linkLength Optional
    The ideal minimum length of a given link in the layout
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.radial(data, extents, options, callback)
    Similar to the 'circle' layout, this arranges nodes around a circular path, however, nodes with high connectivity are made more visually prominent by isolating and positioning them as separate, satellite clusters around the central path.
    Parameters:
    {Object} data
    The object containing the list of nodes and links.
    {Object} data.nodes
    An array of node objects, with id and optional Number properties x, y, width, height and weight (indicating its scale of importance).
    {Object} data.links
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {Number} options.linkLength Optional
    The ideal minimum length of a given link in the layout
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.tag(data, extents, options, callback)
    Executes a deconflicted layout of node tags. Tag layout can be used to strategically label (or otherwise graphically annotate) only the most important nodes in a dense display at a readable scale without occlusion. If the nodes have not yet been laid out, an alternative to using this method is to use the multipass layout method. The alignments that the implementation may consider for the annotation may be specified by the alignments option. Alignments are: any, topAny, bottomAny, leftAny, rightAny, bottomLeft, bottomCenter, bottomRight, middleLeft, middleRight, topLeft, topCenter, or topRight.
    Parameters:
    {Object} data
    The object containing the list of nodes.
    {Object} data.nodes
    An array of node objects, with id and Number properties x, y, and weight (indicating its scale of importance).
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {Number} options.tagWidth Optional, Default: 100
    The width reserved for each annotation.
    {Number} options.tagHeight Optional, Default: 15
    The height reserved for each annotation.
    {String= 'any'} options.alignments Optional, Default: 'any'
    The alignments that the implementation may choose from.
    {String= 'default'} options.defaultAlignment Optional, Default: 'default'
    The default alignment, used only when a node's annotation will be obscured and is thus flagged with visible = false. This option is only useful when the caller uses deconfliction to find the optimal position for annotations but still wishes to always display all of them.
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.
  • <static> aperture.layout.vtree(data, extents, options, callback)
    Arranges the nodes top-down, as a hierarchical, vertical tree.
    Parameters:
    {Object} data
    The object containing the list of nodes and links.
    {Object} data.nodes
    An array of node objects, with id and optional Number properties x, y, width, height and weight (indicating its scale of importance).
    {Object} data.links
    An array of link objects, with sourceId and targetId properties.
    {Object} extents
    The {width, height} extents of the layout space
    {Object} options Optional
    Object containing any customizations of various layout attributes.
    {String} options.bottomToTop Optional
    If true, reverses the layout direction of the tree
    {Number} options.nodeDistance Optional
    The ideal minimum spacing between nodes
    {Number} options.treeLevelDistance Optional
    The ideal distance between levels of the tree
    {Function} callback
    The callback for handling the response from the layout service.
    Returns:
    Node and link data, as well as additional properties about the layout.