Skip to content
Plotcnbeta
DocsChartsBlocksPlaygroundThemesExamples
Get started
Guide
  • Introduction
  • System Design
  • Engine Strategy
  • Installation
  • Project Setup
  • shadcn/ui Setup
  • Plotcn Registry
Fundamentals
  • Usage
  • Theming
  • Accessibility
  • Motion & Animation
  • Performance
  • TypeScript & I18n
Google Charts
  • Google Charts
  • Google GeoChart

Visualization Engine Strategy

Plotcn unifies Recharts, D3.js, and Google Charts into one coherent developer ecosystem while keeping the native capabilities of each engine available.

Edit on GitHub
Visualization Strategy

Visualization Engine Strategy

Plotcn unifies Recharts, D3.js, and Google Charts into one coherent developer ecosystem while keeping the native capabilities of each engine available.

Plotcn is built on three visualization engines, each chosen specifically for what it does best:

Recharts

Declarative React
Approachable React Application Charts

Fast, declarative Cartesian charts, business analytics, and dashboard KPI trends rendered as direct SVG elements.

Primary role: Standard business dashboard metrics

D3.js

Math & Geometry
Advanced Geometric & Mathematical Control

Custom coordinate scales, force-directed networks, hierarchical trees, and fluid physics simulations with React managing the DOM.

Primary role: Bespoke custom data representations

Google Charts

Hosted Runtime
Mature Google-Powered & Geographic Charts

Enterprise core charts, Gantt timelines, Sankey flow diagrams, and vector GeoChart choropleths via a shared client-side loader.

Primary role: Statistical choropleths & specialized types

The goal is not to normalize all three engines behind one artificial universal API.

Instead:

Plotcn provides one consistent visualization experience around three intentionally different engines.

Shared concerns such as responsiveness, theming, loading states, accessibility, formatting, documentation, and interaction conventions feel completely unified, while engine-specific capabilities remain available.

++

Recharts Collection

Recharts is the fast, approachable path for conventional application charts. Components are polished rather than over-engineered.

The Plotcn Recharts layer improves:

  • Responsive behavior and container-aware layouts
  • Visual styling with glassmorphic accents
  • Tooltip presentation and KPI readouts
  • Legend behavior and interactive highlighting
  • Loading, empty, and error fallback states
  • Accessibility, screen-reader summaries, and keyboard navigation
  • Reduced motion support honoring system settings
  • Formatting helpers and clear documentation
  • Transparent, editable source code readability

The guiding principle is:

Improve the product experience without hiding Recharts.

Initial Recharts Families

Family Initial Components
FamilyInitial Components
CartesianLine, Area, Bar, Stacked Bar, Grouped Bar, Composed, Scatter
PolarPie, Donut, Radar, Radial Bar
DashboardSparkline, KPI Trend, Mini Area, Metric Comparison, Progress
ComparisonMulti-Series Line, Comparison Area, Diverging Bar, Positive/Negative Bar
InteractiveSelectable Line, Interactive Legend, Brushable Range, Hover Comparison

Recharts Design Philosophy

Plotcn Recharts components favor simplicity, readable source, and sensible defaults over bloated configuration objects:

Recharts Design Philosophy
01
Simple API

No complex configuration objects for basic charts

02
Readable Source

Clean TypeScript JSX you can inspect and understand

03
Good Defaults

Tailwind tokens, responsive margins, and dark mode

04
Easy Customization

Edit the file in your repo when requirements change

Anti-Pattern Avoided: No monolithic <UniversalChart engine="recharts" ... /> wrappers.Canonical: <LineBasic data={data} />

Avoid turning basic chart components into huge configuration abstractions. A simple component remains conceptually straightforward:

TSX
<LineBasic data={data} />

Plotcn is source-first. Developers edit the component directly when product-specific behavior is required instead of toggling hundreds of props.

Recharts Component Roadmap

Line Charts

7 items
line-basicline-multipleline-dotsline-steppedline-gradientline-comparisonline-interactive

Area Charts

5 items
area-basicarea-gradientarea-stackedarea-comparisonarea-interactive

Bar Charts

7 items
bar-basicbar-horizontalbar-groupedbar-stackedbar-negativebar-comparisonbar-interactive

Pie & Donut

