Components/MotionMetric

MotionMetric

Source-mapped caller-driven metrics, charts and composite dashboards

Since 0.6.3BETA

This component doc is in progress

This page is still being migrated. Demos and API details may change.

TxMotionMetric preserves 15 catalog variants, all 29 Metrics source capabilities, and all 29 original AnimatedMetricCard interaction branches. Cache allocations, pixel matrices, piano keys, staircase columns, paired bars, barcodes, arcs, area curves, sleep stages and message threads retain independent layouts rather than relabeling one statistic card.

Usage

Select a catalog ID, source capability or original interaction. Switch supplied sample periods and operate chart scrubbers, noise bounds, stage selection, asset filtering and feedback input. Values and status can be edited right in the demo. Details, share, resume, start/pause and send only emit events; the demo appends sample messages locally.

Charts expose keyboard-operable data-point scrubbers by default. The noise lower input is natively bounded by the current upper value, and the upper input by the current lower value, keeping readouts and native thumbs aligned at crossings.

Loading demo...

Data and lifecycle

The component does not query network, audio, health, financial or monitoring services, generate stock prices, simulate monitoring/countdowns, or promise notification delivery. The caller updates series, metrics, status, remaining and result models. Missing business data shows an empty state, not fixed readings. Existing SVG/D3 charts, TxStatCard, TxSlider, TxInput, TxButton and TxTextMorph are reused. Shared activity disables value/gauge motion offscreen, in hidden documents, while KeepAlive is inactive and under reduced motion.

API Reference

Props

PropTypeDefaultDescription
variantMotionMetricVariantm-progress-pianoCatalog, composite or original interaction ID
interactionMotionMetricInteractionprogress-indicator-pianoDispatch used only by animated-metric-card
dataMotionMetricData—Caller-owned dataset
seriesMotionMetricSeries[]—Overrides selected dataset series
metricsMotionMetricReadout[]—Overrides selected dataset readouts
statusstring—Caller status; no inferred business success
periodstringFirst periodControlled selected period (v-model:period)
periodsMotionMetricPeriod[]—Each option has its own real data object
filterStyle'pills' | 'select'Source-appropriateNative pills or native select
activeIndexnumber0Controlled selected chart/matrix/step index
modelValuenumberdata.value / data.thresholdNumeric readout override; alerts use threshold
range[number, number][data.min ?? 30, data.max ?? 120]Noise range bounds, emits without measuring audio
runningbooleanfalseTimer running model; never starts a clock
messagestringEmptyFeedback draft
disabledbooleanfalseDisables native inputs and action events
animatedbooleantrueShared visibility/reduced-motion gate for value/gauge motion
size'xs' | 'sm' | 'md' | 'lg'mdToken-driven spacing and numeral size
labelsPartial<MotionMetricLabels>English defaultsOverride every control/empty-state string
formatValue(value, unit?) => stringNumber with up to 2 decimals + unitFormatting only; does not alter chart data

Data types

TypeFieldsDescription
MotionMetricDatatitle, description, value, target, min, max, unit, previous, rank, status, remaining, total, threshold, columns, metrics, series, groups, cells, weekdays, steps, profiles, messagesNo business defaults. remaining/total are seconds. target defaults to 100 only for gauge geometry.
MotionMetricSeriesid, label, points, unit?, tone?Independent series; points have label/value, optional description, semantic tone and sleep-stage level (0–100).
MotionMetricReadoutid, label, value, unit?, previous?, target?, description?, status?, tone?, grade?Numeric or textual values; grade is used by credit reports.
MotionMetricGroupid, label, value?, target?, unit?, columns?, cells?, metrics?, series?, period?, periods?Named sub-layout. Sales/finance/credit dashboard groups can supply independent period data; group.period is controlled, otherwise selection stays local.
MotionMetricCellid, label, value, description?, selected?Activity intensity or calendar day; selection emits id/index.
MotionMetricStepid, label, value, status?Relative segment width and caller-provided step state.
MotionMetricProfileid, name, initials?, status, detail?, value?, segments?, flight?Flight contains label/from/to/departure/arrival/progress (0–100). No external avatar URL is bundled.
MotionMetricMessageid, author, text, time?Caller-owned messages; send does not append or claim delivery.
MotionMetricPeriodvalue, label, dataSelected data merges over base data; explicit top-level series/metrics/status take precedence.
VariantGroup IDsDescription
cache-stats-card / cacheable-bandwidth-costbandwidthgroup.value/unit = cacheable amount; group.metrics = cached/non-cacheable allocation
network-telemetryAny IDEach group is an independent named activity matrix
sales-dashboardanalytics, targetPaired chart and segmented sales target
credit-score-cardsreport, utilization, historyGraded rows, balance/limit and score history
finance-dashboardsavings, credit, expenses, assetsPixel savings, barcode, stacked expenses and locally filtered asset allocation
marketing-cardschannels, campaignChannel allocation and chart/readout split
health-cardsgoals, period, hydration, workout, steps, sleep, heart, targetDaily rings, cycle dots, charts, sleep-stage heights and weekly target
system-metrics-cardAny IDEach group has quantiles and an independent chart; top-level metrics are errors
course-progress-cardAny IDTraining chart and attendee readouts

