import { type FieldInstance, type Row, type Value } from './types'; import { type ScaleType } from './warp'; /** * What a field on size or opacity spans. A dimension has members, ranked in value order; a * continuous field has a range. Both come from the complete result, like an axis range. */ export interface ChannelScale { field: FieldInstance; members?: Value[]; domain?: [number, number]; type?: ScaleType; /** An end of the range was set by hand; a size then no longer measures from zero on its own. */ fixed?: boolean; /** What the lowest and the highest level turn into, in place of the built-in steps. */ range?: [number, number]; } /** One block of the legend strip: a title and what explains one channel. */ export interface LegendBlock { channel: 'color' | 'size' | 'opacity' | 'shape'; title: string; /** 'ramp' is a continuous color band from the first entry to the last; 'list' has one row per entry. */ kind: 'list' | 'ramp'; /** `level` is where the entry sits on its channel, from 0 to 1. */ entries: { label: string; level: number; }[]; /** Height of one row of a list. */ step: number; height: number; } export declare const legendTitleHeight = 28; /** * Where a record sits on a channel, from 0 to 1. NaN when it has no value there. * A member's level is its rank, so the first member is already above zero. A continuous * value is placed in its range; `fromZero` measures it from zero instead when the whole * range is on one side of zero, which is what makes a size read as a quantity. */ export declare function level(scale: ChannelScale, record: Row, fromZero?: boolean): number; export declare function levelOf(scale: ChannelScale, value: number, fromZero?: boolean): number; export declare function memberIndex(scale: ChannelScale, value: Value): number; /** Symbol outlines in the order members take them. They start over when the members outnumber them. */ export declare const shapes: readonly ["circle", "square", "triangle-up", "diamond", "cross", "triangle-down", "triangle-right", "triangle-left"]; /** Area of a point mark at a size level, in square px. */ export declare const pointArea: (t: number) => number; /** Share of the default thickness a bar or the default length a tick takes at a size level. */ export declare const thicknessShare: (t: number) => number; /** Opacity at an opacity level. The faintest mark stays readable. */ export declare const opacityAt: (t: number) => number; /** The value at a level of a range set by hand. */ export declare const inRange: (range: [number, number], t: number) => number;