API reference: @salmonui/charts/gauge
Gaugecomponent
import { Gauge } from '@salmonui/charts/gauge';function Gauge(props: GaugeProps): ReactNode;
Props: GaugeProps
| Name | Signature | Description |
|---|---|---|
shapeoptional | readonly shape?: GaugeShape | undefined; | |
orientationoptional | readonly orientation?: 'horizontal' | 'vertical' | undefined; | Linear gauges: default |
containeroptional | readonly container?: GaugeContainer | undefined; | Linear gauges: the track drawn behind pointers (default |
axesoptional | readonly axes?: readonly GaugeAxis[] | undefined; | Axes (default one axis 0 to 100); or |
pointersoptional | readonly pointers?: readonly GaugePointer[] | undefined; | Pointers; or |
childrenoptional | readonly children?: ReactNode; |
|
widthoptional | readonly width?: number | undefined; | Drawing size in px; the SVG scales to its container through |
heightoptional | readonly height?: number | undefined; | |
centeroptional | readonly center?: readonly [
number,
number
] | undefined; | Circular center as fractions of the drawing (default |
rangeGapoptional | readonly rangeGap?: number | undefined; | Gap between the axis line and inside ranges, in px (default 0). |
titleoptional | readonly title?: string | undefined; | |
subtitleoptional | readonly subtitle?: string | undefined; | |
descriptionoptional | readonly description?: string | undefined; | Replaces the automatic summary. |
localeoptional | readonly locale?: string | undefined; | |
textoptional | readonly text?: Partial<GaugeText> | undefined; | Built-in text (over the nearest |
paletteoptional | readonly palette?: readonly string[] | undefined; | Data colors for ranges without a color. |
legendoptional | readonly legend?: boolean | GaugeLegendOptions | undefined; | Range legend. |
hiddenRangesoptional | readonly hiddenRanges?: readonly string[] | undefined; | |
defaultHiddenRangesoptional | readonly defaultHiddenRanges?: readonly string[] | undefined; | |
onHiddenRangesChangeoptional | readonly onHiddenRangesChange?: ((ids: readonly string[], event: GaugeChangeEvent) => void) | undefined; | |
tooltipoptional | readonly tooltip?: boolean | {
readonly targets?: readonly GaugeTooltipTarget[] | undefined;
readonly render?: ((ctx: GaugeTooltipContext) => ReactNode) | undefined;
} | undefined; | |
onPointerValueChangeoptional | readonly onPointerValueChange?: ((change: GaugePointerValueChange, event: GaugeChangeEvent) => void) | undefined; | Called during a drag and per keyboard step with the proposed value. |
onPointerValueCommitoptional | readonly onPointerValueCommit?: ((change: GaugePointerValueChange, event: GaugeChangeEvent) => void) | undefined; | Called on release (and per keyboard step). |
onRangeChangeoptional | readonly onRangeChange?: ((change: GaugeRangeChange, event: GaugeChangeEvent) => void) | undefined; | A draggable range end moved (drag frames, release, keyboard steps); ranges are reactive props, so apply it. |
animatedoptional | readonly animated?: boolean | undefined; | Pointer entrance and update transition after hydration (default true); off under |
showDataTableoptional | readonly showDataTable?: boolean | undefined; | Shows the accessible data table under the gauge. |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
refoptional | readonly ref?: Ref<GaugeApi> | undefined; |