Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lemonpi/drawpoint
Abstracting drawing on a HTML canvas with points and operations on points
https://github.com/lemonpi/drawpoint
Last synced: 6 days ago
JSON representation
Abstracting drawing on a HTML canvas with points and operations on points
- Host: GitHub
- URL: https://github.com/lemonpi/drawpoint
- Owner: LemonPi
- Created: 2017-05-10T08:59:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T18:58:21.000Z (over 1 year ago)
- Last Synced: 2024-04-14T07:49:49.812Z (7 months ago)
- Language: JavaScript
- Size: 2.31 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Draw Points
A simple library to abstract drawing on HTML canvases by
using points and operations on points.## [Interactive demo](http://johnsonzhong.me/drawpoint-demo/)
## Usage
Get by cloning the repository, or `npm install drawpoint`.### building from source
```bash
npm install
npm run build
```### testing
```bash
npm install
npm test [optional seed]
```
The test outputs the seed it's using at the top, which you can
pass back into `npm test [seed]` to replicate behaviour.### include (browser)
Include `dist/drawpoint.js` in a script tag and use `drawpoint` as the global namespace containing all the functions.
```html
// can use just as a global variable in the browser
// use dp as a shorthand
const dp = drawpoint;```
### include (CommonJS)
Only useful is the source is ultimately used in the browser since that's the only
place where canvas and rendering contexts exist. This would be the case if the
code's passed through `browserify` or `webpack`, for example.
```javascript
const dp = require('drawpoint');
```### include (ES2015 module)
```javascript
import * as dp from 'drawpoint';
```