@uwdata/mosaic-plot
Version:
A Mosaic-powered plotting framework based on Observable Plot.
62 lines • 2.2 kB
TypeScript
/**
* Utility method to generate color and alpha encoding helpers.
* The returned methods can write directly to a pixel raster.
* @param {RasterMark} mark
*/
export function rasterEncoding(mark: RasterMark): {
alphaProp: any;
colorProp: any;
alpha: (data: any, w: any, h: any, grid: any) => void;
color: (data: any, w: any, h: any, grid: any) => void;
};
/**
* Retrieve canvas image data for a 2D raster bitmap.
* The resulting data is cached in the mark.image property.
* If the canvas dimensions change, a new canvas is created.
* @param {RasterMark} mark The mark instance
* @param {number} w The canvas width.
* @param {number} h The canvas height.
* @returns An object with a canvas, context, image data, and dimensions.
*/
export function imageData(mark: RasterMark, w: number, h: number): any;
/**
* Raster image mark. Data is binned to a grid based on the x and y options.
* The grid cells are then colored to form an image.
* The raster grid size defaults to the pixel width/height of the
* plot. The pixelSize option (default 1) changes the grid cell to pixel
* ratio. For example, a pixelSize of 0.5 will create a larger raster
* for higher resolution images on retina displays. The width and height
* options set the grid dimensions directly, overriding other options.
* The raster grid can optionally be smoothed (blurred) by setting
* the bandwidth option.
*/
export class RasterMark extends Grid2DMark {
constructor(source: any, options: any);
image: any;
setPlot(plot: any, index: any): void;
convolve(): this;
rasterize(): this;
plotSpecs(): {
type: any;
data: {
length: number;
};
options: {
src: any;
width: number;
height: number;
preserveAspectRatio: string;
imageRendering: any;
frameAnchor: string;
};
}[];
}
/**
* Density heatmap image.
* This is just a raster mark with default options for
* accurate binning and smoothing for density estimation.
*/
export class HeatmapMark extends RasterMark {
}
import { Grid2DMark } from './Grid2DMark.js';
//# sourceMappingURL=RasterMark.d.ts.map