View as Markdown

API reference: @salmonui/charts/pie-chart

AccumulationBasePropsinterface

import type { AccumulationBaseProps } from '@salmonui/charts/pie-chart';
interface AccumulationBaseProps {
    readonly data?: readonly unknown[] | undefined;
    readonly valueField?: string | undefined;
    readonly labelField?: string | undefined;
    readonly colorField?: string | undefined;
    readonly palette?: readonly string[] | undefined;
    readonly patterns?: boolean | undefined;
    readonly emptyPoints?: 'drop' | 'zero' | 'average' | undefined;
    readonly width?: number | undefined;
    readonly height?: number | undefined;
    readonly title?: string | undefined;
    readonly subtitle?: string | undefined;
    readonly description?: string | undefined;
    readonly locale?: string | undefined;
    readonly format?: Intl.NumberFormatOptions | ((value: number) => string) | undefined;
    readonly legend?: boolean | AccumulationLegendOptions | undefined;
    readonly tooltip?: boolean | AccumulationTooltipOptions | undefined;
    readonly highlight?: boolean | undefined;
    readonly selection?: boolean | {
        readonly multiple?: boolean | undefined;
    } | undefined;
    readonly hiddenPoints?: readonly number[] | undefined;
    readonly defaultHiddenPoints?: readonly number[] | undefined;
    readonly onHiddenPointsChange?: ((hidden: readonly number[], event: AccumulationChangeEvent) => void) | undefined;
    readonly selectedPoints?: readonly AccumulationPointRef[] | undefined;
    readonly defaultSelectedPoints?: readonly AccumulationPointRef[] | undefined;
    readonly onSelectedPointsChange?: ((selected: readonly AccumulationPointRef[], event: AccumulationChangeEvent) => void) | undefined;
    readonly annotations?: readonly AccumulationAnnotation[] | undefined;
    readonly getPointStyle?: ((point: AccumulationPoint) => AccumulationPointStyle | undefined) | undefined;
    readonly formatLabel?: ((point: AccumulationPoint) => string) | undefined;
    readonly onPointClick?: ((point: AccumulationPoint, event: AccumulationChangeEvent) => void) | undefined;
    readonly onPointHover?: ((point: AccumulationPoint | null) => void) | undefined;
    readonly showDataTable?: boolean | undefined;
    readonly accessibleTable?: boolean | undefined;
    readonly renderEmpty?: (() => ReactNode) | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly id?: string | undefined;
    readonly ref?: Ref<AccumulationApi> | undefined;
    readonly onResize?: ((size: {
        readonly width: number;
        readonly height: number;
    }) => void) | undefined;
    readonly animated?: boolean | undefined;
}
AccumulationBaseProps members (38)
NameSignatureDescription
dataoptionalreadonly data?: readonly unknown[] | undefined;

Records, or numbers (labels then default to "1", "2", ...).

valueFieldoptionalreadonly valueField?: string | undefined;
labelFieldoptionalreadonly labelField?: string | undefined;
colorFieldoptionalreadonly colorField?: string | undefined;

Record field holding a data color (pointColorMapping).

paletteoptionalreadonly palette?: readonly string[] | undefined;

Data colors by point index; default the derived --salmon-chart-* palette.

patternsoptionalreadonly patterns?: boolean | undefined;

Overlay one system fill pattern per palette slot (non-color encoding).

emptyPointsoptionalreadonly emptyPoints?: 'drop' | 'zero' | 'average' | undefined;
widthoptionalreadonly width?: number | undefined;
heightoptionalreadonly height?: number | undefined;
titleoptionalreadonly title?: string | undefined;
subtitleoptionalreadonly subtitle?: string | undefined;
descriptionoptionalreadonly description?: string | undefined;

Accessible description; default the automatic summary.

localeoptionalreadonly locale?: string | undefined;
formatoptionalreadonly format?: Intl.NumberFormatOptions | ((value: number) => string) | undefined;
legendoptionalreadonly legend?: boolean | AccumulationLegendOptions | undefined;
tooltipoptionalreadonly tooltip?: boolean | AccumulationTooltipOptions | undefined;
highlightoptionalreadonly highlight?: boolean | undefined;

Dim the other points while one is hovered or focused. Default true.

selectionoptionalreadonly selection?: boolean | { readonly multiple?: boolean | undefined; } | undefined;

Click and Enter select points.

hiddenPointsoptionalreadonly hiddenPoints?: readonly number[] | undefined;
defaultHiddenPointsoptionalreadonly defaultHiddenPoints?: readonly number[] | undefined;
onHiddenPointsChangeoptionalreadonly onHiddenPointsChange?: ((hidden: readonly number[], event: AccumulationChangeEvent) => void) | undefined;
selectedPointsoptionalreadonly selectedPoints?: readonly AccumulationPointRef[] | undefined;
defaultSelectedPointsoptionalreadonly defaultSelectedPoints?: readonly AccumulationPointRef[] | undefined;
onSelectedPointsChangeoptionalreadonly onSelectedPointsChange?: ((selected: readonly AccumulationPointRef[], event: AccumulationChangeEvent) => void) | undefined;
annotationsoptionalreadonly annotations?: readonly AccumulationAnnotation[] | undefined;
getPointStyleoptionalreadonly getPointStyle?: ((point: AccumulationPoint) => AccumulationPointStyle | undefined) | undefined;
formatLabeloptionalreadonly formatLabel?: ((point: AccumulationPoint) => string) | undefined;
onPointClickoptionalreadonly onPointClick?: ((point: AccumulationPoint, event: AccumulationChangeEvent) => void) | undefined;
onPointHoveroptionalreadonly onPointHover?: ((point: AccumulationPoint | null) => void) | undefined;
showDataTableoptionalreadonly showDataTable?: boolean | undefined;

Visible accessible data table (showDataTable).

accessibleTableoptionalreadonly accessibleTable?: boolean | undefined;

false leaves the visually hidden data table out.

renderEmptyoptionalreadonly renderEmpty?: (() => ReactNode) | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;
idoptionalreadonly id?: string | undefined;
refoptionalreadonly ref?: Ref<AccumulationApi> | undefined;
onResizeoptionalreadonly onResize?: ((size: { readonly width: number; readonly height: number; }) => void) | undefined;
animatedoptionalreadonly animated?: boolean | undefined;

Entrance and update transitions, default true: client only (never in server markup), off under prefers-reduced-motion. The CSS is the opt-in @salmonui/charts/viz-animations.css.