1.0.1 • Published 7 years ago
zakkin v1.0.1
zakkin.js
zakkin.js is a heatmap display library
Usage
cosnt points = [{
x: 15,
y: 15,
radius: 30
}, {
x: 10,
y: 10,
radius: 30
}, ...];
const zakkin = new Zakkin();
zakkin.init(320, 740, points);
zakkin.execute();
zakkin.render('stage');
Install
$ npm install zakkin
or
<script src="https://cdn.jsdelivr.net/npm/zakkin@1.0.0/zakkin.min.js"></script>
API
Zakkin.prototype.init(width, height, points)
Generate and initialize a new canvas.
widthNumber
Set to canvas.width.
heightNumber
Set to canvas.height.
pointsArray
Initial drawing data.
Point.xNumber
The x-axis px of the point.
Point.yNumber
The y-axis px of the point.
Point.radiusNumber
Radius of drawing circle.
Zakkin.prototype.execute()
Perform initial drawing.
Zakkin.prototype.clear()
Clear canvas.
Zakkin.prototype.draw(Point)
Draw a single point.
Point.xNumber
The x-axis px of the point.
Point.yNumber
The y-axis px of the point.
Point.radiusNumber
Radius of drawing circle.
Zakkin.prototype.process()
Update screen canvas to the current drawing state.
Zakkin.prototype.render(id)
Insert screen canvas into the dom of the specified id.
idString
element-id.
Zakkin.prototype.picker(x, y)
Returns the density of the specified coordinates.
xNumber
The x-axis px.
yNumber
The y-axis px.