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
Introduction

Plotcn

Three visualization engines. One coherent ecosystem. Source you own.

RechartsD3.jsGoogle ChartsTypeScriptshadcn RegistrySource Owned
Edit on GitHub

Plotcn is a source-first visualization system for React.

It brings together Recharts, D3.js, and Google Charts under a shared developer experience while keeping the strengths of each engine available. Instead of hiding visualization code behind a rigid package boundary, Plotcn distributes components through the shadcn Registry so the implementation lives directly inside your application.

System Overview

Plotcn Architecture System

Visual contract connecting shared styling, specialized visualization engines, and shadcn registry distribution.

SHARED ARCHITECTURE
PLATFORM
Plotcn System Core
Unified theme tokens, responsive container contract, accessible patterns, and engine adapters.
Source Owned · CSS Variables · Zero Locked Dependencies
engine adapters
engine adapters
ENGINE 01
SVG / React
Recharts
Declarative React SVG. Cartesian charts, lines, bars, areas, and radials.
Direct CSS/SVG · Cartesian
ENGINE 02
Math / Geometry
D3.js
Mathematical precision. Scales, coordinates, layouts, networks, and hierarchies.
Raw Layout · Geometry
ENGINE 03
External Runtime
Google Charts
GeoChart choropleths and mature Google-powered core charts via singleton loader.
Typed Options · GeoChart
registry distribution
registry distribution
DISTRIBUTION PROTOCOL
ActiveREGISTRY
shadcn Registry
CLI resolves components directly into raw TSX files: npx shadcn@latest add @plotcn/...
@plotcn/* · line-basic.json · application/json
source copied
DESTINATION PATH
ReadyOWNED
components/charts/
Raw React component files placed in your project. Full inspection, editing, and evolution.
Full Code Ownership · TypeScript · 0 Blackbox

Vision

Plotcn is designed as a visualization-focused sibling to shadcn/ui rather than a traditional black-box chart package.

The Plotcn Registry distributes complete, editable source code that developers can install directly into their applications, inspect, own, and customize.

Recharts, D3.js, and Google Charts remain distinct visualization engines, while Plotcn owns the shared visual language, responsive behavior, accessibility patterns, interaction conventions, documentation, source distribution, and overall developer experience.

01 / THREE VISUALIZATION ENGINESEngines
Recharts Collection
React-First

Dashboard, business analytics, Cartesian & radial metrics.

D3.js Collection
Math & Layout

Advanced custom geometry, scales, force layouts & hierarchies.

Google Charts Collection
Geo & Enterprise

Core charts, Timeline, Sankey, TreeMap, Table & GeoChart.

02 / SHARED VISUALIZATION EXPERIENCEShared Layer
Theme & Tokens
Theme Native

Semantic CSS variables with dark-mode adaptation.

Adaptive Responsiveness
Container Query

Container-driven resizing with fluid decluttering.

Accessible By Default
WCAG 2.2 AA

ARIA roles, live regions, and natural-language summaries.

Truthful States
State Machine

Explicit loading, empty, and actionable error states.

03 / DISTRIBUTION & ECOSYSTEMDelivery
shadcn Registry
@plotcn

Direct source delivery via CLI — zero runtime lock-in.

Blocks & Templates
Pre-Built

Complete analytics, dashboards, and reporting sections.

Interactive Docs & Playground
Zero-Lag

Live preview, theme toggling, and code generation.

The core product model flows directly from specialized visualization engines through Plotcn's shared visual and interaction standards into your Git repository:

Delivery Pipeline

Product Delivery Architecture

How visualization engines flow through Plotcn's shared system and registry directly into your codebase.

  1. 01Done
    Three Visualization Engines

    Recharts (React), D3.js (Math/Geometry), Google Charts (Geo & Enterprise).

  2. 02Done
    Plotcn Shared Layer

    Standardizes theme tokens, responsiveness, accessibility summaries, and interaction conventions.

  3. 03Done
    Plotcn Registry

    Distributes static JSON item manifests conforming to official shadcn registry schema.

  4. 04Active
    Developer-Owned Source

    Source code copied directly into your components/charts/ directory under Git control.

  5. 05Done
    Consumer Application

    Direct compilation inside Next.js, Vite, or Remix with zero third-party runtime package lock-in.

Plotcn does not try to hide the underlying visualization engines behind one universal API.

Plotcn standardizes the experience around the visualization while preserving the strengths and native capabilities of each engine.
++

Visualization Engine Strategy

Plotcn supports three distinct visualization families.

ENGINE 01Declarative React SVG

Recharts

Best for:React-first dashboard and product charts. Standard Cartesian and radial metrics.
Why use it:Declarative API, familiar React composition, fast implementation, strong common-chart coverage.
Plotcn adds:Visual defaults, responsive structure, interaction patterns, accessibility, and source-distributed components.
CartesianInteractiveReact-First
ENGINE 02Mathematical Precision

D3.js

Best for:Custom visualization, advanced geometry, specialized data relationships, and fine interaction.
Why use it:Complete control over scales, coordinates, layouts, projections, and data transformation.
Plotcn adds:React rendering patterns, reusable composition, consistent styling, accessibility, and production-ready structure.
GeometryHierarchyNetwork
ENGINE 03GeoChart & Mature Core

Google Charts

Best for:Google-powered chart types and geographic visualization (statistical choropleths).
Why use it:Mature visualization APIs and built-in GeoChart world/regional geographic boundary data.
Plotcn adds:React integration, singleton loader, responsive shell, theme adaptation, lifecycle handling, and loading/error states.
GeoChartChoroplethExternal Runtime

Recharts

Use Recharts for:

  • Standard dashboard charts
  • Business metrics and KPIs
  • Analytics interfaces
  • Declarative React visualization
  • Common Cartesian charts (Line, Area, Bar)
  • Pie and donut charts
  • Straightforward interaction patterns
  • Fast application development

Typical components include:

  • Line & Area: Continuous time-series metrics, trends, and filled volume distributions
  • Bar & Column: Categorical comparisons, grouped bars, and stacked financial metrics
  • Pie & Donut: Proportional breakdowns, category shares, and center-stat KPI cards
  • Scatter & Bubble: Two-dimensional correlation plots and distribution clusters
  • Radar & Radial: Multi-axis capability scoring and circular progress metrics
  • Composed Charts: Combined line and bar charts sharing a unified time axis

Recharts is the default starting point when a developer needs a polished, conventional React chart.

D3.js

Use D3.js for:

  • Advanced custom visualization
  • Bespoke geometric representations
  • Custom mathematical scales and continuous domains
  • Force-directed physics layouts
  • Hierarchy and tree visualizations
  • Complex data exploration and brush/zoom interactions
  • Highly specialized visualization behaviors

Plotcn structures D3 implementations with a clear boundary: D3 governs the mathematics and coordinate calculation, while React governs the semantic DOM, lifecycle, and accessibility attributes.

D3.js Domain
Math & Layout
  • →Scales & Domains: Linear, logarithmic, time, and ordinal mappings
  • →Geometric Curves: Spline curves, areas, arc math, voronoi tessellation
  • →Complex Layouts: Force-directed physics simulations, hierarchical trees
  • →Data Transformations: Bins, cross-filtering, and geographic projections
React Domain
DOM & Lifecycle
  • →SVG Element Rendering: Declarative JSX <path>, <rect>, <circle> nodes
  • →Component Lifecycle: State hooks, props reactivity, and resize observers
  • →Accessibility (a11y): ARIA attributes, live regions, table disclosures
  • →Interactive Events: React onClick, hover states, keyboard :focus-visible

Plotcn prefers granular micro-packages (such as d3-shape, d3-scale, d3-force) rather than monolithic bundle imports:

TypeScript
// Preferred: modular micro-packageimport { scaleLinear } from "d3-scale"import { line, curveMonotoneX } from "d3-shape"

Google Charts

Use Google Charts for mature Google-powered visualization types and geographic visualization where its native chart implementations are useful.

Core Charts

Mature standard charts

corechart
Line ChartArea ChartBar & ColumnCombo ChartPie & DonutScatter PlotBubble ChartHistogramStepped Area

Specialized Visualizations

Time, flow & hierarchy

specialized
Timeline / GanttSankey DiagramTreeMap DensityGauge MetricsOrg HierarchyInteractive Data Table

Geographic Visualization

Statistical choropleths

geochart
World Regional MapsCountry BreakdownState / Province LevelMarker Bubble MapsColor Scale GradientsRegion Select Handlers

Google Charts remains a separate engine family. Its APIs are not merged into Recharts or D3 abstractions.

GeoChart vs. Google Maps Platform: Google GeoChart belongs under Google Charts └── GeoChart as a vector SVG choropleth visualization. It does not require Google Maps Platform, an API key, or a billing account. Plotcn will only introduce a separate Maps family if dedicated raster/vector map SDKs (such as Google Maps Platform or MapLibre) are introduced.
++

Shared Visualization Experience

The three engines remain technically independent while sharing a consistent product experience.

Layered Architecture

System Component Architecture

Plotcn decouples the presentation layer from underlying visualization engines for maximum flexibility.

LAYER 01 — SHARED CONTRACT
SHARED
Shared Presentation Layer
Theme Tokens · Responsive Shell · Accessibility Roles · Skeletons & States · Tooltips
CSS Variables (--chart-grid, --chart-surface) · React Components
adapter layer
ADAPTER 01
Recharts Adapter
Declarative React SVG. Cartesian coordinate mapping, radial charts, and smooth curves.
Cartesian & Radial · React
ADAPTER 02
D3.js Adapter
Mathematical coordinate precision. Custom scales, hierarchies, force layouts, and trees.
Geometry & Scales · Math
ADAPTER 03
Google Charts Adapter
External runtime adapter. Google singleton loader, chart options translation, and GeoCharts.
External Runtime · GeoChart

The shared layer covers:

  • Chart containers and ResizeObserver bounding
  • Responsive measurement and fluid adaptations
  • Visual theme tokens and dark-mode adaptation
  • Truthful states (loading, empty, error, offline)
  • Accessibility (roles, live announcements, screen-reader data summaries)
  • Metadata standards and documentation structure
  • Tooltip and legend visual conventions
  • Number and currency formatting utilities
  • Purposeful motion adhering to prefers-reduced-motion

The shared layer never becomes a heavy cross-engine abstraction.

Consistency around the chart. Freedom inside the chart.
++

Product Principles

Principle Implementation meaning
PrincipleImplementation meaning
Copy, own, customizeInstalled Plotcn chart source lives inside your application and remains 100% editable.
Three engines, one ecosystemRecharts, D3.js, and Google Charts remain separate implementations presented within one coherent visualization system.
Choose the right engineDevelopers select Recharts for conventional React charts, D3.js for custom math/geometry, and Google Charts for mature Google chart types and GeoChart.
Shared experience, not a universal wrapperPlotcn standardizes theme, responsiveness, states, accessibility, and documentation without forcing every engine into one artificial API.
Adaptive responsivenessCharts alter tick density, legend placement, labels, margins, and interaction according to container dimensions—not merely global viewport width.
Accessibility by defaultAccessible naming, descriptions, natural-language summaries, keyboard navigation, reduced motion, and non-color encodings are standard contract requirements.
Purposeful motionAnimations communicate state transitions, filtering, and data changes rather than adding decorative distractions.
Simple first, composable when neededProvides ready-to-use chart components while preserving readable source and low-level customization paths.
Engine isolationInstalling a Recharts component never installs D3.js or Google Charts dependencies, and vice versa.
Source-first distributionPlotcn components are delivered through the shadcn Registry model rather than requiring an immutable npm runtime package.
Theme-nativeInherits your application's CSS variables and translates shared semantic tokens into each engine where necessary.
Truthful statesLoading, empty, error, unavailable, and offline states are explicit rather than masked with synthetic placeholder data.
Progressive complexityStart with a simple pre-configured component and customize deeper only when requirements demand it.
++

Three Engines, Different Strengths

There is no single "best" visualization engine. Choose the engine that best matches the specific visualization challenge.

Requirement Recommended engine
RequirementRecommended engine
Standard dashboard metrics & KPIsRecharts
Business analytics & reportingRecharts
Conventional React declarative chartsRecharts
Highly customized SVG visualizationD3.js
Specialized geometry & continuous scalesD3.js
Custom interaction model & brush/zoomD3.js
Force-directed networks & hierarchiesD3.js
Google GeoChart (world, countries, provinces)Google Charts
Google Timeline & Gantt visualizationsGoogle Charts
Google Sankey flow diagramsGoogle Charts
Google TreeMap hierarchical densityGoogle Charts
Google Table statistical data gridsGoogle Charts
Existing Google Charts enterprise migrationsGoogle Charts
++

Engine Isolation

Each registry item installs only what it requires. Plotcn strictly avoids bundle contamination:

@plotcn/line-basicRecharts
Installed Dependencies
recharts

Zero D3 or Google code installed

@plotcn/d3-force-networkD3.js
Installed Dependencies
d3-forced3-scale

Modular micro-packages only; zero Recharts or Google code

@plotcn/google-geochartGoogle Charts
Installed Dependencies
Plotcn Google loader

Zero npm bundle bloat; loads runtime from Google CDN on demand

Bundle Cleanliness: Plotcn components never install monolithic packages or cross-engine code. Your production bundle only pays for the exact charts you mount.

Engine isolation ensures your production application bundle contains zero unused visualization code.

++

Google Charts Runtime Model

Google Charts requires special architectural treatment because the underlying visualization runtime is externally hosted on Google's content delivery network.

Runtime Pipeline

Google Charts Hosted Runtime Architecture

How Plotcn coordinates local React wrapper source with Google's externally hosted charting engine.

  1. 01Done
    Plotcn Installed Source

    Your local component in components/charts/google/ with full customization freedom.

  2. 02Done
    React Chart Wrapper

    Manages container ref, resize observers, theme token mapping, and loading/error states.

  3. 03Done
    Shared Google Loader

    Singleton script injector deduplicating CDN requests and managing package promises.

  4. 04Done
    Google Charts Runtime

    External google.visualization library loaded securely from gstatic CDN.

  5. 05Active
    Rendered Visualization

    Hardware-accelerated SVG or Canvas rendered into the accessible Plotcn container.

What Plotcn owns:

  • React wrapper source code
  • Component lifecycle and resize observers
  • Loader coordination and promise deduplication
  • CSS variable theme mapping
  • Loading, empty, and error fallback surfaces
  • Accessible screen-reader summaries and data tables
  • Typed data transformation and event translation

What Google owns:

  • The underlying hosted chart rendering engine (google.visualization)
The developer owns the installed Plotcn Google wrapper source, but not Google's hosted visualization engine.
++

Google Loader Principle

All Google Charts components share a single, resilient loader located in @/lib/google-charts/loader.ts.

  • Single Script Injection: The external loader script tag is injected into the DOM at most once across the entire application lifetime.
  • Concurrent Request Deduplication: If multiple Google chart components mount simultaneously, they all await the same initialization Promise.
  • On-Demand Package Loading: Only the specific package needed (such as corechart or geochart) is requested via google.charts.load.
  • SSR Safety: Guards against accessing window or document during server-side pre-rendering, rendering a stable skeleton during hydration.
  • Timeout & Error Handling: If Google's CDN is unreachable or blocked by CSP, the loader transitions gracefully to an error surface with retry support.

The loader exposes a strictly typed state machine:

TypeScript
export type GoogleChartsLoaderState =  | "idle"  | "loading"  | "ready"  | "error"

Google Package Isolation

The loader loads only the specific packages declared by the mounted chart:

TypeScript
const googleChartPackages = {  core: ["corechart"],  geo: ["geochart"],  timeline: ["timeline"],  sankey: ["sankey"],  org: ["orgchart"],  table: ["table"],} as const
  • Google Line, Bar, Area → loads corechart
  • Google GeoChart → loads geochart
  • Google Timeline → loads timeline
  • Google Sankey → loads sankey

Packages are never loaded globally or preemptively.

++

Target Users

Plotcn is built for:

  • Frontend engineers building dashboards, SaaS analytics, reporting applications, and data-intensive admin panels.
  • Product teams wanting polished charts without repeatedly re-implementing responsive math, accessibility tables, tooltips, and loading skeletons.
  • Design system engineers requiring source-owned visualization primitives that conform directly to their brand's design tokens.
  • React teams already using shadcn/ui and looking for an identical copy-and-own workflow for visualization.
  • Data specialists requiring D3.js geometric flexibility for custom mathematical projections and network graphs.
  • Teams needing geographic visualization via Google GeoChart for country, state, and regional choropleths.
  • Organizations migrating existing Google Charts code into a modern, theme-aware React design system.
  • Developers who want complete source ownership and refuse to be trapped by closed-box third-party chart libraries.
++

Target Developer Experience

The intended developer journey is fast, transparent, and direct:

Developer Experience

Target Developer Journey

The 6-stage lifecycle from discovering a chart to shipping customizable source code.

  1. 01Done
    Discover Visualization

    Browse catalog for Cartesian, statistical, network, or geographic charts.

  2. 02Done
    Choose Engine

    Select Recharts (React), D3.js (custom geometry), or Google Charts (Geo/enterprise).

  3. 03Done
    Inspect Source

    Review raw TypeScript file, theme tokens, dependencies, and a11y disclosure tables.

  4. 04Active
    Install via shadcn CLI

    Run shadcn add @plotcn/<item> to pull source directly into your codebase.

  5. 05Done
    Import & Connect Data

    Import the local component, pass typed props, and customize styling to match your brand.

  6. 06Done
    Ship with Ownership

    Deploy with zero third-party chart package runtime lock-in or recurring dependencies.

Direct shadcn installation example:

Terminal
npx shadcn@latest add @plotcn/line-basic

Or for D3 and Google Charts:

Terminal
npx shadcn@latest add @plotcn/d3-force-network
Terminal
npx shadcn@latest add @plotcn/google-geochart
++

Product Positioning

Plotcn is intentionally not another proprietary chart library, nor is it an all-encompassing wrapper attempting to hide underlying engines.

Plotcn is a source-first React visualization system that brings Recharts, D3.js, and Google Charts into one consistent developer experience.

The engines provide the specialized visualization power. Plotcn provides the design language, responsive containers, error surfaces, accessible data summaries, registry distribution, and complete source code ownership.

++

Final Architecture & Mental Model

Ecosystem Architecture

Full Product Architecture & Mental Model

Three visualization engines. One coherent ecosystem. Source you own.

PLOTCN ECOSYSTEM
ROOT
Plotcn Visualization Platform
Source-first visualization architecture for modern React applications.
branches into three specialized engine collections
COLLECTION 01
React-First
Recharts Collection
Declarative dashboard & business charts. Line, Area, Bar, Pie, Radar.
Standard Dashboards
COLLECTION 02
Bespoke Math
D3.js Collection
Advanced custom geometry, force networks, hierarchies, custom continuous scales.
Geometric Control
COLLECTION 03
External CDN
Google Charts Collection
Core enterprise charts, Timeline, Sankey, TreeMap, Table, and GeoChart.
Geo & Enterprise
unified through shared chart layer
SHARED CAPABILITY
Theme & Tokens
Semantic CSS variables with dark-mode adaptation.
CSS Custom Properties
SHARED CAPABILITY
Fluid Responsiveness
Container-driven resizing with automatic tick & label decluttering.
ResizeObserver Container
SHARED CAPABILITY
Built-In Accessibility
Screen-reader data tables, ARIA roles, and reduced-motion enforcement.
WCAG 2.2 AA Compliant
distributed through open registry
DISTRIBUTION LAYER
shadcn Registry
Plotcn Registry (@plotcn)
Static JSON item manifests containing verified source files and dependencies.
https://plotcn.vercel.app/r
DEVELOPER CODEBASE
100% Editable
Direct Source Ownership
Raw TypeScript code copied into components/charts/ under full Git control.
Zero Runtime Lock-In
Three visualization engines. One coherent ecosystem. Source you own.
  • Recharts handles declarative, fast product dashboards.
  • D3.js provides complete geometric and mathematical control.
  • Google Charts delivers mature enterprise chart types and choropleth geographic maps.

Plotcn unifies all three under a single visual and architectural standard without compromising what makes each engine distinct.

++

Project Status

Plotcn is built iteratively and published component-by-component through verified registry items.

Architecture FoundationReady
Documentation ShellReady
Recharts ComponentsAvailable
D3.js ComponentsAvailable
Google Charts / GeoChartAvailable
shadcn Registry DistributionStaged
NextSystem Design

On this page

  • Vision
  • Visualization Engine Strategy
  • Recharts
  • D3.js
  • Google Charts
  • Shared Visualization Experience
  • Product Principles
  • Three Engines, Different Strengths
  • Engine Isolation
  • Google Charts Runtime Model
  • Google Loader Principle
  • Google Package Isolation
  • Target Users
  • Target Developer Experience
  • Product Positioning
  • Final Architecture & Mental Model
  • Project Status