002 / RECHARTS / LINE
Pulse Line
High-frequency operational trend visualization for rapidly changing metrics, rolling windows, and live telemetry surfaces.
- SPEC
- #002
- ENGINE
- Recharts
- FAMILY
- Line
- RENDERER
- svg
- STATUS
- preview
Installation
Checking public registry…
View local registry JSONCopied as source into your project (requires recharts).
Overview
Pulse Line is Plotcn's reference operational visualization designed for rapidly updating metrics, real-time dashboards, infrastructure monitoring, and streaming telemetry surfaces.
While Signal Line is calibrated for analytical trends and deliberate historical inspection, Pulse Line keeps watch over a live signal. It introduces an active terminal marker for the latest observation, built-in rolling window slicing (windowSize), direct geometry updates that prevent animation queue lag, and a restrained visual hierarchy that stays quiet in dense multi-metric dashboards.
import { PulseLine } from "@/components/charts/recharts/line-pulse"export function RequestLatencyCard() { return ( <PulseLine data={telemetryStream} xKey="timestamp" seriesKey="latency" windowSize={30} showLatestPoint showLatestValue color="var(--chart-1)" /> )}Best Suited For
Pulse Line is optimized for continuous operational metrics where immediate awareness of the current value and recent trajectory is paramount:
- API & Service Telemetry: Request throughput (QPS), P50/P95/P99 latency, error rates, and connection pools.
- Infrastructure Health: CPU load %, memory pressure, disk I/O velocity, active worker threads, and queue depth.
- Live Business Operations: Payment processing velocity, streaming conversions, checkout queue volume, and concurrent connected clients.
- IoT & Sensor Feeds: Temperature delta, battery voltage drain, and network packet loss.
When to Avoid
- Historical Reporting: Use
SignalLinewhen inspecting multi-month business trends with deliberate reporting annotations. - Comparing Independent Series: Use
MultiSeriesLineorStackedAreawhen comparing 3+ separate metrics simultaneously. - Part-to-Whole Relationships: Use
DonutorTreemapwhen evaluating categorical share rather than sequential rate of change.
Installation
Install Pulse Line directly into your project via the shadcn CLI. The component source and its required dependencies (recharts and shared Plotcn primitives) will be copied directly into your codebase under full source ownership.
Checking public registry…
View local registry JSONCopied as source into your project (requires recharts).
Data Contract
Pulse Line accepts a readonly array of chronological records. Each observation contains a domain coordinate (timestamp or sequential interval) and a numeric metric value.
export interface OperationalSample { timestamp: string // ISO time string or sequential tick (e.g. "14:20:05") latency: number // Numeric operational observation (e.g. milliseconds)}Rolling Window (windowSize)
In streaming applications, observations arrive continuously. Rather than requiring caller-side array truncation, Pulse Line accepts a windowSize prop. It deterministically slices the latest observations without mutating the original dataset:
// Incoming buffer contains 120 observations; only the latest 30 are rendered<PulseLine data={buffer} xKey="time" seriesKey="qps" windowSize={30} />Truthful Missing Telemetry
In operational environments, a missing sample represents a telemetry drop or sensor outage—never a value of zero. Pulse Line adheres to strict data truthfulness:
| Policy | Configuration | Visual & Semantic Behavior |
|---|---|---|
| Gap (Default) | missingValuePolicy="gap" | Stroke breaks across missing observations. Prevents misleading drops to zero. |
| Connect | missingValuePolicy="connect" | Line bridges across the missing interval to connect adjacent valid samples. |
Component Props
Core Configuration
| Prop | Type | Default | Description |
|---|---|---|---|
data | readonly TData[] | [] | Readonly array of observation records. The caller's array is never mutated. |
xKey | keyof TData & string | required | Property name representing the horizontal X axis coordinate. |
seriesKey | keyof TData & string | "value" | Property name representing the numeric metric value. |
windowSize | number | undefined | Rolling window size. When specified, only the latest N observations are rendered. |
showLatestPoint | boolean | true | Renders a terminal marker dot with subtle outer ring at the latest observation. |
showLatestValue | boolean | false | Displays a compact header pill showing the latest formatted metric value. |
latestValueFormatter | (value: number) => string | undefined | Dedicated formatter for the latest-value pill. Falls back to series.valueFormatter. |
curve | "linear" | "monotone" | "step" | "monotone" | Interpolation method. Use linear for discrete sensor ticks, monotone for continuous flow. |
height | number | string | 280 | Container height in pixels or standard CSS string (e.g. 100%, 320px). |
domain | [number, number] | ["auto", "auto"] | "auto" | Explicit Y-axis bounds. Single-value signals automatically expand to prevent zero-height scales. |
tickStrategy | "auto" | "all" | "preserve-start" | "preserve-end" | "preserve-both" | "auto" | Horizontal tick thinning policy. |
Operational & Visual
| Prop | Type | Default | Description |
|---|---|---|---|
updateMode | "direct" | "transition" | "direct" | High-frequency update mode. direct applies updates immediately with zero animation lag. |
color | string | "var(--chart-1, #10b981)" | Primary stroke and terminal marker color. Supports CSS custom properties and hex codes. |
showGrid | boolean | true | Renders subtle horizontal dashed background reference rules (var(--chart-grid)). |
showXAxis | boolean | true | Renders horizontal domain tick labels. |
showYAxis | boolean | true | Renders vertical metric values. |
showLegend | boolean | false | Toggles series legend. Disabled by default to preserve dashboard surface area. |
referenceLines | readonly PulseReferenceLine[] | undefined | Array of horizontal threshold rules (e.g. SLO, SLA, capacity limit). |
missingValuePolicy | "gap" | "connect" | "gap" | Handling of null or undefined observations. |
motion | boolean | { duration: number } | true | Line reveal animation. Automatically disabled under prefers-reduced-motion. |
Accessibility & States
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "Pulse Line" | Accessible name announced by screen readers for the <figure> region. |
description | string | undefined | Extended description providing context on telemetry behavior. |
loading | boolean | false | Displays neutral loading skeleton while preserving chart layout footprint. |
error | Error | string | null | null | Displays actionable error state banner with optional retry trigger. |
unavailable | boolean | string | null | null | Displays metric stream unavailability notice (e.g. retention cutoff). |
onRetry | () => void | undefined | Callback invoked when user clicks the error retry trigger. |
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.
<PulseLine
data={data}
xKey="date"
seriesKey="value"
/>Rolling window size. When specified, only the latest N observations are rendered.
windowSize={6}Default: undefinedRenders an active terminal marker dot with subtle concentric ring at the latest observation.
showLatestPoint={true}Default: trueRenders a compact header pill showing the latest formatted metric value.
showLatestValue={false}Default: falseLine interpolation method. Use linear for discrete samples, monotone for smooth trajectories.
curve="monotone"Default: "monotone"Container height in pixels or standard CSS string (e.g. 100%, 320px).
height={280}Default: 280Primary stroke and terminal dot color. Supports CSS custom properties or hex codes.
color="var(--chart-1, #10b981)"Default: "var(--chart-1, #10b981)"Displays subtle horizontal dashed background reference rules.
showGrid={true}Default: trueHandling of null or disconnected observations. Gap avoids false interpolation.
missingValuePolicy="gap"Default: "gap"| Property | Type | Default | Required | Description |
|---|---|---|---|---|
dataReq | readonly TData[] | [] | Yes | Readonly array of operational telemetry records. Caller array is never mutated. Best for: Incoming telemetry stream or rolling buffer |
xKeyReq | keyof TData & string | - | Yes | Property name for horizontal time coordinates (e.g. timestamp, time, tick). Best for: Domain accessor |
seriesKeyOpt | keyof TData & string | "value" | No | Property name for numeric metric value. Best for: Metric accessor |
windowSizeOpt | number | undefined | No | Rolling window size. When specified, only the latest N observations are rendered. Best for: Keeping chart uncluttered in live streaming dashboards |
boolean | true | No | Renders an active terminal marker dot with subtle concentric ring at the latest observation. Best for: Immediate visual awareness of current signal state | |
boolean | false | No | Renders a compact header pill showing the latest formatted metric value. Best for: High-density monitoring panels | |
curveOpt | "linear" | "monotone" | "step" | "monotone" | No | Line interpolation method. Use linear for discrete samples, monotone for smooth trajectories. Best for: Matching telemetry physics and sampling rate |
heightOpt | number | string | 280 | No | Container height in pixels or standard CSS string (e.g. 100%, 320px). Best for: Dashboard panel height alignment |
colorOpt | string | "var(--chart-1, #10b981)" | No | Primary stroke and terminal dot color. Supports CSS custom properties or hex codes. Best for: Semantic operational status (emerald for normal, amber for warn) |
showGridOpt | boolean | true | No | Displays subtle horizontal dashed background reference rules. Best for: Quiet structural reference |
"gap" | "connect" | "gap" | No | Handling of null or disconnected observations. Gap avoids false interpolation. Best for: Truthful reporting of telemetry outages | |
updateModeOpt | "direct" | "transition" | "direct" | No | Direct applies geometry instantly without animation lag; transition interpolates over 150ms. Best for: High-frequency streaming where animation queues must be avoided |
domainOpt | [number, number] | ["auto", "auto"] | "auto" | No | Explicit Y-axis bounds. Single-value signals automatically expand to prevent zero-height scales. Best for: Fixing scale bounds across multiple metric panels |
readonly PulseReferenceLine[] | undefined | No | Array of horizontal threshold rules (e.g. SLO, SLA, capacity limit). Best for: Operational threshold monitoring | |
showLegendOpt | boolean | false | No | Toggles series legend. Disabled by default to save dashboard surface space. Best for: Multi-panel consistency when required |
loadingOpt | boolean | false | No | Displays neutral loading skeleton while preserving chart layout footprint. Best for: Initial stream connection |
errorOpt | Error | string | null | null | No | Displays actionable error state banner with optional retry trigger. Best for: WebSocket or telemetry stream failure |
unavailableOpt | boolean | string | null | null | No | Displays metric stream unavailability notice (e.g. tier limits or retention cutoffs). Best for: Permission or stream retention boundaries |
Component Variants & Edge States
Production cookbooks showcasing configuration variants alongside verified handling of loading, empty data, and network error states.
API Request Throughput
High-frequency operational throughput signal in QPS with rolling window and active terminal dot.
P99 Latency with SLO Threshold
Telemetry latency signal with reference threshold rule at 100ms SLO target.
Telemetry Outage (Truthful Gap)
Demonstrating truthful missing-value handling when telemetry drops between sensors.
Signed Net Queue Delta
Operational metric with positive and negative fluctuations around a zero baseline.
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
Pulse Line dynamically adjusts its tick density, terminal marker offsets, and hit target padding via an internal ResizeObserver:
- Desktop (1024px+): Full horizontal interval resolution, spacious margins, prominent latest-value badge, and hover crosshair.
- Tablet (640px – 1023px): Adaptive tick thinning (preserving endpoints), compact latest pill, and balanced axis footprint.
- Mobile (< 640px): Aggressive tick reduction (preserving start and end ticks), inline latest-value rail, and edge-to-edge touch scrub.
Container-Driven Breakpoints
Pulse Line adapts its tick intervals, latest value badge, and hit target padding dynamically based on available container width.
Full horizontal interval resolution, prominent latest-value pill, spacious margin offsets.
Adaptive tick thinning (preserving endpoints), compact latest pill, balanced axis footprint.
Aggressive tick reduction (start and end ticks preserved), latest value inline rail, full touch scrub.
Accessibility & Keyboard Navigation
Pulse Line is fully operable without a mouse:
- Focusable Container: Pressing Tab focuses the chart container with a prominent focus ring (
var(--chart-focus)). - Keyboard Controls:
- → Advances to the next observation.
- ← Moves to the previous observation.
- Home Jumps to the first visible observation in the current window.
- End Jumps directly to the latest live observation.
- Esc Clears active inspection selection.
- Controlled Audio Output: Pulse Line intentionally does not announce every incoming stream tick via
aria-live, preventing screen-reader audio flooding. Announcements occur only upon explicit user keyboard navigation. - Factual Figure Summary: An invisible
<figcaption>provides an automated quantitative overview (observation count, current value, and min/max extremes).
Accessibility & Navigation Standards
Screen-reader figure region with programmatic title, quantitative summary, and keyboard inspection.
Container mounts as region with explicit assistive label.
Latest terminal dot renders distinct concentric outer ring; tooltips provide explicit numeric values.
Embeds visually hidden summary (.sr-only) declaring: “VoiceOver and NVDA announce current value, sample count, and min/max extremes without flooding audio on every stream tick.”
Suppresses transitions and renders direct geometric positions when user requests reduced motion.
| Key | Action |
|---|---|
| Tab | Focus chart interaction surface with visible focus ring |
| ArrowLeft | Select previous data observation |
| ArrowRight | Select next data observation |
| Home | Jump to first data point in visible window |
| End | Jump directly to latest live observation |
| Escape | Clear active selection |
Data Safety Guarantee
- Zero Fabricated Operational Data: Pulse Line will never generate fake metrics when data is empty or disconnected.
- Zero Animation Queue Buildup: In
updateMode="direct"(default), rapid telemetry updates apply immediately without queuing transitions that lag behind real-time streams. - Historical Dot Elimination: Historical observation markers remain hidden by default, rendering only the single latest terminal marker to minimize SVG DOM nodes during high-frequency refreshes.
- Deterministic Window Slicing: Invalid or non-finite
windowSizevalues fall back safely to rendering all available data without throwing runtime exceptions.
Internal Architecture & File Dependencies
Source-first ownership model. Inspect the exact component call tree, dependencies, and full implementation below.
Scoped CSS variables for axes, grid, and crosshairs without global pollution.