Skip to content
Erik edited this page Aug 31, 2013 · 2 revisions

WikiAPI ReferenceLed Array

A Led Array is an number of leds arranged in a row or column used to indicate the magnitude of some value.

# iopctrl.ledarray()

Constructs a new ledarray.

# ledarray(selection)

Apply the led to a selection or transition. The selection must contain an SVG or G element. For example:

d3.select("body").append("svg")
    .attr("width", 20)
    .attr("height", 20)
  .append("g")
    .attr("class", "ledarray")
    .call(ledarray);

# ledarray.value([value])

If value is specified, sets the led states to on or off based on the magnitude and returns the led array. If value is not specified, returns the current value.

# ledarray.width([width])

If width is specified, sets the width and returns the led array. If width is not specified, returns the current width.

# ledarray.count([count])

If count is specified, sets number of leds in the array returns the led array. If count is not specified, returns the current count.

# ledarray.padding([padding])

If padding is specified, sets the padding between the leds returns the led array. If padding is not specified, returns the current padding.

# ledarray.scale([scale])

If scale is specified, sets the led array scale and returns the led array. The scale range specifies the pixel range of the led array and thus it's size and the scale domain specifies the value range between when all leds are turned off and all leds turned on. If scale is not specified, returns the current scale.

# ledarray.thresholds([thresholds])

If thresholds is specified, sets the threshold scale that defines the color ranges of the led array. If thresholds is not specified, returns the current threshold scale.

Clone this wiki locally