Class: c3.Polar.Layer.Sunburst
Defined in: | js/c3-polar.coffee |
Inherits: | c3.Polar.Layer.Segment |
Overview
A polar layer that is similar to a pie chart except that you can visualize hierarchical tree data. It is like a polar version of the Icicle Plot layer.
A key()
callback is required for this layer.
Specify a callback for either parent_key
,
children
, or children_keys
to describe the hierarchy.
If using parent_key
or children_keys
the data
array shoud include all nodes,
if using children
it only should include the root nodes.
Define either value()
or self_value()
to value the nodes in the hierarchy.
For proper animation, or if you care about performance, you can pass the
parameter revalue
to redraw('revalue')
if you are keeping the same dataset
hierarchy, and only changing the element's values.
The Sunburst layer can use a more optimized algorithm in this situation.
Events
- rebase Called with the datum of a node when it becomes the new root or with
null
if reverting to the top of the hierarchy.
Variables Summary
- version =
-
0.1
- type =
-
'sunburst'
- value =
-
undefined
[Function] Accessor to get the "total" value of the data element. That is the total value of the element itself inclusive of all of it's children's value. You can define either value or _self_value_.
- self_value =
-
undefined
[Function] The
value
accessor defines the "total" value for an element, that is the value of the element itself plus that of all of its children. If you know the "self" value of an element without the value of its children, then define this callback accessor instead. Thevalue
option will then also be defined for you, which you can use to get the total value of an element after the layer has been drawn. - sort =
-
false
[Boolean, Function] How to sort the partitioned tree segments.
true
sorts based on total value, or you can define an alternative accessor function to be used for sorting. - parent_key =
-
undefined
[Function] A callback that should return the key of the parent of an element. It is called with a data element as the first parameter.
- children_keys =
-
undefined
[Function] A callback that should return an array of child keys of an element. The returned array may be empty or null. It is called with a data element as the first parameter.
- children =
-
undefined
[Function] A callback that should return an array of children elements of an element. The returned array may be empty or null. It is called with a data element as the first parameter.
- limit_min_percent =
-
0.001
[Number] Don't bother rendering segments whose value is smaller than this percentage of the current domain focus. (1==100%)
- root_datum =
-
null
Data element that represents the root of the hierarchy to render. If this is specified then only this root and its subtree will be rendered When rebase() is called or a node is clicked on it will animate the transition to a new root node, if animation is enabled.
Variable inherited from c3.Polar.Layer.Segment
version type key value limit_elements pad arc_options _next_uid data name class r t options handlers restyle
Instance Method Summary
- # (void) _init() Bound
- # (void) _layout(data, origin) Bound
-
#
(void)
rebase(root_datum)
Bound
Navigate to a new root node in the hierarchy representing the
datum
element -
#
(void)
rebase_key(root_key)
Bound
Navigate to a new root node in the hierarchy represented by
key
- # (void) _update(origin) Bound
- # (void) _draw(origin) Bound
- # (void) _style(style_new) Bound
- # (void) get_leaf(position) Bound
Inherited Method Summary
Methods inherited from
c3.Polar.Layer.Segment
#_init #_update #_draw #_style #get_position_from_key #init #size #_size #update #draw #style #redraw #toPolar
Instance Method Details
#
(void)
_init()
Bound
#
(void)
_layout(data, origin)
Bound
#
(void)
rebase(root_datum)
Bound
Navigate to a new root node in the hierarchy representing the datum
element
#
(void)
rebase_key(root_key)
Bound
Navigate to a new root node in the hierarchy represented by key
#
(void)
_update(origin)
Bound
#
(void)
_draw(origin)
Bound
#
(void)
_style(style_new)
Bound
#
(void)
get_leaf(position)
Bound