Dragging

<script src="./point_src/distances.js"></script>
<script src="./point_src/dragging"></script>

Dragging tool performs distance tests for all applied points.

const drag = new Dragging
drag.initDragging(this)
drag.onDragMove = this.onDragMove.bind(this)
drag.onDragEnd = this.onDragEnd.bind(this)

Install points into the map:

drag.addPoints(this.center, this.point0, this.point1)

Upon a mouse action we can access the discovered points.

let p = drag.getPoint();
if(p) {
    p.pen.circle(ctx)
}
Meta Data
title Dragging
dependencies ('distances.js',)
unused_keys ()
unknown_keys ('files',)
files ['', 'protractor.js', 'text/beta.js']
filepath_exists True
path dragging
filepath dragging.js
clean_files ('protractor.js', 'text/beta.js')

  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ClassDeclaration
    class comments:
    click Down<>Up ms delta,
    • property

      clickSpeed

      = 300
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      clickDragDeadzone

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

      maxWheelValue

      = 500
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      padding

      = 10
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • property

      twistMouse

      = true
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • constructor

      constructor

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

      wake

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

      initDragging

      (
      stage
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      , {passive: true}
    • method

      add

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

      set

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

      onMousedown

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

      primaryActionDown

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Capture the down event for the primary mouse button (likely button #0)
    • method

      emptyMouseDown

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('Empty click', stage, ev)
    • method

      getPoint

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      return the point previously discovered.
    • method

      onMousemove

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      present the possible nearest
    • method

      isRightClickOkay

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

      mousedownRotationTool

      (
      ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      this.mousedownOrigin.radians = this._near.radians
    • method

      onShiftMouseMoveHandler

      (
      ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      the point should _spin_ rather than move.
    • method

      cursorChange

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

      _emitCursorHover

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

      _emitCursorRelease

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('disable hover', id)
    • method

      onMouseup

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('Click Speed =', delta, 'distance', dis, 'is click:', isClick)
    • method

      onWheelInternal

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      this.onWheel(ev, n)
    • method

      onLongClick

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

      getDownTimeTaken

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

      onContextMenu

      (
      stage , c , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      mouse.listen(c, 'contextmenu', (c,ev)=> this.onContextMenu(stage,c,ev), {passive: true})
    • method

      dragDistance

      (
      ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Given the EV with a {x,y}, return the distance from the origin mousedown.
    • method

      onClickHander

      (
      stage , canvas , ev
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('That was a click not a drag...')
    • method

      callDoubleHandler

      (
      name , ev , p , x
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Given a function name shared by this instance, and the point, call the function with the event and arguments. callDoubleHandler('onClick', ev, point, ...) The function name must exist on this instance, optional on the point.
    • method

      callPointHandler

      (
      name , ev , p , x
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Call the method `name` on the point, with the event, _if_ the point contains the method. this.callPointHandler('onMousedown', ev, this._near) Apply any arguments after the _point_ to the event this.callPointHandler('onLongClick', ev, this._near, delta, { apples: 'green'})
    • method

      drawAll

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

      drawTwists

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

      drawIris

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

      onWheelEmpty

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

      onEmptyDown

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

      onClick

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

      onDragStart

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

      onDragMove

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

      onDragEnd

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

      onWheel

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

      onEdgeStart

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

      onEdgeMove

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

      onEdgeEnd

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

      onDragMoveHandler

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

      onDragStartHandler

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

      onEdgeStartHandler

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

      withinBufferZone

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

      onDragEndHandler

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

      applyXY

      (
      x , y
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ClassDeclaration
    class comments:
    stash and pop cursor states. id = cursor.set(name) cursor.unset(id)
    • constructor

      constructor

      (
      stage
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      this.current = 'default'
    • method

      set

      (
      name , parallelUnset
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('set cursor')
    • method

      setMouseIcon

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

      unset

      (
      uuid , perform = True
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('unset cursor', uuid)
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • EmptyStatement
    ; (empty statement)
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])