Variable: configSchema
ts
const configSchema: ObjectNode<{
a11y: ObjectNode<{
dataTable: Attr<
false | 'hidden' | 'visible',
{
description: "The traces' data tables: `'hidden'` for screen readers only (first 100 rows), `'visible'` shown below the chart with every row (virtualized), `false` none. Holochart only (plan E17.3).";
dflt: 'hidden';
values: readonly ['hidden', 'visible', false];
}
>;
keyboard: Attr<
boolean,
{
description: 'Keyboard access: Tab reaches the plot area (the arrows step through the data, `+` / `-` zoom) and the legend items. Holochart only (plan E6.5, E17.4).';
dflt: true;
}
>;
patterns: Attr<
boolean,
{
description: 'Give bars, histograms, polar bars, filled areas (`fillpattern`) and pie slices a distinct pattern each, as an encoding redundant with color, unless the trace or template sets one. Holochart only (plan E17.5).';
dflt: false;
}
>;
reducedMotion: Attr<
boolean | 'auto',
{
description: "Snap transitions and drill-down tweens instead of animating them: `'auto'` when the user's system asks for reduced motion (the `prefers-reduced-motion` media query), `true` always, `false` never. Holochart only (plan E17.5).";
dflt: 'auto';
values: readonly ['auto', true, false];
}
>;
summaries: Attr<
boolean,
{
description: 'Add generated summaries of trends and extremes ("Revenue rises from 1.2M in Jan to 3.4M in Dec") to what screen readers get. Their code loads after the first draw. Holochart only (plan E17.2).';
dflt: true;
}
>;
}>;
antialias: Attr<
boolean,
{
description: 'Request an antialiased WebGL context (fixed at context creation).';
dflt: true;
}
>;
ariaLabel: Attr<
string,
{
description: 'The chart\'s accessible name (`aria-label`), read by screen readers. Empty: `layout.meta.description` when set, else the figure title followed by an automatic summary ("Line chart with 3 traces"). Holochart only (plan E17.1).';
dflt: '';
}
>;
debug: Attr<
boolean,
{
description: 'Log update plans and pipeline timings to the console.';
dflt: false;
}
>;
displaylogo: Attr<
boolean,
{
description: 'Accepted for Plotly compatibility and ignored: the modebar has no logo.';
dflt: true;
}
>;
displayModeBar: Attr<
boolean | 'hover',
{
description: 'Show the modebar always (`true`), never (`false`) or on hover.';
dflt: 'hover';
values: readonly ['hover', true, false];
}
>;
doubleClick: Attr<
false | 'reset' | 'autosize' | 'reset+autosize',
{
description: 'What double-clicking the plot area does.';
dflt: 'reset+autosize';
values: readonly [false, 'reset', 'autosize', 'reset+autosize'];
}
>;
doubleClickDelay: Attr<
number,
{
description: 'Maximum delay between two clicks of a double-click, in milliseconds.';
dflt: 300;
min: 0;
}
>;
editable: Attr<
boolean,
{
description: 'Make titles, legend, annotations and shapes editable in place (E6.7).';
dflt: false;
}
>;
edits: ObjectNode<{
annotationPosition: Attr<
boolean,
{
description: 'Drag annotations.';
dflt: false;
}
>;
annotationTail: Attr<
boolean,
{
description: 'Drag annotation arrow tails.';
dflt: false;
}
>;
annotationText: Attr<
boolean,
{
description: 'Edit annotation text.';
dflt: false;
}
>;
axisTitleText: Attr<
boolean,
{
description: 'Edit axis titles.';
dflt: false;
}
>;
colorbarPosition: Attr<
boolean,
{
description: 'Drag colorbars.';
dflt: false;
}
>;
colorbarTitleText: Attr<
boolean,
{
description: 'Edit colorbar titles.';
dflt: false;
}
>;
legendPosition: Attr<
boolean,
{
description: 'Drag the legend.';
dflt: false;
}
>;
legendText: Attr<
boolean,
{
description: 'Edit trace names in the legend.';
dflt: false;
}
>;
shapePosition: Attr<
boolean,
{
description: 'Drag and resize shapes.';
dflt: false;
}
>;
titleText: Attr<
boolean,
{
description: 'Edit the figure title.';
dflt: false;
}
>;
}>;
hoverRenderer: Attr<
'dom',
{
description: 'How hover labels render. Only `dom` (positioned HTML over the canvas) exists in M1; a WebGL label renderer is planned (E5.7).';
dflt: 'dom';
values: readonly ['dom'];
}
>;
locale: Attr<
string,
{
description: "Locale of UI strings and number and date formats, e.g. `'de'` or `'de-CH'` (which falls back to `de`, then English). Locales come from `locales` or `register()` (`@mk7s/holochart-locales` ships plotly.js's).";
dflt: 'en-US';
noBlank: true;
}
>;
locales: AttrSpec<unknown, unknown>;
maxPixelRatio: Attr<
number,
{
description: 'Upper limit of the pixel ratio that `pixelRatio: "auto"` takes from the display. Raise it for sharper output on 3× screens, at the cost of drawing more pixels.';
dflt: 2;
max: 8;
min: 0.25;
}
>;
modeBarButtonsToAdd: AttrSpec<unknown, unknown>;
modeBarButtonsToRemove: AttrSpec<string[], string[]>;
pixelRatio: Attr<
number | 'auto',
{
description: 'Renderer pixel ratio. `auto` uses `window.devicePixelRatio`, up to `maxPixelRatio`.';
dflt: 'auto';
extras: readonly ['auto'];
max: 8;
min: 0.25;
}
>;
powerPreference: Attr<
'default' | 'high-performance' | 'low-power',
{
description: 'WebGL context power preference hint.';
dflt: 'default';
values: readonly ['default', 'high-performance', 'low-power'];
}
>;
renderHover: AttrSpec<AnyFunction, AnyFunction | undefined>;
responsive: Attr<
boolean,
{
description: 'Resize the chart when its container or the window resizes.';
dflt: false;
}
>;
scrollZoom: Attr<
| boolean
| 'cartesian'
| 'scene'
| 'geo'
| 'map'
| `cartesian+${string}`
| `scene+${string}`
| `geo+${string}`
| `map+${string}`,
{
description: 'Which subplot kinds zoom on mouse wheel. `true`/`false` enable/disable all of them.';
dflt: 'scene+geo+map';
extras: readonly [true, false];
flags: readonly ['cartesian', 'scene', 'geo', 'map'];
}
>;
sharedRenderer: Attr<
boolean | 'auto',
{
description: 'Draw through one WebGL context shared by every chart on the page instead of a context per chart (browsers keep about 16, fewer on mobile). `auto` gives the first 4 charts a context of their own and shares for the rest. `false` always takes a context.';
dflt: 'auto';
values: readonly ['auto', true, false];
}
>;
staticPlot: Attr<
boolean,
{
description: 'Render once with no interactivity (no hover, zoom or modebar).';
dflt: false;
}
>;
strict: Attr<
boolean,
{
description: 'Throw on the first validation error instead of warning (once per attribute path).';
dflt: false;
}
>;
textRenderer: Attr<
'dom' | 'webgl',
{
description: 'Render text as WebGL SDF glyphs or as a DOM overlay (ADR-005).';
dflt: 'webgl';
values: readonly ['webgl', 'dom'];
}
>;
toImageButtonOptions: ObjectNode<{
filename: Attr<
string,
{
description: 'File name.';
dflt: 'newplot';
noBlank: true;
}
>;
format: Attr<
'png' | 'jpeg' | 'webp',
{
description: 'Image format.';
dflt: 'png';
values: readonly ['png', 'jpeg', 'webp'];
}
>;
height: Attr<
number,
{
description: 'Height in CSS pixels (defaults to the chart).';
min: 1;
}
>;
scale: Attr<
number,
{
description: 'Resolution multiplier.';
dflt: 1;
min: 0;
}
>;
width: Attr<
number,
{
description: 'Width in CSS pixels (defaults to the chart).';
min: 1;
}
>;
}>;
topojsonURL: Attr<
string,
{
description: string;
dflt: '';
}
>;
worker: Attr<
boolean | 'auto',
{
description: 'Run the calc stage in a Web Worker (ADR-011). `auto` switches on above a data-size threshold.';
dflt: false;
values: readonly [true, false, 'auto'];
}
>;
}>;Experimental
The config schema.