Axis
The axis module supplies axes to the visualizers and are essential for almost all Specviz applications. See the Basic Spectrogram demo for guidance.
Components
const Provider: React.Provider<Context>
function Horizontal(props: AxisProps): JSX.Element
function Vertical(props: AxisProps): JSX.Element
Functions
function linear(
min: number,
max: number,
unit = "units",
format: Format.FormatFn = String,
): Axis
function nonlinear(
units: number[],
unit = "units",
format: Format.FormatFn = String,
): Axis
function time(
min: number,
max: number,
unit = "seconds",
format: Format.FormatFn = Format.timestamp,
): Axis
function frequency(
min: number,
max: number,
unit = "hertz",
format: Format.FormatFn = Format.hz,
): Axis
function percent(
min: number,
max: number,
unit = "percent",
format: Format.FormatFn = Format.percent,
): Axis
function useContext(): Context
Types
type Axis = {
format: Format.FormatFn
invert: boolean
max: number
min: number
stops: [number, number][]
unit: string
}
type AxisProps = {
tickHeight?: number
tickWidth?: number
}
type Context = Record<string, undefined | Axis>