Viewport Information in the Data-binding Context (Character Displays)


The data-binding context includes a viewport property that describes the operating characteristics of the display device.

Viewport property example

An example viewport on a character-based device such as Echo Dot with clock has the following properties:

"viewport": {
  "width": 4,
  "height": 1,
  "format": "SEVEN_SEGMENT"
}

Viewport properties

The viewport has the following defined properties:

Property Type Description
format String Types of characters that can be displayed
width Number Width of the viewport in characters
height Number Height of the viewport in characters

format

The format property is set to a value that determines the supported characters that the device is able to display.

If an unsupported character is encountered, it is displayed as space character. ' '.

The format property can return:

  • SEVEN_SEGMENT

SEVEN_SEGMENT

Indicates that device can show numbers and some letters that can be rendered reasonably well on a 7-segment display.

Supported numbers
0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Supported letters
A, b, C, c, d, E, F, G, H, h, I, J, L, n, O, o, P, q, r, S, t, U, u, y, _ (underscore), and space (' ').

These images illustrate the supported characters in 7-segment format:
Uppercase A Lowercase B Uppercase C Lowercase C Lowercase D Uppercase E Uppercase F Uppercase G Uppercase H Lowercase H Uppercase I Uppercase J Uppercase L Lowercase n Uppercase O Lowercase O Lowercase P Lowercase Q Lowercase R Uppercase S Lowercase T Uppercase U Lowercase U Lowercase Y Underscore (/_)
Unsupported letters
a, B, D, e, f, g, i, j, K, k, l, M, m, N, p, Q, R, s, T, V, v, W, w, X, x, Y, Z, and z.

Unsupported letters are treated as space (" ") characters.
  • For uppercase "B", you can use the number 8 to get the same shape.
  • For lowercase "g", you can use 9 to get the same shape.
  • For lowercase "l", use upper-case I to get the same shape.

width & height

The width and height properties are set to the current measurements of the screen in characters. The dimensions of the viewport do not count the inter-segment characters.

For example, the viewport for the Echo Dot with clock has a width of 4 and height of 1.


Was this page helpful?

Last updated: May 10, 2024