030 / D3.JS / NETWORK
D3 Force-Directed Network
Force-directed network with a settling physics simulation, labeled nodes, and automatic centering.
- SPEC
- #030
- ENGINE
- D3.js
- FAMILY
- Network
- RENDERER
- svg
- STATUS
- beta
Installation
Checking public registry…
View local registry JSONCopied as source into your project (requires d3-force).
- BEST FOR
- D3 Force-Directed Network visual analytics and network category telemetry.
- DATA MODEL
- Normalized network records matching canonical dataShape.
- INTERACTION
- Static presentation
- RESPONSIVE
- Container-aware ResizeObserver
- ANIMATION
- Interpolated transitions
- RUNTIME
- D3.js svg
Basic & Interactive Integration
Import D3ForceNetwork directly into your React client component. Provide an array of observations conforming to the data shape.
Requires a client context ('use client') for DOM lifecycle and container measurement.
Input Schema & Coordinates
Input data format for D3 Force-Directed Network. Records should provide required coordinates and metrics.
| Field | Type | Required | Meaning |
|---|---|---|---|
label | string | Yes | Category label or horizontal axis timestamp |
value | number | Yes | Metric numerical magnitude |
Missing values are gracefully handled or skipped depending on interpolation rules.
Records should follow monotonic sorting for sequential coordinate plots.
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.
<Chart
data={data}
xKey="date"
seriesKey="value"
/>Primary theme stroke or fill color. Accepts CSS variables or color values.
color="#10b981"Default: "var(--chart-1, #10b981)"| Property | Type | Default | Required | Description |
|---|---|---|---|---|
dataReq | Record<string, any>[] | — | Yes | Array of structured observations or datum objects to visualize. Best for: Primary dataset |
colorOpt | string | "var(--chart-1, #10b981)" | No | Primary theme stroke or fill color. Accepts CSS variables or color values. Best for: Theming and visual branding |
heightOpt | number | string | 320 | No | Container height in pixels or standard CSS dimension strings. |
classNameOpt | string | undefined | No | Tailwind CSS classes or custom stylesheet class applied to container wrapper. |
Component Variants & Edge States
Production cookbooks showcasing configuration variants alongside verified handling of loading, empty data, and network error states.
D3 Force-Directed Network (Default)
Standard presentation with Plotcn dark theme tokens.
Skeletons indicate runtime fetch or pending data queries.
Handles empty collections ([]) gracefully without crashing.
Graceful failure banner when data source or script fails.
Container-Driven Breakpoints
Scales gracefully according to container width, recalculating layout bounds.
Full horizontal scale and complete axis tick labeling.
Tighter margins with optimized coordinate grid spacing.
Compact labels and touch-friendly interaction.
Accessibility & Navigation Standards
Accessible visualization presenting D3 Force-Directed Network data with semantic contrast.
Container mounts as figure[role="region"] with explicit assistive label.
Coordinate baselines and labels preserve data legibility regardless of color perception.
Embeds visually hidden summary (.sr-only) declaring: “D3 Force-Directed Network data visualization”
Suppresses transitions when user prefers reduced motion.
| Key | Action |
|---|---|
| Tab | Focus chart container and navigate through interactive regions. |
Internal Architecture & File Dependencies
Source-first ownership model. Inspect the exact component call tree, dependencies, and full implementation below.
Visualization calculations and rendering via D3.js.