Class: c3.Plot.Layer.Swimlane.Icicle
Defined in: | js/c3-layers.coffee |
Inherits: | c3.Plot.Layer.Swimlane |
Overview
A swimlane layer for rendering icicle charts.
In C3, both a Flamechart and an
Icicle can actually grow either up or down
depending if you set v_orient
as top
or bottom
.
A Flamechart defaults to growing up and an Icicle defaults to growing down.
In C3, a Flamechart visualizes a timeline
of instances of nested events over time, while an Icicle
visualizes an aggregated tree hierarchy of nodes. The Sunburst
is the equivalent of an Icicle rendered on a polar axis.
A key()
is required for this layer.
You should not define x
or y
, but you must define dy
.
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.
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 Icicle 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 =
-
'icicle'
- key =
-
undefined
REQUIRED [Function] Accessor function to define a unique key for each data element. This has performance implications and is required for some layers and animations.
- 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. - 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.
- 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. - limit_elements =
-
undefined
[Number] Limit the number of data elements to render based on their value. This affects the callback index 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 parents and children will be rendered When {c3.Plot.Layer.Icicle#rebase rebase()} is called or a node is clicked on it will animate the transition to a new root node, if animation is enabled.
- set_root_on_click =
-
true
[Boolean] Set the root_datum on node click. This will also zoom the Icicle to that root.
- rect_options =
-
undefined
[c3.Selection.Options] Options for the svg:rect nodes for each segment
- label_options =
-
undefined
[c3.Selection.Options] Options for the label svg:text nodes for each segment
Variable inherited from c3.Plot.Layer.Swimlane
type v_orient dy hover lane_options version _next_uid data name class static_data h v x y h_orient options handlers restyle
Instance Method Summary
- # (void) _init() Bound
- # (void) _hover_datum(x, swimlane) Bound
- # (void) _update(origin) Bound
- # (void) _draw(origin) Bound
- # (void) _style(style_new) 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
Inherited Method Summary
Methods inherited from
c3.Plot.Layer.Swimlane
#_init #_size #_update #_draw #_style #init #size #update #draw #style #zoom #pan #redraw #scale #min_x #max_x #min_y #max_y
Instance Method Details
#
(void)
_init()
Bound
#
(void)
_hover_datum(x, swimlane)
Bound
#
(void)
_update(origin)
Bound
#
(void)
_draw(origin)
Bound
#
(void)
_style(style_new)
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