1.0.8 • Published 6 years ago

interactive-polygon v1.0.8

Weekly downloads
7
License
MIT
Repository
bitbucket
Last release
6 years ago

class Polygon

events

  • change
  • close

handle events

  • polygon.on(evtName, callback)
  • polygon.off(evtName, callback)
  • polygon.once(evtName, callback)

members

vertices - Array of Circle Objects

method

draw

start drawing

pinDraw

return a callback that add node to canvas center everytime it execute. useful on advanced use or mobile

class Circle

members (get, set)

  • position
  • color
  • radius
  • border
  • state
  • is // if (is === 'midpoint') it is a mid-point of vertice

class Canvas

constructor(domListenTo, domRenderTo)

both args are required, and they must be

method

addNode

canvas.addNode(new Polygon())

removeNode

opposite of addNode

clear

discards all its child

destruct

remove evt listener and discards all its child

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago