Zoom

<script src="./point_src/zoom"></script>

Scale a set of points in a zooming method, relative to an origin point.

Apply a set of points to an instance of Zoom, then apply an update().

const zoom = new Zoom(stage, pointList)

const origin = {x: 100, y: 100}
    , factor = 1.5 // 50% bigger.

// run `update` when a change occurs.
zoom.update(origin, factor)

// Draw points.
zoom.zoomPoints.pen.indicators(ctx, { color: 'gray', width: 1})
Meta Data
title Zoom
dependencies ()
unused_keys ()
unknown_keys ('category',)
category ['zoom', 'scale']
filepath_exists True
path zoom
filepath zoom.js
clean_files ()

  • ClassDeclaration
    class comments:
    Lensed zoom: farther points move disproportionately more.
    • constructor

      constructor

      (
      stage , points = [] , factor = 1 , center = {x: 0, y: 0} , lens = 1
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      add

      (
      points
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      update3

      (
      center , factor
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      Lensed zoom: farther points move disproportionately more.

    • method

      update

      (
      center , factor
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      move and scale all items relative to the factor and center.

    • method

      update2

      (
      center , factor
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      Lensed zoom: farther points move disproportionately more.

    • get

      zoomPoints

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      getZoomPoints

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])