Package Exports
- bezier-tweaker
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bezier-tweaker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bezier-tweaker 

Small UI for adjusting 1-dimensional bezier curves.
Usage
tweaker = bt([opts])
Creates a new UI for adjusting a bezier curve, returning an EventEmitter with the following properties:
tweaker.el
: the SVG element containing the UI.tweaker.points
: the Y positions for each control point, ranging from 0 to 1.tweaker.interpolate
: an interpolation function that takes an X value between 0 and 1, returning a Y value between 0 and 1. Useful for live-updating animations.
Takes the following options:
precision
: The amount of points to draw in the line. Defaults to 50.degrees
: Number of points to use in the curve. Defaults to 4.padding
: Padding around the UI, in pixels. Defaults to 50.height
: Height (not including padding), in pixels. Defaults to 200.width
: Width (not including padding), in pixels. Defaults to 200.control
: Pass in a custom array of control points.
tweaker.on('update', handle)
Emitted every time the curve is updated, passing along the array of control
points (also available at tweaker.points
) as the first argument.
License
MIT. See LICENSE.md for details.