6 items
pie-basicpie-labelpie-interactivedonut-basicdonut-centered-valuedonut-interactive

Dashboard Primitives

6 items
sparkline-linesparkline-areakpi-trendmetric-comparisonmini-areaprogress-ring

Plotcn only exposes components that are genuinely implemented, tested, and available through the registry.

++

D3.js Collection

D3.js is used when Plotcn requires:

  • Lower-level visualization control and bespoke geometry
  • Unusual chart structures and statistical distributions
  • Hierarchy layouts (Treemaps, Sunbursts, Circle Packing)
  • Network graphs and physics-based force simulations
  • Financial visualization and multi-axis market depth
  • Continuous zoom, brush selections, and fluid coordinate transforms
  • High-density interactions and high-fidelity animated transitions
  • Visualization types that do not map naturally to Recharts

The core architecture strictly separates math from DOM:

D3.js Architectural Pipeline

Pure mathematical calculation separated from declarative React DOM

Math ➔ React ➔ Output
Raw / Aggregated Data
➔
D3 Math Calculations
➔
React DOM & State
➔
SVG / Canvas Output
D3 Primarily Owns:

Continuous scales, geometry generation, tree hierarchies, physics force simulation, interpolation math, contour paths, and geographic projections.

React Primarily Owns:

Rendering SVG paths, component lifecycle, user interaction state, tooltips, accessible naming, keyboard focus rings, and composition.

D3.js Categories

Category Examples
CategoryExamples
CartesianAnimated Line, Zoomable Line, Advanced Area, Scatter, Bubble, Hexbin
StatisticalHistogram, Box Plot, Violin, Density, Ridgeline, Heatmap, Correlation Matrix
HierarchyTreemap, Sunburst, Tree, Dendrogram, Circle Packing, Partition
NetworkForce Graph, Sankey, Chord, Dependency Graph
FinancialCandlestick, OHLC, Volume, Market Depth, Trading Timeline
GeographicChoropleth, Bubble Map, Symbol Map, Connection Map
TemporalTimeline, Calendar Heatmap, Horizon Chart, Streamgraph
ExperimentalVoronoi, Contour, Radial Network, custom SVG visualization

D3 Rendering Policy

In Plotcn, D3 calculates and React renders. Avoid imperative DOM mutations like:

TypeScript
// Avoid in React-owned component trees:d3.select(ref.current)  .append("svg")  .attr("width", width)

Vector SVG remains the default renderer. Canvas is introduced only when point count, mark density, or animation load genuinely justifies it. WebGL remains outside the default stack unless extreme 3D or massive data volumes require it.

D3 Module Policy

Plotcn imports focused D3 micro-packages rather than importing the monolithic d3 bundle:

TypeScript
import { extent, max } from "d3-array"import { scaleLinear, scaleTime } from "d3-scale"import { curveMonotoneX, line } from "d3-shape"import { hierarchy, treemap } from "d3-hierarchy"import { forceSimulation, forceManyBody } from "d3-force"import { geoMercator, geoPath } from "d3-geo"import { brushX } from "d3-brush"import { zoom } from "d3-zoom"

Avoid project-wide use of import * as d3 from "d3". Modular micro-packages keep dependencies explicit, improve tree-shaking, and prevent oversized bundle boundaries.

D3 Registry Dependency Policy

Each D3 registry item declares only the specific modules it requires:

d3-animated-line3 modules

Continuous Cartesian curves with smooth transitions

d3-arrayd3-scaled3-shape
d3-force-network3 modules

Physics-based node simulation and connection links

d3-forced3-scaled3-array
d3-choropleth3 modules

Mathematical geographic projections and value color scales

d3-geod3-scaled3-array
d3-treemap3 modules

Hierarchical squarified proportional rectangles

d3-hierarchyd3-scaled3-array
++

Google Charts Collection

Google Charts is Plotcn's third visualization engine. It is used where Google's mature runtime provides strong built-in chart types or geographic capabilities:

  • GeoChart: Country, state, provincial, and marker-based choropleths
  • Timeline & Gantt: Temporal spans and project schedules
  • Sankey: Multi-stage resource and user flow diagrams
  • TreeMap: Nested hierarchical data distributions
  • Gauge & Org Chart: Operational dashboards and organizational reporting
  • Table: Statistical interactive data grids
  • Core Charts: Enterprise compatibility for teams already using Google Charts

The Google Charts collection remains separate from Recharts and D3.js.

Google Charts Categories

Category Initial Components
CategoryInitial Components
Core CartesianLine, Area, Bar, Column, Combo
ComparisonScatter, Bubble, Histogram, Stepped Area
CircularPie, Donut
SpecializedTimeline, Gauge, Org Chart, TreeMap, Sankey, Table
GeoWorld GeoChart, Country GeoChart, State/Province GeoChart, Marker GeoChart, Region Selection

Google Core Charts

Core Google Charts include:

  • google-line, google-area, google-bar, google-column, google-combo
  • google-pie, google-donut, google-scatter, google-bubble
  • google-histogram, google-stepped-area

Google variants are included when they provide Google-specific capabilities, integration value, or compatibility for existing Google Charts users. Plotcn avoids duplicate implementations without a distinct product reason.

Google Specialized Charts

The specialized Google collection is where Google Charts delivers extraordinary value:

  • google-timeline: Interactive Gantt and project milestones
  • google-sankey: Energy and directional data flows
  • google-treemap: High-density hierarchical layouts
  • google-table: Sortable, pageable statistical grids
  • google-gauge: Operational thresholds and indicators
  • google-org-chart: Company hierarchies and reporting lines

Google GeoChart Collection

GeoChart is a first-class citizen inside the Google Charts collection:

Google Charts ➔ Geo Collection

No Google Maps Platform Required
World Choropleth

Global country-level statistical heatmaps using ISO-3166-1 codes.

Country Regions

Provincial, state, or regional zoom (e.g. US states, Indian states).

State / Province Regions

Sub-national territorial boundaries and statistical distributions.

Marker Map Mode

Specific latitude/longitude or city points with proportional radius.

Value-Based Color Scales

Linear gradient spectrums mapping metrics to HSL/OKLCH themes.

Region Selection Events

Typed onRegionSelect callbacks for interactive dashboard drill-downs.

GeoChart vs. Google Maps: GeoChart is vector SVG choropleth mapping belonging to Google Charts. It does not require Google Maps Platform, an API key, or a billing account.

Google Charts Runtime & Ownership Policy

Because Google Charts loads an external hosted runtime, Plotcn maintains a clear ownership boundary:

Google Charts Runtime & Ownership Boundary
Plotcn Source
➔
Google Wrapper
➔
Hosted Runtime
What You Own:
  • • Local Plotcn wrapper component source code
  • • CSS variable theme adapter and token mapping
  • • Typed data transformation and props mapping
  • • ResizeObserver container lifecycle logic
  • • Accessible screen-reader shell & data disclosure tables
  • • Event handlers and callback bridges
What Google Owns:
  • • The underlying hosted chart rendering engine
  • • Geographic boundary datasets (UN M.49 / ISO regions)
  • • Built-in internal vector rendering algorithms
  • • Native Google event dispatcher

Shared Google Loader Policy

All Google components share a singleton loader at @/lib/google-charts/loader.ts:

  • Script injection deduplication
  • Concurrent package request coordination
  • Strictly typed state machine (idle → loading → ready | error)
  • Zero any types
TypeScript
export type GoogleChartsLoaderState =  | "idle"  | "loading"  | "ready"  | "error"

Google Package Isolation

Packages load strictly on demand:

TypeScript
export const googleChartPackages = {  core: ["corechart"],  geo: ["geochart"],  timeline: ["timeline"],  sankey: ["sankey"],  org: ["orgchart"],  table: ["table"],} as const

Rendering a single Line Chart loads corechart only. It never loads geochart, timeline, or sankey.

Google Component Architecture

Plotcn provides a lightweight typed primitive (<GoogleChart />) and wraps it with specialized components:

TSX
<GoogleGeoChart  data={data}  regionKey="region"  valueKey="value"/>

Application-friendly data arrays are accepted directly:

TypeScript
const data = [  { region: "IN", value: 540 },  { region: "US", value: 420 },  { region: "DE", value: 210 },]

Plotcn transforms standard arrays internally, eliminating the need to construct Google DataTable instances manually.

Google Theme Adapter

Plotcn bridges application CSS variables to Google options at runtime:

Google Theme Translation Pipeline
STEP 01
App CSS Variables

