Package com.inductiveautomation.perspective.common.config.charts
Canvas charts are styled by fetching ECharts theme JSON from the gateway at runtime — there is no bundled client-side default. This package owns the shape of a chart style resource and the bundled style content that ships with the module.
How the pieces fit
CanvasChartStyleConfigis one chart style: the ECharts theme JSON plus the Perspective themes it claims. Each is its own gateway-scoped resource — one directory, oneconfig.json— registered through the platform configuration framework in perspective-gateway and edited in the Gateway web UI, so one set of styles applies across every project. The theme JSON is stored verbatim: exactly the objectecharts.registerThemeconsumes, never reshaped.ChartStyleUtilholds the bundledlight/darkstyle content and the by-name fallback used when no configured style claims a theme.
Data flow
The gateway serves style JSON over the content-hashed, immutably-cached routes
/canvas-chart-styles/style/:name/:hash/style.json (a style by name) and
/canvas-chart-styles/theme/:name/:hash/style.json (the style assigned to a Perspective theme);
the frontend (useChartStyle) fetches one and registers it with ECharts. A freshly-loaded
session receives the current style hash on its project-load response and resolves its chart style
once from that hash — there is no live propagation to running sessions. An author's edit only
affects sessions loaded (or reloaded) after the edit.
Ownership
This package defines the resource shape and the bundled content (under
resources/canvas-chart-styles/) only. Registration, seeding, resolution, serving, and hashing
all live in perspective-gateway's charts package; resolution in particular needs the
resource collection, which is gateway-only.
-
ClassDescriptionOne canvas chart style: the ECharts theme a chart renders with, plus the metadata the Perspective Gateway web UI needs to list and preview it.Reads and writes one style's
config.json.