UNPKG

@uwdata/mosaic-sql

Version:

SQL query construction and analysis.

37 lines 1.33 kB
import type { ExprNode } from '../ast/node.js'; import type { ExprValue } from '../types.js'; import { Scale } from './scales.js'; export interface BinHistogramOptions { /** An exact binning step to use. */ step?: number; /** * The desired number of binning steps. This value is a hint, * it does not guarantee an exact number of steps. */ steps?: number; /** * A minimum binning step value. No generated * step can be less than this value. */ minstep?: number; /** * A boolean flag (default true) indicating if bin extents should be * snapped to "nice" numbers such as multiples of 5 or 10. */ nice?: boolean; /** * The number of bin steps (default 0) by which to offset the result. */ offset?: number; } /** * Return a SQL expression for histogram bins. * @param field The column or expression to bin. * @param extent The min/max extent over which to bin. * @param options Binning options. * @param transform Scale transforms to apply to create * (potentially non-linear) binning intervals. * @returns The resulting SQL expression */ export declare function binHistogram(field: ExprValue, extent: [number, number], options?: BinHistogramOptions, transform?: Scale<number>): ExprNode; //# sourceMappingURL=bin-histogram.d.ts.map