@uwdata/mosaic-plot
Version:
A Mosaic-powered plotting framework based on Observable Plot.
62 lines • 2.66 kB
TypeScript
/**
* @typedef {Array | Int8Array | Uint8Array | Uint8ClampedArray
* | Int16Array | Uint16Array | Int32Array | Uint32Array
* | Float32Array | Float64Array
* } Arrayish - an Array or TypedArray
*/
/**
* Generate a new array with designated size and type.
* @param {number} size The size of the array
* @param {Arrayish} [proto] A prototype object of the desired array type.
* This may be a typed array or standard array (the default).
* @returns {Arrayish} The generated array.
*/
export function array(size: number, proto?: Arrayish): Arrayish;
/**
* Create a 1D grid for the given sample values
* @param {number} size The grid size.
* @param {Arrayish} index The grid indices for sample points.
* @param {Arrayish} value The sample point values.
* @param {Record<string,Arrayish>} columns Named column arrays with groupby values.
* @param {string[]} groupby The names of columns to group by.
* @returns {{
* numRows: number;
* columns: { [key:string]: Arrayish }
* }} Named column arrays of generated grid values.
*/
export function grid1d(size: number, index: Arrayish, value: Arrayish, columns: Record<string, Arrayish>, groupby: string[]): {
numRows: number;
columns: {
[key: string]: Arrayish;
};
};
/**
* Create a 2D grid for the given sample values.
* Can handle multiple grids and groupby values per output row.
* @param {number} w The grid width.
* @param {number} h The grid height.
* @param {Arrayish} index The grid indices for sample points.
* An index value is an integer of the form (y * w + x).
* @param {Record<string,Arrayish>} columns Named column arrays with sample point values.
* @param {string[]} aggregates The names of aggregate columns to grid.
* @param {string[]} groupby The names of additional columns to group by.
* @param {function} [interpolate] A grid interpolation function.
* By default sample values are directly copied to output grid arrays.
* @returns {{
* numRows: number;
* columns: { [key:string]: Arrayish }
* }} Named column arrays of generated grid values.
*/
export function grid2d(w: number, h: number, index: Arrayish, columns: Record<string, Arrayish>, aggregates: string[], groupby: string[], interpolate?: Function): {
numRows: number;
columns: {
[key: string]: Arrayish;
};
};
export function gridDomainContinuous(grids: any): number[];
export function gridDomainDiscrete(grids: any): any[];
/**
* - an Array or TypedArray
*/
export type Arrayish = any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
//# sourceMappingURL=grid.d.ts.map