Reads --background, --foreground, --chart-1 ... --chart-5

STEP 02
Plotcn Theme Resolver

Extracts computed HSL/OKLCH color values at runtime

STEP 03
Typed Google Options

Builds Google ChartOptions (colors, backgroundColor, fontName)

STEP 04
chart.draw(data, options)

Draws canvas/SVG with correct theme without brittle DOM mutation

Google Responsive Policy

Container resizing triggers debounced redraws:

Google Responsive Redraw Cycle

ResizeObserver detects width change
150ms Debounced Schedule
chart.draw(data, options)
Full Cleanup on Unmount

Google Accessibility Policy

Plotcn wraps Google visualizations in an accessible shell containing accessible titles, descriptions, live summaries, and data disclosure tables. Color alone is never the only means of conveying information.

++

Shared Engine Experience

All three engines share a standardized surrounding experience:

Concern Recharts D3.js Google Charts
ConcernRechartsD3.jsGoogle Charts
Responsive ContainerYes (ResizeObserver)Yes (ResizeObserver)Yes (ResizeObserver + Debounce)
Theme SystemCSS Variables / SVGCSS Variables / SVGTheme Options Adapter
Loading StateShared SkeletonShared SkeletonShared Skeleton
Empty StateShared PatternShared PatternShared Pattern
Error StateShared PatternShared PatternRuntime-Aware Surface
Accessibility ShellRegion + ARIA + TableRegion + ARIA + TableRegion + ARIA + Table (Critical)
Tooltip LanguageRecharts GlassmorphicD3 GlassmorphicGoogle / Custom Adapter
Legend LanguageRecharts InteractiveD3 InteractiveGoogle / Custom Adapter
Reduced MotionCSS / Recharts PolicyD3 Transition PolicyGoogle Options Support
Source Ownership100% Local Source100% Local Source100% Wrapper Source
++

Engine Selection Guide

Choose the engine tailored to your requirement:

Requirement Recommended Engine
RequirementRecommended Engine
Standard dashboard visualizationRecharts
Business analytics & reportingRecharts
Conventional React declarative chartsRecharts
Quick, composable chart layoutsRecharts
Highly custom visualization & geometryD3.js
Force-directed network graphsD3.js
Hierarchical sunbursts & circle packingD3.js
Dense statistical histograms & box plotsD3.js
Financial candlestick & market depthD3.js
Custom continuous zoom & brush gesturesD3.js
World, country, and state GeoChart choroplethsGoogle Charts
Project timelines & Gantt schedulesGoogle Charts
Directional Sankey flow diagramsGoogle Charts
Density-optimized TreeMapsGoogle Charts
Interactive statistical data tablesGoogle Charts
Existing Google Charts migrationsGoogle Charts
++

Registry Strategy & Dependency Isolation

Registry item naming is predictable, collision-free, and engine-isolated:

Registry Naming Conventions & Zero Cross-Engine Leakage
Recharts (Canonical)
@plotcn/line-basic

Default Cartesian application charts

D3.js (Modular)
@plotcn/d3-force-network

Explicit prefix indicating modular D3 algorithms

Google Charts
@plotcn/google-geochart

Explicit prefix indicating hosted runtime wrapper

Strict Isolation: Installing an item from one engine never installs dependencies or runtime helpers belonging to the other two engines.

Installing a Recharts component never downloads D3 or Google helpers. Installing a Google GeoChart installs only the Google loader helpers.

++

Gallery & Documentation Organization

The component gallery and documentation mirror the three-engine structure:

Gallery Engine Filters

All: Universal catalog sorted by popularity
Recharts: Line • Area • Bar • Pie • Dashboard
D3.js: Statistical • Hierarchy • Network • Financial • Geo
Google Charts: Core Charts • Specialized • GeoChart

Documentation Structure

