Class Index | File Index

Classes


Class pv.Layout.Partition


Extends pv.Layout.Hierarchy.
Implemeents a hierarchical layout using the partition (or sunburst, icicle) algorithm. This layout provides both node-link and space-filling implementations of partition diagrams. In many ways it is similar to pv.Layout.Cluster, except that leaf nodes are positioned based on their distance from the root.

The partition layout support dynamic sizing for leaf nodes, if a #size psuedo-property is specified. The default size function returns 1, causing all leaf nodes to be sized equally, and all internal nodes to be sized by the number of leaf nodes they have as descendants.

The size function can be used in conjunction with the order property, which allows the nodes to the sorted by the computed size. Note: for sorting based on other data attributes, simply use the default null for the order property, and sort the nodes beforehand using the pv.Dom operator.

For more details on how to use this layout, see pv.Layout.Hierarchy.
Defined in: Partition.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructs a new, empty partition layout.
Field Summary
Field Attributes Field Name and Description
 
Default properties for partition layouts.
 
The inner radius; defaults to 0.
 
The sibling node order.
 
The orientation.
 
The outer radius; defaults to fill the containing panel, based on the height and width of the layout.
Fields borrowed from class pv.Layout.Network:
label, link, node
Fields borrowed from class pv.Panel:
canvas, children, 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
 
size(f)
Specifies the sizing function.
Methods borrowed from class pv.Layout.Network:
reset
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.Partition()
Constructs a new, empty partition layout. Layouts are not typically constructed directly; instead, they are added to an existing panel via pv.Mark#add.
See:
pv.Layout.Partition.Fill
Field Detail
{pv.Layout.Partition} defaults
Default properties for partition layouts. The default orientation is "top".

{number} innerRadius
The inner radius; defaults to 0. This property applies only to radial orientations, and can be used to compress the layout radially. Note that for the node-link implementation, the root node is always at the center, regardless of the value of this property; this property only affects internal and leaf nodes. For the space-filling implementation, a non-zero value of this property will result in the root node represented as a ring rather than a circle.

{string} order
The sibling node order. The default order is null, which means to use the sibling order specified by the nodes property as-is. A value of "ascending" will sort siblings in ascending order of size, while "descending" will do the reverse. For sorting based on data attributes other than size, use the default null for the order property, and sort the nodes beforehand using the pv.Dom operator.
See:
pv.Dom.Node#sort

{string} orient
The orientation. The default orientation is "top", which means that the root node is placed on the top edge, leaf nodes appear at the bottom, and internal nodes are in-between. The following orientations are supported:

{number} outerRadius
The outer radius; defaults to fill the containing panel, based on the height and width of the layout. If the layout has no height and width specified, it will extend to fill the enclosing panel.
Method Detail
{pv.Layout.Partition} size(f)
Specifies the sizing function. By default, a sizing function is disabled and all nodes are given constant size. The sizing function is invoked for each leaf node in the tree (passed to the constructor).

For example, if the tree data structure represents a file system, with files as leaf nodes, and each file has a bytes attribute, you can specify a size function as:

    .size(function(d) d.bytes)
As with other properties, a size function may specify additional arguments to access the data associated with the layout and any enclosing panels.
Parameters:
{function} f
the new sizing function.
Returns:
{pv.Layout.Partition} this.

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