Class: c3.Layout.Tree

Defined in: js/c3.coffee

Overview

A tree layout to parition elements hierarchically.

Instance Method Summary

Constructor Details

# (void) constructor(options)

@param options must contain: key - accessor to get a key from a data element Either parent_key, children_keys, or childrento define the tree Eithervalueorself_value` for partitioning the nodes.

Instance Method Details

# (Object) construct(data) Bound

Construct the tree hierarchy. A node is an object with the following properties: datum, children, x1, x2, y1, y2, px1, px2, py1, py2

Parameters:

  • data ( Array ) Array of data elements

Returns:

  • ( Object ) — Return an object mapping element keys to nodes

# (?) revalue() Bound

Compute the "total value" of each node

Returns:

  • ( ? ) — a callback to get the total value of a data element.

# (Array) layout(sort = false, limit_min_percent = 0, root_datum = null) Bound

Layout the nodes x and y values

  • true - Sort based on the total value of the child node.
  • false - Don't sort
  • Callback function - Function that takes a data element and returns the value to sort by. @param root_datum Only layout elements that are parents or children of this element.

Parameters:

  • sort ( Boolean, Function ) Specify if child nodes should be sorted in the layout
  • limit_min_percent ( Number ) Minimum percentage of the root_domain to actually layout an element and its children.

Returns:

  • ( Array ) — Return an array of data elements that were actually laid out given the limit_min_percent and root_datum filters.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: