/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { PlanNestedMonths } from "../root/nested.js"; /** The periods the horizon's bars count by, finest first: a month's counts make none finer. */ export declare const HORIZON_BUCKET_UNITS: readonly ["month", "quarter", "year"]; /** A period the horizon's bars count by. */ export type HorizonBucketUnit = (typeof HORIZON_BUCKET_UNITS)[number]; /** The least a bucket's slot may be on the track, px: what decides the period. */ export declare const HORIZON_BUCKET_MIN_PX = 4; /** A bucket of the horizon: its slot as fractions of the horizon, the period it starts, and what it counts. */ export interface HorizonDensityBucket { /** Its start on the horizon, a fraction: the period's start, or the horizon's where the horizon clips it. */ from: number; /** Its end. */ to: number; /** The period's start (UTC). */ start: Date; /** The items and values of every month starting in it. */ count: number; } /** The horizon's buckets and the period they count by, with the largest count. */ export interface HorizonDensity { /** The period each bucket is. */ unit: HorizonBucketUnit; /** The buckets, in order across the horizon. */ buckets: readonly HorizonDensityBucket[]; /** The largest bucket's count. */ max: number; } /** * The horizon's buckets (#1438): the finest of month, quarter and year whose * buckets keep 4px each on the track — a year where none does — from the * period the horizon begins in to the one it ends in, each clipped to the * horizon, as fractions of it. A bucket counts the items and values of every * month starting in it: a month the horizon clips counts whole, as e3 keeps * no finer count. Counts ignore the window, so the shape stays put as the * window moves. * * @param lo - The horizon's start, ms * @param hi - Its end * @param months - Each month's start and count, in order * @param trackPx - The track's width, px * @returns The buckets; `undefined` with no horizon or no track */ export declare function horizonDensity(lo: number, hi: number, months: PlanNestedMonths, trackPx: number): HorizonDensity | undefined; //# sourceMappingURL=horizon-density.d.ts.map