# 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 data. Specify a callback for either `children` or `parent_key` to describe the hierarchy, but not both. If using `children`, then you do not need to include the children in the layer's `data` array.

If you care about performance, you can pass the parameter `revalue` to `redraw('revalue')` if you are keeping the same dataset and only changing the element's values. The sunburst layer can use a more optimized alrogithm 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.

### Author:

- Douglas Armstrong

## Variables Summary

version =

      0.1

type =

      'sunburst'

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. The `value` 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 sunburst chart segments. `true` sorts based on 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 =

      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_angle_percentage =

      0.001

  [Number] Don't bother rendering arc segments whose value is smaller than this percentage of the total. (1==100%)

### 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(datum) Bound Navigate to a new root node in the hierarchy representing the `datum` element
- # (void) rebase_key(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(datum) Bound

Navigate to a new root node in the hierarchy representing the `datum` element

# (void) rebase_key(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

Quickly fuzzy find classes, mixins, methods, file:

- T Open fuzzy finder dialog

Control the navigation frame:

- L Toggle list view
- C Show class list
- I Show mixin list
- F Show file list
- M Show method list
- E Show extras list

You can focus and blur the search input:

- S Focus search input
- Esc Blur search input