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
| Component | Use When |
|---|---|
GraphicWalker | You need the full drag-and-drop exploration interface |
GraphicRenderer | You want to display saved charts with toolbar controls visible |
PureRenderer | You want a minimal, read-only chart with no UI chrome |
Props
GraphicRenderer accepts all the same props as GraphicWalker, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
containerClassName | string | undefined | CSS class for the chart container. |
containerStyle | React.CSSProperties | undefined | Inline styles for the chart container. |
overrideSize | { mode: 'auto' | 'fixed' | 'full'; width: number; height: number } | undefined | Override 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 }}
/>