005 / RECHARTS / LINE
Step Signal
Stepped visualization for discrete changes that remain in effect until the next observation, communicating quotas, pricing plans, and configuration states.
- SPEC
- #005
- ENGINE
- Recharts
- FAMILY
- Line
- RENDERER
- svg
- STATUS
- preview
Installation
Checking public registry…
View local registry JSONCopied as source into your project (requires recharts).
Overview
Step Signal is a dedicated visualization for discrete changes that remain in effect until the next observation. It visualizes horizontal level segments with crisp 90° transitions, ensuring that time elapsed between recorded points communicates state persistence rather than gradual numerical movement.
A continuous trend line implies that values smoothly slope between two measurements (e.g. 100 → 101 → ... → 140). In contrast, Step Signal communicates:
Discrete Level Persistence & Boundary Transitions
Levels remain active and constant across time intervals. No artificial drift.
Clean 90° boundary at the milestone. Zero time spent at intermediate states.
Engineered specifically for quotas, rate plans, and discrete system states.
The level remains active and constant until the boundary event occurs. That semantic distinction is the core reason Step Signal exists.
import { StepSignal } from "@/components/charts/recharts/line-step-signal"export function ApiRateLimitCard() { return ( <StepSignal data={quotaData} xKey="period" seriesKey="limit" label="API Request Limit" stepMode="after" showGrid /> )}The Step Model
Standard Cartesian line charts interpolate continuous trajectories between coordinates and . While appropriate for continuous measurements like temperature or sensor voltage, this interpolation is factually false for configured policies, pricing schedules, and discrete states.
In Step Signal, the coordinate space represents two distinct mathematical concepts:
- Horizontal Segments: Indicate duration. A horizontal line spanning from January to April at height $10,000$ signifies that the active policy or quota remained exactly $10,000$ throughout that entire interval.
- Vertical Segments: Indicate transitions. A vertical segment at April 15 marks the moment a transition took effect. No intermediate states exist; the system does not spend time at $12,500$ halfway through the transition.
Interval Persistence vs Instantaneous Step Shift
Transition Semantics
Step Signal provides a semantic stepMode property ("after", "before", or "center") that defines exactly when an observation's value takes effect along the timeline:
After (stepMode="after", Default)
The value recorded at observation takes effect at that coordinate and remains in effect onward until the subsequent observation.
- Mental Model: "Starting on April 15th, our new limit is 15,000."
- Visual Path: Horizontal from to at level , then a vertical step to at coordinate .
Before (stepMode="before")
The value recorded at observation takes effect immediately prior to that coordinate.
- Mental Model: "The target level is achieved by the milestone date."
- Visual Path: Vertical step from to at coordinate , followed by a horizontal segment to at level .
Center (stepMode="center")
The transition between levels occurs halfway between adjacent observation points.
- Mental Model: Transition occurs at the interval midpoint.
- Visual Path: Horizontal to , vertical step to , and horizontal continuation to .
Best Suited For
Step Signal is engineered specifically for discrete numeric states:
- API Rate Limits & Quotas: Request thresholds and concurrency limits that stay constant across billing windows.
- Subscription Pricing Plans: Tier prices that remain fixed over contract terms before jumping to updated rates.
- Infrastructure Capacity Allocation: Provisioned server instances, container replicas, or worker pool counts.
- Feature Rollout Schedules: Deployment percentage gates () across verification phases.
- Staffing & Budget Ceilings: Approved headcount limits or department budget caps by fiscal quarter.
When to Avoid
- Continuously Measured Metrics: Use
SignalLineorPulseLinefor temperatures, revenue velocity, or network latency. - Multi-Series Comparisons: Use
TwinlineComparewhen benchmarking two competing time-series with continuous curves. - Interval & Confidence Envelopes: Use
RangeLinewhen displaying uncertainty bands or tolerance ranges. - Non-Numeric Categorical States: Avoid forcing text states (
"offline","degraded","healthy") onto a quantitative axis; use a state timeline component instead.
Installation
Install Step Signal directly into your project using the shadcn CLI. The component source and its minimal dependencies (recharts and shared Plotcn primitives) will be copied directly into your codebase under full ownership.
Checking public registry…
View local registry JSONCopied as source into your project (requires recharts).
Data Contract
Step Signal accepts a readonly array of observations. Each record must contain a horizontal domain key and an active numeric level property.
export interface StepSignalDatum { date: string // Horizontal domain coordinate (e.g. "Jan 01", "2026-Q1") limit: number // Active numeric state level in effect}State Persistence & Missing Value Policy
Handling missing data in discrete state charts requires deliberate domain decisions:
- Gap Policy (
missingValuePolicy="gap", Default): If an observation's value isnullorundefined, Step Signal treats the state as unknown. The stepped line breaks cleanly across the interval, honestly communicating that state was unrecorded. - Carry Policy (
missingValuePolicy="carry"): For configuration timelines where unrecorded periods inherit the prior valid level, settingmissingValuePolicy="carry"propagates the last known finite level forward without creating artificial transitions. - No Coercion to Zero: Unrecorded points are never coerced to 0. A missing limit does not imply a limit of zero.
- Out-of-Order Input Protection: Caller data is never mutated; observations are processed in caller-provided order.
Component Props
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
data | readonly TData[] | [] | Required | Readonly array of observation records. Caller data is never mutated. |
xKey | keyof TData & string | — | Required | Property name for the horizontal X-axis domain coordinates. |
seriesKey | keyof TData & string | "limit" | Optional | Property name for the active numeric state level. |
stepMode | "after" | "before" | "center" | "after" | Optional | Transition mode: "after" steps at point, "before" steps prior, "center" steps halfway. |
missingValuePolicy | "gap" | "carry" | "gap" | Optional | How missing observations are handled: "gap" breaks the path, "carry" persists the previous valid state. |
height | number | string | 340 | Optional | Container height in pixels or standard CSS dimension strings. |
color | string | "var(--chart-1, #10b981)" | Optional | Primary theme stroke color for the stepped line. |
showGrid | boolean | true | Optional | Whether to render subtle horizontal background reference gridlines. |
showLegend | boolean | false | Optional | Whether to render a chart legend. |
showXAxis | boolean | true | Optional | Whether to render the horizontal category axis with tick thinning. |
showYAxis | boolean | true | Optional | Whether to render the vertical numeric scale. |
showTransitionDelta | boolean | false | Optional | Whether to compute and display previous state and quantitative change in the tooltip. |
referenceLines | StepReferenceLine[] | [] | Optional | Static horizontal reference lines representing quotas or SLA ceilings. |
motion | boolean | { duration?: number } | true | Optional | Enables smooth entrance reveal while strictly maintaining 90° step geometry. |
Props Reference & Interactive Prop Explorer
Inspect every component property, customize semantic color roles live with instant visual feedback, and copy production-ready code with active prop configurations.
Colors & Appearance Configuration
Customize primary, reference, or annotation series colors. Defaults derive from Plotcn theme tokens.
<StepSignal
data={data}
xKey="date"
seriesKey="limit"
/>Semantic transition mode: 'after' takes effect at X and remains active onward; 'before' jumps immediately prior; 'center' transitions halfway.
stepMode="after"Default: "after"Handling of null/undefined values: 'gap' breaks the line truthfully; 'carry' propagates the last known valid state.
missingValuePolicy="gap"Default: "gap"Container height in pixels or standard CSS dimension strings.
height={340}Default: 340Primary theme stroke color for the stepped signal line.
color="#10b981"Default: "var(--chart-1, #10b981)"Whether to render subtle horizontal background reference gridlines.
showGrid={true}Default: trueWhether to compute and display the prior state level and quantitative change in the tooltip on transitions.
showTransitionDelta={false}Default: false| Property | Type | Default | Required | Description |
|---|---|---|---|---|
dataReq | readonly TData[] | [] | Yes | Readonly array of structured observation records. Caller data is never mutated. Best for: Primary dataset |
xKeyReq | keyof TData & string | — | Yes | Property name for the horizontal X-axis domain (e.g. date, month, or sprint). Best for: Domain coordinates |
seriesKeyOpt | keyof TData & string | "limit" | No | Property name for the numeric state value plotted with stepped geometry. Best for: Primary state level |
stepModeOpt | "after" | "before" | "center" | "after" | No | Semantic transition mode: 'after' takes effect at X and remains active onward; 'before' jumps immediately prior; 'center' transitions halfway. Best for: Transition timing calibration |
"gap" | "carry" | "gap" | No | Handling of null/undefined values: 'gap' breaks the line truthfully; 'carry' propagates the last known valid state. Best for: Missing state semantics | |
heightOpt | number | string | 340 | No | Container height in pixels or standard CSS dimension strings. Best for: Dashboard slot sizing |
colorOpt | string | "var(--chart-1, #10b981)" | No | Primary theme stroke color for the stepped signal line. Best for: Thematic branding |
showGridOpt | boolean | true | No | Whether to render subtle horizontal background reference gridlines. Best for: Level comparison |
boolean | false | No | Whether to compute and display the prior state level and quantitative change in the tooltip on transitions. Best for: Transition inspection | |
domainOpt | [number, number] | ["auto", "auto"] | "auto" | No | Explicit Y-axis numeric domain, or auto calculated with safe padding. |
showXAxisOpt | boolean | true | No | Whether to display the horizontal category axis with tick thinning. |
showYAxisOpt | boolean | true | No | Whether to display the vertical numeric scale. |
showLegendOpt | boolean | false | No | Whether to display the chart legend. Single-series step signals keep this off by default. |
(value: number) => string | n => n.toLocaleString() | No | Custom formatter for Y-axis ticks and tooltip state numbers. | |
xFormatterOpt | (value: string | number) => string | String | No | Custom formatter for X-axis tick labels. |
StepReferenceLine[] | [] | No | Array of static horizontal reference lines representing quotas or SLAs. | |
motionOpt | boolean | { duration?: number } | true | No | Controls entry reveal animations, respecting user reduced motion preferences. |
titleOpt | string | "Step Signal Chart" | No | Accessible heading announced by screen readers. |
descriptionOpt | string | undefined | No | Long-form context describing what the discrete states represent. |
loadingOpt | boolean | false | No | Renders a neutral loading skeleton preserving container footprint without fake steps. |
errorOpt | Error | string | null | null | No | Renders an actionable error state banner with optional retry trigger. |
unavailableOpt | boolean | string | null | false | No | Renders a metric unavailability notice (e.g. unconfigured plan or missing policy model). |
Component Variants & Edge States
Production cookbooks showcasing configuration variants alongside verified handling of loading, empty data, and network error states.
API Request Quota Plan
Tiered request limits by quarter with stepAfter transitions ensuring limits remain constant throughout billing periods.
SaaS Subscription Pricing History
Discrete pricing tier changes over 2 years with localized currency formatting and transition delta inspection.
Worker Pool Allocation (Carry Policy)
Provisioned compute workers using carry policy across unobserved maintenance windows without dropping to zero.
Feature Flag Rollout Schedule
Staged feature rollout percentages across deployment stages with centered step transitions.
Skeletons indicate runtime fetch or pending data queries.
Handles empty collections ([]) gracefully without crashing.
Graceful failure banner when data source or script fails.
Responsive Behavior
Step Signal enforces container-driven responsive design:
- Desktop (): Full transition inspection, formatted transition delta context, all horizontal X ticks, and room for reference threshold labels.
- Tablet (): Intelligent X-axis label thinning via the Plotcn automatic tick manager, compact margins, and preserved step corner geometry.
- Mobile (): Touch-first scrub inspection, preserved state change points, zero diagonal slope simplification.
Core Rule: Responsive thinning may reduce non-essential axis tick labels, but never removes transition points or simplifies stepped geometry into a diagonal slope.
Container-Driven Breakpoints
Step Signal preserves every discrete transition boundary across all container widths. Responsive thinning reduces non-essential tick labels without smoothing or simplifying the stepped geometry.
Full transition inspection, formatted transition delta context, all horizontal X ticks, and room for reference threshold badges.
Thinned X-axis labels, preserved step corners, compact margins, tooltip pinned within viewport boundaries.
Edge-to-edge scrub inspection, preserved state change points, zero diagonal slope simplification, touch-first scrub interaction.
Accessibility & Screen Readers
Step Signal provides comprehensive accessibility for assistive technologies:
- Semantic Role: The chart container renders as
<figure role="region">with properaria-labelledbyandaria-describedbyattributes. - Factual Summary: Announces observation count, transition count, starting state, and ending state (e.g. "Discrete step visualization depicting 6 observations. Values remain constant between transitions and change at discrete boundaries. Initial level is 10,000, ending at 20,000. Recorded 3 distinct state transitions.").
- Keyboard Navigation:
ArrowRight: Move focus to the next observation or state transition.ArrowLeft: Move focus to the previous observation.Home: Jump directly to the initial observation.End: Jump directly to the latest observation.Escape: Dismiss active inspection tooltip.
- Color Independence: Stepped horizontal levels and vertical transitions communicate state changes geometrically, requiring zero color reliance.
- Reduced Motion: Full support for
prefers-reduced-motion: reduce; renders final stepped paths immediately without animation delay.
Accessibility & Navigation Standards
Factual screen reader announcement reporting observation count, transition count, initial state value, and final state value.
Container mounts as region with explicit assistive label.
Geometry alone communicates state persistence and transitions; zero color reliance for understanding level changes.
Embeds visually hidden summary (.sr-only) declaring: “Values remain level between observations and change at discrete transition points.”
Animations disable automatically under prefers-reduced-motion; final stepped geometry renders instantaneously.
| Key | Action |
|---|---|
| ArrowRight | Advance to the next observation or transition point. |
| ArrowLeft | Navigate to the previous observation or transition point. |
| Home | Jump directly to the initial observation state. |
| End | Jump directly to the latest observation state. |
| Escape | Dismiss active tooltip inspection and reset focus. |
Data Safety Guarantees
Step Signal upholds Plotcn's rigorous data safety standards:
- ✓ No Missing-to-Zero Coercion: Missing values remain explicit gaps or carried states; never coerced to
0. - ✓ No Gradual Slope Interpolation: Diagonal curve types (
monotone,linear) are intentionally omitted from public props. - ✓ Constant States Remain Constant: Datasets with identical values render a true horizontal level without domain collapse or flatlining.
- ✓ Safe Domain Expansion: Single observations and constant levels automatically expand with sensible padding.
- ✓ Non-Finite Filtering:
NaN,Infinity, and-Infinityare safely treated as missing values, preventing malformed SVG paths. - ✓ Caller Data Immutability: Input data arrays and observation records are never mutated.
Internal Architecture & File Dependencies
Source-first ownership model. Inspect the exact component call tree, dependencies, and full implementation below.
Manages container constraints and CSS variable token mapping
Synchronizes horizontal X-axis, vertical Y-axis, grid, and stepped line paths