Default labels: period: Period, empty: No data for this period, details: View details, share: Share, more: More actions, scrubber: Select a data point, current: Current, target: Target, remaining: Remaining, low: Low, high: High, minimum: Minimum, maximum: Maximum, threshold: Threshold, start: Start, pause: Pause, message: Message, send: Send, all: See all, resume: Resume, analysis: Analysis, average: Average.

Events

EventPayloadDescription
update:periodstringPeriod selection
update:activeIndexnumberChart, matrix or step selection
update:modelValuenumberProgress/noise input or alert threshold
update:range[number, number]Noise range bounds
update:runningbooleanStart/pause intent; no internal clock
update:messagestringFeedback draft
select{ id: string, index: number }Selected point; chart id is empty
filter{ groupId: string, period: string }Independent dashboard group period selection
actionstringdetails/share/more/add/resume/all
sendstringTrimmed nonempty message

Slots

SlotScopeDescription
header{ data }Custom heading area
avatar—Caller-owned licensed avatar
preview{ data }Real content preview in feedback layout
footer{ data }Source/unit/update information

CSS variables

VariablePurpose
--tx-mm-padRoot padding / 根内边距
--tx-mm-gapSection spacing / 区块间距
--tx-mm-numberNumeric display size / 数值字号
--tx-chart-categorical-1..6Independent series palette / 独立序列颜色
--tx-chart-grid-lineChart reference grid / 图表参考线
--tx-color-*, --tx-text-color-*, --tx-fill-color-*, --tx-bg-color, --tx-border-color-*Shared semantic theme / 共享语义主题

Complete variants and source mapping

15 catalog entries

Catalog IDInteractionCapability
m-cache-bandwidthcacheable-bandwidth-costCached / non-cacheable allocation, total and cost
m-net-matrixnetwork-telemetry-matrixFinality readouts and independent network matrices
m-progress-pianoprogress-indicator-piano28 piano keys and numeric goal input
m-server-stepserver-performance-step-barsStaircase columns with bright top caps
m-overview-scrubberoverview-bar-scrubber-cardStriped columns, active point and scrubber tooltip
m-sales-dualsales-analytics-dual-barsSales / earnings paired bars and unit target
m-sales-arcsales-target-segmented-arcListed / delivered segmented half-circle
m-sales-radial-dashsales-overview-radial-dashboardRank banner, radial goal and two readouts
m-credit-barcodecredit-score-barcode-meter42-stroke credit meter with period dropdown
m-mono-stockmono-stockMonochrome stock curve, period data and hover values
m-users-pillusers-growth-pill-progressStar/profile header and three selectable pill bars
m-views-waveviews-hourly-wave-chartHourly wave, actual average and period filtering
m-mono-heatmapmono-heatmapCaller-owned 28-day grayscale activity matrix
m-timer-preptimer-preparation-segmentedCaller remaining time, selected stage and segmented steps
m-noise-levelnoise-decibel-levelSignal bars, current input and paired range controls

All 29 source capabilities

Each source path is relative to src/components/metrics/ at pinned upstream commit 43c29ce9cdd16459e3eab4992381b8d35b38776a. The component exports MOTION_METRIC_SOURCE_MAP for programmatic mapping.

