UNPKG

@uwdata/mosaic-sql

Version:

SQL query construction and analysis.

24 lines 1.48 kB
import type { ExprValue } from '../types.js'; import { type SelectQuery } from '../ast/query.js'; /** * Compute line segment densities over a gridded 2D domain. The returned * query uses multiple subqueries (CTEs) to identify line segment end point * pairs, perform line rasterization in-database, normalize arc lengths, * and then sum results for all line series to produce a density map. * Based on Moritz and Fisher's work: https://arxiv.org/abs/1808.06019 * @param q The base query over the data. * @param x Bin expression for x dimension. * Provides gridded x coordinates, potentially with a fractional component. * @param y Bin expression for x dimension. * Provides gridded y coordinates, potentially with a fractional component. * @param z Group by columns that segment data into individual line * series. An empty array indicates there is only a single line series. * @param xn The number of grid bins for the x dimension. * @param yn The number of grid bins for the y dimension. * @param groupby Additional group by expressions. Separate * line density maps are created for each of these groups. * @param normalize Flag toggling approximate arc-length normalization to * improve accuracy and reduce artifacts (default `true`). */ export declare function lineDensity(q: SelectQuery, x: ExprValue, y: ExprValue, z: string[], xn: number, yn: number, groupby?: string[], normalize?: boolean): SelectQuery; //# sourceMappingURL=line-density.d.ts.map