/docs/recharts/* ➔ Conventional React Cartesian docs
/docs/d3/* ➔ Mathematical geometry & scale guides
/docs/google-charts ➔ Loader architecture & Core Charts
/docs/google-geochart ➔ World & regional choropleths
++

Initial Build Priority

Plotcn executes its implementation across seven distinct milestones:

PHASE 01

Shared Chart Foundation

Chart container & ResizeObserver
Semantic CSS variable tokens
Truthful state fallbacks (loading, empty, error)
Accessibility shell & data disclosure tables
PHASE 02

Recharts Core Collection

Line family (basic, multiple, gradient)
Area family (basic, stacked, comparison)
Bar family (grouped, horizontal, stacked)
Pie & Donut families with KPI metrics
PHASE 03

D3.js Core Collection

Modular math & coordinate scales
Animated & zoomable Cartesian lines
Hierarchical Treemap & Sunburst
Force-directed physics networks
PHASE 04

Google Charts Foundation

Singleton promise-deduped loader
Strict GoogleChartsLoaderState machine
On-demand package isolation map
CSS variable theme options adapter
PHASE 05

Google Core Charts

Google Line & Bar implementations
Google Pie & Donut charts
Debounced container redraw lifecycle
Accessible table fallback parity
PHASE 06

Google GeoChart Collection

World country choropleths (ISO-3166-1)
State & provincial region zooming
Value-based color scale gradients
Typed onRegionSelect event dispatching
PHASE 07

Specialized & Experimental

Google Timeline & Gantt schedules
Google Sankey energy/data flows
Google TreeMap density grids
Advanced D3 experimental geometries
++

Core Engine Principles

Fourteen immutable rules guide the Plotcn engine strategy:

01Recharts is the approachable application-chart engine.
02D3.js is the advanced geometric visualization engine.
03Google Charts is the mature Google-powered specialized & geographic engine.
04No engine should be forced through another engine.
05Plotcn shares the product experience, not internal rendering mechanics.
06Registry items remain strictly engine-isolated.
07D3 modules remain explicit, granular, and modular.
08Google packages load strictly on demand.
09Google Charts never loads globally or eagerly.
10SVG remains the preferred Plotcn-owned renderer.
11Canvas is added for justified high-density D3 cases.
12Source must remain readable after registry installation.
13Accessibility and responsiveness are part of every component contract.
14Components are implemented for real value, not to inflate catalog count.
++

Final System Mental Model

Engine Strategy 3.32

Visualization Engine Strategy Mental Model

Use Recharts when the chart should be easy. Use D3.js when the visualization needs control. Use Google Charts when specialized or geographic capabilities are the right fit.

THREE ENGINES
Unified Experience
Plotcn Ecosystem
Source-first visualization system with distinct rendering engines.
branches into three specialized collections
RECHARTS COLLECTION
Declarative SVG
Approachable React Charts
Conventional business metrics, dashboards, and Cartesian lines/bars/areas.
D3.JS COLLECTION
Math + React DOM
Complete Geometric Control
Continuous scales, physics networks, hierarchical trees, and custom projections.
GOOGLE CHARTS COLLECTION
Hosted Runtime
Mature & Geographic Charts
Vector GeoChart choropleths, Timelines, Sankeys, and enterprise core charts.
wrapped by shared product layer
SHARED PLOTCN EXPERIENCE LAYER

Container Responsiveness • Semantic Theme Tokens • Truthful States • Accessibility Shell • Tooltip & Legend Standards

distributed via shadcn Registry
YOUR CODEBASE
100% Owned
Local Editable Source
Installed directly into components/charts/. You own every pixel and line of code.
Use Recharts when the chart should be easy. Use D3.js when the visualization needs control. Use Google Charts when mature specialized or geographic capabilities are the right fit. Plotcn makes all three belong to one source-first visualization ecosystem.
PreviousSystem DesignNextInstallation

On this page

  • Recharts Collection
  • Initial Recharts Families
  • Recharts Design Philosophy
  • Recharts Component Roadmap
  • D3.js Collection
  • D3.js Categories
  • D3 Rendering Policy
  • D3 Module Policy
  • D3 Registry Dependency Policy
  • Google Charts Collection
  • Google Charts Categories
  • Google Core Charts
  • Google Specialized Charts
  • Google GeoChart Collection
  • Google Charts Runtime & Ownership Policy
  • Shared Google Loader Policy
  • Google Package Isolation
  • Google Component Architecture
  • Google Theme Adapter
  • Google Responsive Policy
  • Google Accessibility Policy
  • Shared Engine Experience
  • Engine Selection Guide
  • Registry Strategy & Dependency Isolation
  • Gallery & Documentation Organization
  • Initial Build Priority
  • Core Engine Principles
  • Final System Mental Model