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
DisplayComponent
<DigitScrollerProps
>↳
DigitScroller
Constructors
constructor
• new DigitScroller(props
): DigitScroller
Parameters
Name | Type |
---|---|
props | DigitScrollerProps |
Returns
Inherit Doc
Overrides
Defined in
src/sdk/components/common/DigitScroller.tsx:93
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
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
Defined in
src/sdk/components/FSComponent.ts:67
props
• props: DigitScrollerProps
& ComponentProps
The properties of the component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:61
Methods
destroy
▸ destroy(): void
Destroys this component.
Returns
void
Overrides
Defined in
src/sdk/components/common/DigitScroller.tsx:200
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | Type | Description |
---|---|---|
context | never | The 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
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
A JSX element to be rendered.
Overrides
Defined in
src/sdk/components/common/DigitScroller.tsx:157