UNPKG

higlass

Version:

HiGlass Hi-C / genomic / large data viewer

55 lines (54 loc) 2.13 kB
export default setupShowMousePosition; export type MouseTrackOptions = { /** * - Color of the mouse position. */ mousePositionColor?: string | undefined; /** * - Alpha of the mouse position. */ mousePositionAlpha?: number | undefined; }; export type ClassContext = { pForeground?: import("pixi.js").Container | undefined; pMasked?: import("pixi.js").Container | undefined; pMain?: import("pixi.js").Container | undefined; xScale: () => import("../types").Scale; yScale: () => import("../types").Scale; getPosition: () => [number, number]; getDimensions: () => [number, number]; pubSub: import("pub-sub-es").PubSub; pubSubs: Array<import("pub-sub-es").Subscription>; getProp: (prop: "flipText") => () => boolean; options: {}; }; /** * @typedef ClassContext * @property {import('pixi.js').Container=} pForeground * @property {import('pixi.js').Container=} pMasked * @property {import('pixi.js').Container=} pMain * @property {() => import('../types').Scale} xScale * @property {() => import('../types').Scale} yScale * @property {() => [number, number]} getPosition * @property {() => [number, number]} getDimensions * @property {import('pub-sub-es').PubSub} pubSub * @property {Array<import('pub-sub-es').Subscription>} pubSubs * @property {(prop: 'flipText') => () => boolean} getProp * @property {{}} options */ /** * Public API for showing the mouse location. * * @description * This is just a convenience wrapper to avoid code duplication. * `showMousePosition` is the actual function and could be called from within * each class as well. * * @param {ClassContext} context - Class context, i.e., `this`. * @param {Boolean} is2d - If `true` both dimensions of the mouse location * should be shown. E.g., on a central track. * @param {Boolean} isGlobal - If `true` local and global events will trigger * the mouse position drawing. * @return {Function} - Method to remove graphics showing the mouse location. */ declare function setupShowMousePosition(context: ClassContext, is2d?: boolean, isGlobal?: boolean): Function;