Skip to main content

Class: DigitScroller

A scrolling digit display. The display supports number bases greater than or equal to 3. The display renders a one digit for each of the following values:

-(base + 2), -(base + 1), -(base), ... , -1, 0, 1, ... , base, base + 1, base + 2`

The total number of rendered digits equals (base + 2) * 2 + 1. The display will scroll between the rendered digits based on a bound value.

When styling the scroller with CSS, select the digit-scroller-digit class to style all rendered digits. Each individual digit can also be selected with the digit-scroller-digit-[index] classes, where [index] is replaced with 0, 1, 2, ..., starting with the lowest-valued digit. Select the digit-scroller-nan class to style the text rendered for NaN values. The --digit-scroller-line-height variable is used to control the vertical spacing between each digit (defaults to 1em). The --digit-scroller-line-offset-y variable is used to control the vertical offset of each digit (defaults to 0px).

Hierarchy

Constructors

constructor

new DigitScroller(props): DigitScroller

Parameters

NameType
propsDigitScrollerProps

Returns

DigitScroller

Inherit Doc

Overrides

DisplayComponent.constructor

Defined in

src/sdk/components/common/DigitScroller.tsx:93

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

DisplayComponent.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Defined in

src/sdk/components/FSComponent.ts:67


props

props: DigitScrollerProps & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61

Methods

destroy

destroy(): void

Destroys this component.

Returns

void

Overrides

DisplayComponent.destroy

Defined in

src/sdk/components/common/DigitScroller.tsx:200


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

DisplayComponent.getContext

Defined in

src/sdk/components/FSComponent.ts:106


onAfterRender

onAfterRender(): void

A callback that is called after the component is rendered.

Returns

void

Overrides

DisplayComponent.onAfterRender

Defined in

src/sdk/components/common/DigitScroller.tsx:105


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


render

render(): VNode

Renders the component.

Returns

VNode

A JSX element to be rendered.

Overrides

DisplayComponent.render

Defined in

src/sdk/components/common/DigitScroller.tsx:157