View as Markdown

API reference: @salmonui/charts/gauge

Gaugecomponent

import { Gauge } from '@salmonui/charts/gauge';
function Gauge(props: GaugeProps): ReactNode;

Props: GaugeProps

Gauge props (29)
NameSignatureDescription
shapeoptionalreadonly shape?: GaugeShape | undefined;
orientationoptionalreadonly orientation?: 'horizontal' | 'vertical' | undefined;

Linear gauges: default 'horizontal'.

containeroptionalreadonly container?: GaugeContainer | undefined;

Linear gauges: the track drawn behind pointers (default 'normal').

axesoptionalreadonly axes?: readonly GaugeAxis[] | undefined;

Axes (default one axis 0 to 100); or GaugeAxis children, read when axes is absent.

pointersoptionalreadonly pointers?: readonly GaugePointer[] | undefined;

Pointers; or GaugePointer children, read when pointers is absent.

childrenoptionalreadonly children?: ReactNode;

GaugeAxis and GaugePointer elements (the JSX form of axes and pointers).

widthoptionalreadonly width?: number | undefined;

Drawing size in px; the SVG scales to its container through viewBox.

heightoptionalreadonly height?: number | undefined;
centeroptionalreadonly center?: readonly [ number, number ] | undefined;

Circular center as fractions of the drawing (default [0.5, 0.5]).

rangeGapoptionalreadonly rangeGap?: number | undefined;

Gap between the axis line and inside ranges, in px (default 0).

titleoptionalreadonly title?: string | undefined;
subtitleoptionalreadonly subtitle?: string | undefined;
descriptionoptionalreadonly description?: string | undefined;

Replaces the automatic summary.

localeoptionalreadonly locale?: string | undefined;
textoptionalreadonly text?: Partial<GaugeText> | undefined;

Built-in text (over the nearest LocaleProvider's gauge entry).

paletteoptionalreadonly palette?: readonly string[] | undefined;

Data colors for ranges without a color.

legendoptionalreadonly legend?: boolean | GaugeLegendOptions | undefined;

Range legend.

hiddenRangesoptionalreadonly hiddenRanges?: readonly string[] | undefined;
defaultHiddenRangesoptionalreadonly defaultHiddenRanges?: readonly string[] | undefined;
onHiddenRangesChangeoptionalreadonly onHiddenRangesChange?: ((ids: readonly string[], event: GaugeChangeEvent) => void) | undefined;
tooltipoptionalreadonly tooltip?: boolean | { readonly targets?: readonly GaugeTooltipTarget[] | undefined; readonly render?: ((ctx: GaugeTooltipContext) => ReactNode) | undefined; } | undefined;
onPointerValueChangeoptionalreadonly onPointerValueChange?: ((change: GaugePointerValueChange, event: GaugeChangeEvent) => void) | undefined;

Called during a drag and per keyboard step with the proposed value.

onPointerValueCommitoptionalreadonly onPointerValueCommit?: ((change: GaugePointerValueChange, event: GaugeChangeEvent) => void) | undefined;

Called on release (and per keyboard step).

onRangeChangeoptionalreadonly onRangeChange?: ((change: GaugeRangeChange, event: GaugeChangeEvent) => void) | undefined;

A draggable range end moved (drag frames, release, keyboard steps); ranges are reactive props, so apply it.

animatedoptionalreadonly animated?: boolean | undefined;

Pointer entrance and update transition after hydration (default true); off under prefers-reduced-motion.

showDataTableoptionalreadonly showDataTable?: boolean | undefined;

Shows the accessible data table under the gauge.

classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;
refoptionalreadonly ref?: Ref<GaugeApi> | undefined;