Class Index | File Index

Classes


Class pv.Layout.Network


Extends pv.Layout.
Represents an abstract layout for network diagrams. This class provides the basic structure for both node-link diagrams (such as force-directed graph layout) and space-filling network diagrams (such as sunbursts and treemaps). Note that "network" here is a general term that includes hierarchical structures; a tree is represented using links from child to parent.

Network layouts require the graph data structure to be defined using two properties:

Three standard mark prototypes are provided:

Note that some network implementations may not support all three standard mark prototypes; for example, space-filling hierarchical layouts typically do not use a link prototype, as the parent-child links are implied by the structure of the space-filling node marks. Check the specific network layout for implementation details.

Network layout properties, including nodes and links, are typically cached rather than re-evaluated with every call to render. This is a performance optimization, as network layout algorithms can be expensive. If the network structure changes, call #reset to clear the cache before rendering. Note that although the network layout properties are cached, child mark properties, such as the marks used to render the nodes and links, are not. Therefore, non-structural changes to the network layout, such as changing the color of a mark on mouseover, do not need to reset the layout.
Defined in: Network.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructs a new, empty network layout.
Field Summary
Field Attributes Field Name and Description
 
The node label prototype, which renders the node name adjacent to the node.
 
The link prototype, which renders edges between source nodes and target nodes.
 
The node prototype.
Fields borrowed from class pv.Panel:
canvas, children, defaults, overflow, transform
Fields borrowed from class pv.Bar:
fillStyle, height, lineWidth, strokeStyle, width
Fields borrowed from class pv.Mark:
bottom, childIndex, cursor, data, events, index, left, parent, proto, reverse, right, root, scale, title, top, type, visible
Method Summary
Method Attributes Method Name and Description
 
Resets the cache, such that changes to layout property definitions will be visible on subsequent render.
Methods borrowed from class pv.Panel:
add, anchor
Methods borrowed from class pv.Mark:
anchorTarget, def, event, extend, margin, mouse, render
Class Detail
pv.Layout.Network()
Constructs a new, empty network layout. Layouts are not typically constructed directly; instead, they are added to an existing panel via pv.Mark#add.
See:
pv.Layout.Hierarchy
pv.Layout.Force
pv.Layout.Matrix
pv.Layout.Arc
pv.Layout.Rollup
Field Detail
{pv.Mark} label
The node label prototype, which renders the node name adjacent to the node. This prototype is provided as an alternative to using the anchor on the node mark; it is primarily intended to be used with radial node-link layouts, since it provides a convenient mechanism to set the text angle.

{pv.Mark} link
The link prototype, which renders edges between source nodes and target nodes. This prototype is intended to be used with a Line mark in conjunction with the node prototype.

{pv.Mark} node
The node prototype. This prototype is intended to be used with a Dot mark in conjunction with the link prototype.
Method Detail
{pv.Layout.Network} reset()
Resets the cache, such that changes to layout property definitions will be visible on subsequent render. Unlike normal marks (and normal layouts), properties associated with network layouts are not automatically re-evaluated on render; the properties are cached, and any expensive layout algorithms are only run after the layout is explicitly reset.
Returns:
{pv.Layout.Network} this.

Documentation generated by JsDoc Toolkit 2.3.2 on Sun May 30 2010 18:10:24 GMT-0700 (PDT)