Multiplier Chart

The rising curve of a crash-style round. The crash is a state, not an animation that ends — the frozen curve and the final figure stay on screen so a player who looked away still sees what happened.

src/components/ui/multiplier-chart.tsx

About

From the component's own source, where it was written.

A live multiplier curve — the crash-game shape.

The y-axis is logarithmic. These curves are exponential by construction, and a linear axis renders everything below 10× as a flat line against a spike, which is exactly the region the player is watching.

The cash-out marker is drawn on the curve rather than in a legend, because the question is always "where did I get out relative to where it stopped".

Colour carries the state and nothing moves: this component updates several times a second, and any transform animation would fight the next frame.

Install

npx astralyx-ui add multiplier-chart

Usage

import { MultiplierChart } from '@/components/ui/multiplier-chart'

<MultiplierChart values={values} current={current} crashed={crashed} cashedOutAt={cashout} />

Composer

Change the props and the source below follows.

Multiplier curve, running at 8.40×8.40×
RunningCashed out at 4.20×log scale
Props
tsx
<MultiplierChart values={values} current={current} cashedOutAt={4.2} />

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

MultiplierChart

A live multiplier curve — the crash-game shape.

Extends Omit<ComponentProps<'figure'>, 'height'>.

PropTypeDefaultDescription
valuesnumber[]requiredSamples over the round, starting at 1. The caller drives the tick; the component never runs a timer of its own.
currentnumber—The live figure, shown large. Falls back to the last sample.
crashedbooleanfalseFreezes the curve and switches to the crash colour. It is a state you stay in, not a flash.
cashedOutAtnumber—Marks where the player got out, so the outcome is legible against the crash point.
heightnumber160—
maxnumber——
labelReactNode——
crashedLabelReactNode'Crashed'—
runningLabelReactNode'Running'—
logScaleLabelReactNode'log scale'Note shown once the curve switches to a logarithmic axis.
scaleauto, non-shrinking—The vertical range grows with the curve but never shrinks mid-round; a rescaling axis makes a rising line look flat.