Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Minimap

Index

Constructors

constructor

  • new Minimap(svg: SVGSVGElement, zoomG: SVGGElement, mainZoom: d3.behavior.Zoom, minimap: HTMLElement, maxWandH: number, labelPadding: number): Minimap
  • Constructs a new minimap.

    Parameters

    • svg: SVGSVGElement

      The main svg element.

    • zoomG: SVGGElement

      The svg group used for panning and zooming the main svg.

    • mainZoom: d3.behavior.Zoom

      The main zoom behavior.

    • minimap: HTMLElement

      The minimap container.

    • maxWandH: number

      The maximum width/height for the minimap.

    • labelPadding: number

      Padding in pixels due to the main graph labels.

    Returns Minimap

Properties

Private canvas

canvas: HTMLCanvasElement

The canvas used for drawing the mini version of the svg.

Private canvasBuffer

canvasBuffer: HTMLCanvasElement

A buffer canvas used for temporary drawing to avoid flickering.

Private download

download: HTMLLinkElement

Private downloadCanvas

downloadCanvas: HTMLCanvasElement

Private labelPadding

labelPadding: number

Padding (px) due to the main labels of the graph.

Private mainZoom

mainZoom: d3.behavior.Zoom

The zoom behavior of the main svg.

Private maxWandH

maxWandH: number

The maximum width and height for the minimap.

Private minimap

minimap: HTMLElement

The minimap container.

Private minimapSize

minimapSize: object

The current size of the minimap

Type declaration

  • height: number
  • width: number

Private minimapSvg

minimapSvg: SVGSVGElement

The minimap svg used for holding the viewpoint rectangle.

Private scaleMain

scaleMain: number

The last scaling factor used in the main svg.

Private scaleMinimap

scaleMinimap: number

The scale factor for the minimap. The factor is determined automatically so that the minimap doesn't violate the maximum width/height specified in the constructor. The minimap maintains the same aspect ratio as the original svg.

Private svg

svg: SVGSVGElement

The main svg element.

Private translate

translate: [number, number]

The last translation vector used in the main svg.

Private viewpoint

viewpoint: SVGRectElement

The rectangle showing the current viewpoint.

Private viewpointCoord

viewpointCoord: object

The coordinates of the viewpoint rectangle.

Type declaration

  • x: number
  • y: number

Private zoomG

zoomG: SVGGElement

The svg group used for panning and zooming the main svg.

Methods

update

  • update(): void
  • Redraws the minimap. Should be called whenever the main svg was updated (e.g. when a node was expanded).

    Returns void

Private updateViewpoint

  • updateViewpoint(): void
  • Updates the position and the size of the viewpoint rectangle. It also notifies the main svg about the new panned position.

    Returns void

zoom

  • zoom(translate?: [number, number], scale?: number): void
  • Handles changes in zooming/panning. Should be called from the main svg to notify that a zoom/pan was performed and this minimap will update it's viewpoint rectangle.

    Parameters

    • Optional translate: [number, number]

      The translate vector, or none to use the last used one.

    • Optional scale: number

      The scaling factor, or none to use the last used one.

    Returns void

Generated using TypeDoc