Guide

Custom Charts architecture

Maintainer overview of the registered script and JS library surface.

Registration

PRC\Platform\CustomCharts\PRC_Custom_Charts hooks wp_enqueue_scripts and registers:

HandleSource
prc-custom-chartsbuild/index.js (+ build/index.asset.php dependencies)

Callers enqueue the handle when a page needs a bespoke chart. The plugin does not register blocks or REST routes.

Library export

Webpack exposes the bundle as window.prcCustomCharts. src/index.js exports:

  • ChartBuilderRenderer — default from ./custom-chart-renderer
  • baseConfig — re-exported from @prc/charting-utilities

Chart implementations live under src/charts/ and shared helpers under src/shared/.

Build

From the repo root:

npx turbo build --filter=@prc/custom-charts

The package script runs TypeScript (tsc) then wp-scripts build src/index.js --output-path build.

Was this helpful?