WarUI

Chart Adapter Interface

GRID-A18-F17P1baselinePlanned

Defines a small, library-agnostic adapter contract that lets WarGrid hand chart-ready data to any charting library the app chooses. Core WarGrid ships no chart engine. Without an adapter, chart actions are hidden. The demo uses a tiny reference adapter written for the docs.

Planned. This page shows the specification from issue #198. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

Grid with the reference SVG adapter registered. An adapter inspector panel shows the ChartModel JSON passed to the adapter.

Expected behavior

With an adapter registered, chart menu items appear. With none, they disappear. A simulated error shows a contained error panel and the grid keeps working.

Planned API surface

chartAdapterChartAdapter.create()ChartAdapter.update()ChartAdapter.destroy()ChartAdapter.supportedTypesregisterChartAdapter()ChartModel

Acceptance criteria

  • The ChartModel is a documented, versioned plain JSON structure with categories, series, value formats and axis titles. (pending)
  • Core WarGrid has no runtime dependency on any chart library. (pending)
  • Adapter errors are caught, displayed, and reported through onChartError. (pending)
  • destroy() is called when the chart closes or the grid is disposed. (pending)