Skip to content
Kevin Warne edited this page May 2, 2016 · 1 revision

# d2b.svg.checkbox()

Constructs a new checkbox generator.

# checkbox(selection)

Apply the checkbox to a selection or transition. The selection must contain an svg or g element. For example:

d3.select('body').append('svg')
    .attr('class', 'checkbox')
    .call(checkbox);

# checkbox.size([size])

If size is specified, sets the size-accessor to the specified function or value in pixels. If size is not specified, returns the current size-accessor. The checkboxes are sized by a pixel text size.

# checkbox.label([label])

If label is specified, sets the label-accessor to the specified function or string. If label is not specified, returns the current label-accessor.

# legend.on([type[, listener]])

Registers the specified listener to receive events of the specified type from the legend behavior. (see d3's dispatch for additional details.) The following events are supported:

  • change - when a checkbox is 'clicked' and therefore encounters a state change

Clone this wiki locally