/** How far out the view zooms: far enough to show the shape of a graph of thousands of jobs. */ export declare const MIN_SCALE = 0.01; /** How far in the view zooms, past where a fit stops, to read a node up close. */ export declare const MAX_SCALE = 2; /** The closest a fit comes, where a small graph's nodes read at a comfortable size. */ export declare const FIT_MAX_SCALE = 0.6; /** An exponent of the scale, so presses in and out change it by the same factor. */ export declare const ZOOM_STEP = 0.25; export interface View { x: number; y: number; scale: number; } export interface Bounds { minX: number; minY: number; maxX: number; maxY: number; } /** The way the view can zoom no further, if it is at a limit. */ export declare function zoomLimit(scale: number): 'in' | 'out' | null; /** The view scaled by `factor` about `at`, a point in the panel, which stays where it is. */ export declare function zoomAround(view: View, at: { x: number; y: number; }, factor: number): View; /** The factor a wheel event scales the view by, the same at every zoom. */ export declare function wheelFactor(event: Pick): number; /** The space a fit leaves around a graph in a panel. */ export declare function fitMargin(panel: { width: number; height: number; }): number; /** How a fit may differ from showing everything. */ export interface FitOptions { /** The farthest out it goes: a graph too big to read at this scale shows from its start, * its top left, for the rest to be panned to. */ minScale?: number | undefined; /** Room kept clear at the panel's top, such as under a bar over it, when the fit stops at * `minScale`. */ top?: number | undefined; /** Fits the graph's width alone, for one that runs down the panel to be panned along: centered * across the panel, from its top below `top`. */ width?: boolean | undefined; /** Room kept clear at the panel's top at any scale, such as under buttons over a small panel: * the graph fits in the rest. */ clear?: number | undefined; /** Centers a graph that fits in the room left, for a panel that doesn't shrink to its graph. */ center?: boolean | undefined; /** The height of a panel once it shrinks to its graph, which sets the margin in its place. */ settledHeight?: number | undefined; } /** The view that shows all of `bounds` in a panel from its top left, no closer than a fit comes. */ export declare function fitView(bounds: Bounds, panel: { width: number; height: number; }, { minScale, top, width: byWidth, clear, center, settledHeight, }?: FitOptions): View | null; /** A still graph's view, its width across the panel's and no taller than `maxHeight`, centered * across with `padding` around it, and the height of the panel it leaves: the graph's at that * view. */ export declare function fitStill(bounds: Bounds, width: number, maxHeight: number, padding?: number): { view: View; height: number; } | null; /** The first fit of a panel that then shrinks to its graph: from the corner of the panel as it * will be, so the graph stays where it first shows. `heightAt` is the panel's height after it * shrinks to the graph at a view. */ export declare function fitShrinking(bounds: Bounds, panel: { width: number; height: number; }, heightAt: (view: View) => number, options?: FitOptions): View | null; /** The least shift that brings [start, end] inside [low, high]; none when it can't all fit, so the view stays. */ export declare function intoView(start: number, end: number, low: number, high: number): number; /** How much of a graph a pan or pinch leaves in its panel, at the least: half the panel's shorter * side, or all of a graph smaller than that. */ export declare function reachKept(panel: { width: number; height: number; }): number; /** The least shift that brings at least `keep` of `graph` back inside `panel` on each axis, so a * pan or a fling never leaves the graph out of reach; none while that much already shows. */ export declare function intoReach(graph: Rect, panel: Rect, keep: number): { dx: number; dy: number; }; /** A box on screen, as `getBoundingClientRect` gives it. */ export interface Rect { left: number; top: number; width: number; height: number; } /** The smallest box around all of `rects`, which must not be empty. */ export declare function enclosing(rects: readonly Rect[]): Rect; /** * The view that shows `region`, a job or step and what it is in, in `visible`, zoomed in to `readable` * if it is further out: all of it in the middle where it fits, or else `target`, a part of it, with as * much of the rest before it as fits. None while all of it already shows, readable. Boxes are on screen, * and a view's x and y count from `origin`, where the pan and zoom place the graph. */ export declare function viewShowing(region: Rect, target: Rect, visible: Rect, origin: { left: number; top: number; }, view: View, readable: number): View | null;