1.0.15 • Published 8 years ago

svg-sketch-controls v1.0.15

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

svg-sketch-controls

controls used together with svg-sketch

js-standard-style

Try it out! view on requirebin

Use with browserify

methods

optional methods implemented by each control

var control = Control(el);

el is the svg parent element

control.matchEvent(event)

does event match current control?

useful if UI is to show current control (pencil, rectangle etc)

control.down(xy)

Called with xy

control.up(xy)

Called with xy

control.pathSelected(opt)

opt.e dom event opt.path svg path in json eventstream

events

createEvent(event)

event contains

{
  type: 'type',
  args: {
    'svg args + metadata'
  },
  origin: xy
}

updateEvent(event)

same structure as for createEvent

deleteEvent(event)

delete event

closeToPath(target)

close to svg path useful with touch devices

when touching the exact point on the svg path may be hard

install

With npm do:

npm install svg-sketch-controls

license

MIT

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago