UNPKG

@argdown/map-views

Version:

Browser-based map views for Argdown data using dagre-d3 and viz.js

32 lines (31 loc) 1.33 kB
import { IMapState } from "./IMapState"; import { ZoomBehavior } from "d3-zoom"; import { Selection } from "d3-selection"; export declare type OnZoomChangedHandler = (data: { size: { width: number; height: number; }; scale: number; position: { x: number; y: number; }; }) => void; export declare class ZoomManager { zoom?: ZoomBehavior<SVGSVGElement, {}>; svg?: Selection<SVGSVGElement, {}, null | HTMLElement, any>; svgGraph?: Selection<SVGGraphicsElement, {}, null | HTMLElement, any>; state: IMapState; moveToDuration: number; onZoomChanged?: OnZoomChangedHandler; graphIsBottomAligned: boolean; constructor(onZoomChanged?: OnZoomChangedHandler, graphIsBottomAligned?: boolean, moveToDuration?: number); init(svg: Selection<SVGSVGElement, any, null | HTMLElement, any>, svgGraph: Selection<SVGGraphicsElement, any, null | HTMLElement, any>, width: number, height: number): void; showAllAndCenterMap(): void; resetZoom(): void; moveTo(x: number, y: number): void; moveToElement(element: SVGGraphicsElement): void; setZoom: (x: number, y: number, scale: number, duration: number) => void; } export declare const convertCoordsL2L: (svg: SVGSVGElement, fromElem: SVGGraphicsElement, toElem: SVGGraphicsElement) => DOMPoint;