LED display Examples and Reference


Default LED display

An example of a default LED display without any extra properties.

library(dash)
library(dashDaq)
library(dashHtmlComponents)
library(dashCoreComponents)

app <- Dash$new()

app$layout(htmlDiv(list(
  daqLEDDisplay(id = 'my-LED-display',
           label = 'Default',
           value = 6),
  dccSlider(
    id = 'my-LED-display-slider',
    min = 0,
    max = 10,
    step = 1,
    value = 5
  )
)))

app$callback(
  output(id = "my-LED-display", property = "value"),
  params = list(input(id = "my-LED-display-slider", property = "value")),

  update_output <- function(value) {
    return((value))
  }
)

app$run_server()

Label

Set the label and label position with label and labelPosition.

library(dashDaq)

daqLEDDisplay(
    label = "Label",
    labelPosition = "bottom",
    value = "12:34"
)

Size

Adjust the size of the LED display with size.

library(dashDaq)

daqLEDDisplay(
    label = "Large",
    value = "9:34",
    size = 64
)

Color

Adjust the color of the LED display with color=#&lt;hex_color&gt;.

import dash_daq as daq

daq.LEDDisplay(
    label="color",
    value='1.001',
    color="#FF5E5E"
)

Background Color

Adjust the background color of the LED display using:
backgroundColor=#&lt;hex_color&gt;

library(dashDaq)

daqLEDDisplay(
    label = "color",
    value = "1.001",
    backgroundColor = "#FF5E5E"
)

LEDDisplay Properties

Our recommended IDE for writing Dash apps is Dash Enterprise’s
Data Science Workspaces,
which has typeahead support for Dash Component Properties.
Find out if your company is using
Dash Enterprise
.

id (character; optional):
The ID used to identify the display in Dash callbacks.

value (numeric | character; optional):
Value to be displayed. A number or a string containing only digits
(0-9), periods, and colons, and possibly starting with a minus sign.

color (character; default colors.PRIMARY):
Color of the display.

backgroundColor (character; default '#fff'):
Color of the display’s background.

size (numeric; default 42):
Size of the display.

theme (named list; default light):
Theme configuration to be set by a ThemeProvider.

label (named list; optional):
Description to be displayed alongside the control. To control styling,
pass an object with label and style properties.

label is a character | named list with keys:

  • label (character; optional)

  • style (named list; optional)

labelPosition (a value equal to: ‘top’ or ‘bottom’; default 'top'):
Where the display label is positioned.

className (character; optional):
Class to apply to the root component element.

style (named list; optional):
Style to apply to the root component element.