Data Contour Surface
motiq/data-contour-surfaceFreeComponent
A data-driven contour background: contours are computed from application-supplied values (signed focal pressure points, thresholds, active/comparison regions) via canvas marching-squares — not a random topographic texture. Emphasized thresholds get heavier bands, the active region brightens, comparison regions ghost, and data changes ease smoothly. One canvas + one rAF loop (no per-frame React state, no WebGL). Deterministic first paint, intentional light/dark, reduced-motion-static, forced-colors-safe, offscreen-paused.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/data-contour-surface.jsonSource
1"use client";23import * as React from "react";45import { cn } from "@/lib/utils";6import {7 useReducedMotion,8 useVisibilityPause,9 resolveComposition,10 compositionScrimStyle,11 contentFalloff,12 labelHiddenAt,13 type ContentPlacement,14 type ResolvedComposition,15} from "@/lib/motiq";1617/* -------------------------------------------------------------------------- */18/* Types */19/* -------------------------------------------------------------------------- */2021export interface ContourPoint {22 /** 0–1 horizontal position of the pressure point. */23 x: number;24 /** 0–1 vertical position of the pressure point. */25 y: number;26 /** Signed magnitude — positive raises the field, negative lowers it. */27 value: number;28 /** Falloff radius in field space (0–1). Wider = broader influence. Default 0.2. */29 radius?: number;30}3132export interface ContourRegion {33 /** 0–1 left edge. */34 x: number;35 /** 0–1 top edge. */36 y: number;37 /** 0–1 width. */38 w: number;39 /** 0–1 height. */40 h: number;41}4243export interface DataContourSurfaceProps44 extends React.HTMLAttributes<HTMLDivElement> {45 /** Focal pressure points that define the scalar field. Omit for deterministic sample data. */46 points?: ContourPoint[];47 /** Field values that get emphasized iso-lines (heavier weight, never color alone). */48 thresholds?: number[];49 /** Region brightened above the rest — the reading in focus. */50 activeRegion?: ContourRegion;51 /** Regions rendered as ghosted, dashed overlays for comparison. */52 comparisonRegions?: ContourRegion[];53 /**54 * Where the foreground content sits. The contour field runs full-bleed on every55 * placement; a frosted-glass scrim behind the copy keeps text readable (via blur,56 * not a hard cut) while the field stays visible underneath. "none" = full-bleed,57 * no scrim.58 */59 contentPlacement?: ContentPlacement;60 /** Extra ramp width (0–1) over which the field returns to full strength past the content. */61 safeAreaPadding?: number;62 /** How strongly the field softens (never below a visible floor) behind content (0–1). */63 safeAreaStrength?: number;64 /** Draw the region annotations (active-region ticks, comparison frames). Default true. */65 showLabels?: boolean;66 /** Drop region annotations that fall inside/near the readable region. Default true. */67 hideLabelsNearContent?: boolean;68// … truncated
What it pulls in
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
