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

WikiAPI ReferenceSegment Display

A Segment Display is an numeric display made up of seven led segments that turns on and off.

# iopctrl.segdisplay()

Constructs a new segment display.

# segdisplay(selection)

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

d3.select("body").append("svg")
    .attr("class", "segdisplay")
    .attr("width", 200)
    .attr("height", 100)
  .append("g")
    .attr("transform", "translate(0,30)")
    .call(segdisplay);

# segdisplay.value([value])

If value is specified, sets the value and returns the segdisplay. If value is not specified, returns the current value.

# segdisplay.digitCount([digitCount])

If digitCount is specified, sets the number of digits including a possible negative sign and returns the segdisplay. If digitCount is not specified, returns the current digitCount.

# segdisplay.decimals([decimals])

If decimals is specified, sets the number fixed decimal positions and returns the segdisplay. If decimals is not specified, returns the current decimals.

# segdisplay.negative([negative])

Reserve the first position as negative sign if negative is set to true and returns the segdisplay. If negative is not specified, returns the current value of negative.

# segdisplay.width([width])

If width is specified, sets total width of the segment display and returns the segdisplay. If width is not specified, returns the current width.

# segdisplay.gap([gap])

If gap is specified, sets gap between the digits and returns the segdisplay. If gap is not specified, returns the current gap.

Clone this wiki locally