Skip to content
GRAPHIC WALKER
API Reference
GraphicRenderer

GraphicRenderer

GraphicRenderer renders pre-configured charts from Graphic Walker specifications. It displays charts without the full editing interface — users can view and interact with charts but cannot modify the field encodings.

import { GraphicRenderer } from '@kanaries/graphic-walker';

When to Use

ComponentUse When
GraphicWalkerYou need the full drag-and-drop exploration interface
GraphicRendererYou want to display saved charts with toolbar controls visible
PureRendererYou want a minimal, read-only chart with no UI chrome

Props

GraphicRenderer accepts all the same props as GraphicWalker, plus:

PropTypeDefaultDescription
containerClassNamestringundefinedCSS class for the chart container.
containerStyleReact.CSSPropertiesundefinedInline styles for the chart container.
overrideSize{ mode: 'auto' | 'fixed' | 'full'; width: number; height: number }undefinedOverride the chart size from the spec.

All data, appearance, i18n, and ref props from GraphicWalker apply here as well.

Example

import { GraphicRenderer } from '@kanaries/graphic-walker';
import type { IChart } from '@kanaries/graphic-walker';
 
const savedCharts: IChart[] = [
  {
    visId: 'chart-1',
    name: 'Monthly Revenue',
    encodings: {
      dimensions: [],
      measures: [],
      rows: [{ fid: 'revenue', name: 'Revenue', analyticType: 'measure', semanticType: 'quantitative' }],
      columns: [{ fid: 'month', name: 'Month', analyticType: 'dimension', semanticType: 'temporal' }],
      color: [],
      opacity: [],
      size: [],
      shape: [],
      theta: [],
      radius: [],
      longitude: [],
      latitude: [],
      geoId: [],
      details: [],
      filters: [],
      text: [],
    },
    config: {
      defaultAggregated: true,
      geoms: ['line'],
      coordSystem: 'generic',
      limit: -1,
    },
    layout: {
      showTableSummary: false,
      stack: 'none',
      showActions: false,
      interactiveScale: true,
      zeroScale: true,
      size: { mode: 'auto', width: 800, height: 400 },
      format: {},
      resolve: {},
    },
  },
];
 
function Dashboard() {
  return (
    <GraphicRenderer
      data={data}
      fields={fields}
      chart={savedCharts}
      appearance="media"
    />
  );
}

With Fixed Size

<GraphicRenderer
  data={data}
  fields={fields}
  chart={savedCharts}
  overrideSize={{ mode: 'fixed', width: 600, height: 400 }}
/>