SourceVariantCapability
AnimatedMetricCard.tsxanimated-metric-card29 interaction branches; no universal fallback card
Budget.tsxbudgetThree-row 64-column budget matrix and details event
CacheStatsCard.tsxcache-stats-cardQuery/cache readouts and bandwidth breakdown
CourseProgressCard.tsxcourse-progress-cardCourse ring, resume/all actions, training bars and attendees
CreditScoreCards.tsxcredit-score-cardsScore half-circle, graded report, utilization and history curve
FeedbackCard.tsxfeedback-cardCaller preview, editable message, send event and real message list
FinanceDashboard.tsxfinance-dashboardSavings pixels, credit barcode, stacked expenses and asset filter
Growth.tsxgrowthThree pixel-height growth columns
GrowthCalendar.tsxgrowth-calendarSelectable growth pills and caller calendar
HealthCards.tsxhealth-cardsDaily rings, cycle dots, hydration, workout, steps, sleep stages, heart rate and weekly target
MarketingCards.tsxmarketing-cardsChannel allocation and campaign chart/readout split
NetworkTelemetry.tsxnetwork-telemetrySummary statistics and per-network pixel matrices
NoiseCards.tsxnoise-cardsSeparate supplied noise readings and paired range controls
OverviewChart.tsxoverview-chartMonthly striped columns and selected readout
ProgressIndicator.tsxprogress-indicator36-key progress, comparison and real numeric input
PromptsCard.tsxprompts-card30-segment prompt quota meter
RealTimeAlerts.tsxreal-time-alertsBudget bars and editable threshold line; emits input only
RunningStatsCard.tsxrunning-stats-cardDistance/duration and daily bars including zero days
SalesDashboard.tsxsales-dashboardFour summary stats, paired sales bars and segmented target
SalesOverview.tsxsales-overviewRank banner, 12-segment goal and two stats
SavingsCards.tsxsavings-cardsSavings progress, add event, target and transaction columns
ServerPerformance.tsxserver-performanceCapped staircase performance columns
StatusCards.tsxstatus-cardsProfiles, activity/sleep timelines and actual flight progress
StockChartCard.tsxstock-chart-cardSupplied stock series with derived first/last delta
SystemMetricsCard.tsxsystem-metrics-cardLatency/lag charts, quantiles and error breakdown
TimerCard.tsxtimer-cardRemaining seconds, stage tooltip, steps and running event
UserMetrics.tsxuser-metricsFour audience statistics and a views/average wave
UsersChartCard.tsxusers-chart-cardAudience area, secondary readouts and details event
VisitorsChartCard.tsxvisitors-chart-cardTwo independent visitor curves and actual multi-series tooltip

Additional AnimatedMetricCard interactions

The 15 catalog interactions above and 14 below comprise all 29 branches. Pass an interaction directly as variant, or use variant="animated-metric-card" with interaction.

InteractionCapability
mono-revenueRevenue curve
mono-creditCredit ring and tier
mono-walletBalance and inflow/outflow
mono-savingsSavings target and progress
mono-activity-ringConcentric independent activity goals
mono-usersActive users and regional badges
mono-kfactorReferral multiplier ring
mono-latencyQuantiles and latency polyline
mono-bandwidthSpeed half-circle and latency/loss
mono-serverIndependent CPU/RAM rings and node/heap data
mono-progressBuild ring, steps and caller status
mono-radarIncident half-circle and caller alert counts
mono-timer-arcRemaining-time ring and start/pause event
mono-timer-ringIndependent focus/break concentric rings

Best Practices

  • Provide actual data per period and respond to update events in controlled mode. Do not merely relabel a button while reusing an unfiltered series.
  • The caller owns timer remaining/total, monitoring state, noise measurements and message delivery. running expresses intent, never backend success.
  • Keep readouts, barcode scores, ring progress and chart units consistent with target/min/max/unit. Credit-score composite geometry defaults to 300–850 and can be overridden.
  • Give series/metrics/groups/cells stable IDs, real labels and units. Missing points do not generate replacement business data.
  • Use level on health sleep points for stage height. Profile segments and flight data render their respective timelines.
  • Localize with labels, formatValue and licensed avatar slots. Respect reduced motion; do not add polling or permanent decorative animation.

Source and license

Ported from the pinned Amicro Metrics source implementations. MIT, Copyright (c) 2026 SYED SUBHAN UDDIN. Sample readings exist only in the documentation demo; the component has no business defaults. Build, type checking, documentation gates and real-browser acceptance are owned by integration; this page does not claim they have already run.