import { color, scale, text } from '@synnaxlabs/x'; import { z } from 'zod'; import { aether } from '../../../aether/aether'; import { telem } from '../../../telem/aether'; import { theming } from '../../../theming/aether'; import { Tick, TickFactory } from '../../axis/ticks'; import { Element } from '../../diagram/aether/Diagram'; import { render } from '../../render'; import { staleness } from '../../staleness/aether'; export declare const scaleStateZ: z.ZodObject<{ stalenessTimeout: z.ZodDefault; box: z.ZodObject<{ one: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; two: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; root: z.ZodObject<{ x: z.ZodEnum<{ left: "left"; right: "right"; }>; y: z.ZodEnum<{ top: "top"; bottom: "bottom"; }>; }, z.core.$strip>; }, z.core.$strip>; telem: z.ZodDefault>>; variant: z.ZodLiteral<"source">; valueType: z.ZodLiteral<"number">; }, z.core.$strip>>; bounds: z.ZodDefault>; upper: z.ZodNumber | z.ZodType>; }, z.core.$strip>>; color: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; axisColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; textColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; direction: z.ZodDefault>; showFill: z.ZodDefault; showCaret: z.ZodDefault; showScale: z.ZodDefault; side: z.ZodDefault>; caretSide: z.ZodDefault>; units: z.ZodDefault; stalenessColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; notation: z.ZodDefault>; precision: z.ZodDefault; externalScale: z.ZodDefault; borderRadius: z.ZodDefault; cornerRadii: z.ZodOptional; topRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomLeft: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; }, z.core.$strip>>; level: z.ZodDefault>; }, z.core.$strip>; /** * Pixels reserved alongside the bar for the ticks and their labels. A symbol sizing * itself around a scale takes this on top of the bar it wants. */ export declare const gutter: ({ showScale, externalScale, }: { showScale: boolean; externalScale?: boolean; }) => number; interface InternalState { theme: theming.Theme; render: render.Context; telem: telem.NumberSource; staleness: staleness.Registration; stale: boolean; stopListening?: () => void; requestRender: render.Requestor | null; fillColor: color.Color; axisColor: color.Color; textColor: color.Color; tickFactory: TickFactory; minorTickFactory: TickFactory; ticks: Tick[]; minorTicks: Tick[]; tickLevel: text.Level; } export declare class Scale extends aether.Leaf implements Element { static readonly TYPE = "scale"; static readonly z: z.ZodObject<{ stalenessTimeout: z.ZodDefault; box: z.ZodObject<{ one: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; two: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; root: z.ZodObject<{ x: z.ZodEnum<{ left: "left"; right: "right"; }>; y: z.ZodEnum<{ top: "top"; bottom: "bottom"; }>; }, z.core.$strip>; }, z.core.$strip>; telem: z.ZodDefault>>; variant: z.ZodLiteral<"source">; valueType: z.ZodLiteral<"number">; }, z.core.$strip>>; bounds: z.ZodDefault>; upper: z.ZodNumber | z.ZodType>; }, z.core.$strip>>; color: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; axisColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; textColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; direction: z.ZodDefault>; showFill: z.ZodDefault; showCaret: z.ZodDefault; showScale: z.ZodDefault; side: z.ZodDefault>; caretSide: z.ZodDefault>; units: z.ZodDefault; stalenessColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; notation: z.ZodDefault>; precision: z.ZodDefault; externalScale: z.ZodDefault; borderRadius: z.ZodDefault; cornerRadii: z.ZodOptional; topRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomLeft: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; }, z.core.$strip>>; level: z.ZodDefault>; }, z.core.$strip>; schema: z.ZodObject<{ stalenessTimeout: z.ZodDefault; box: z.ZodObject<{ one: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; two: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; root: z.ZodObject<{ x: z.ZodEnum<{ left: "left"; right: "right"; }>; y: z.ZodEnum<{ top: "top"; bottom: "bottom"; }>; }, z.core.$strip>; }, z.core.$strip>; telem: z.ZodDefault>>; variant: z.ZodLiteral<"source">; valueType: z.ZodLiteral<"number">; }, z.core.$strip>>; bounds: z.ZodDefault>; upper: z.ZodNumber | z.ZodType>; }, z.core.$strip>>; color: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; axisColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; textColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; direction: z.ZodDefault>; showFill: z.ZodDefault; showCaret: z.ZodDefault; showScale: z.ZodDefault; side: z.ZodDefault>; caretSide: z.ZodDefault>; units: z.ZodDefault; stalenessColor: z.ZodDefault, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodNumber], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodNumber; }, z.core.$strip>, z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>, z.ZodObject<{ rgba255: z.ZodTuple<[z.ZodInt, z.ZodInt, z.ZodInt, z.ZodPipe>], null>; }, z.core.$strip>, z.ZodObject<{ r: z.ZodInt; g: z.ZodInt; b: z.ZodInt; a: z.ZodPipe>; }, z.core.$strip>]>, z.ZodTransform<[number, number, number, number], string | [number, number, number] | [number, number, number, number] | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; } | { rgba255: [number, number, number, number]; } | { r: number; g: number; b: number; a: number; }>>>; notation: z.ZodDefault>; precision: z.ZodDefault; externalScale: z.ZodDefault; borderRadius: z.ZodDefault; cornerRadii: z.ZodOptional; topRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomLeft: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; bottomRight: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; }, z.core.$strip>>; level: z.ZodDefault>; }, z.core.$strip>; afterUpdate(ctx: aether.Context): void; afterDelete(): void; private requestRender; /** Length of the bar along the value axis in pixels. */ private get alongLength(); /** * The side the ticks sit on. A side parallel to the bar has no room for them, so it * moves to the matching side of the other axis. */ private get side(); /** The axis the readout is offset on. */ private get caretAxis(); /** True when the readout is offset along the bar rather than across it. */ private get caretAlongBar(); /** -1 when the fill grows up the screen, 1 when it grows right. */ private get fillGrowth(); /** Screen coordinate of the bar edge the fill grows from. */ private zeroEdge; /** Screen coordinate a pixel distance along the value axis from the zero edge. */ private alongCoord; /** Maps a point in bar space (along the value axis, then across) to the screen. */ private point; /** True when the bar is outlined. A caller drawing its own container passes false. */ private get showTrack(); /** -1 when the side points left or up of the bar, 1 when it points right or down. */ private outwardOf; /** The region occupied by the bar (fill + track), excluding the scale gutter. */ private get barRegion(); /** * Coordinate of the given side of the bar, where the ticks or the caret sit. In * external mode it is anchored to the outer box edge plus a gap so the scale reads as * its own axis clear of the container; otherwise it sits at the bar edge. */ private edgeOf; render({ viewportScale }: { viewportScale?: scale.XY | undefined; }): void; private renderFill; /** * Color of the parts that carry the value: the fill, the caret, and the readout. It * turns to the staleness color once the source stops sending. */ private get valueColor(); /** * Color of the caret. A caret offset toward the origin sits on the fill, so it takes * the readout's background to stay legible against it. */ private get caretColor(); /** The caret readout. Empty when the source has no value yet. */ private valueText; /** * Draws a caret at the value with an altimeter-style readout box beyond it. The caret * sits against the bar edge it is offset from, or on the bar's center line when it is * offset along the bar and so has no edge to sit against. */ private renderValue; /** * Fills a triangle with its point at tip, opening away from it along the axis the * readout is offset on, so the caret always aims back at the value. */ private drawCaret; /** * Places the readout just beyond the caret and centered on it. A readout offset along * the bar is held inside it so a value near either end stays legible. */ private valueBoxRegion; private renderValueBox; /** Screen coordinate of the value along the value axis. */ private valuePosition; private renderTicks; } export declare const REGISTRY: aether.ComponentRegistry; export {}; //# sourceMappingURL=scale.d.ts.map