UNPKG
descartes.js
Version:
latest (0.1.0)
0.1.0
0.0.2
0.0.1
A JS alternative to matplotlib, made for Descartes
github.com/arguiot/Descartes
arguiot/Descartes
descartes.js
/
src
/
includes
/
functions
/
grid.js
10 lines
(9 loc)
•
258 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
grid(n=
1
, color=
"grey"
) {
this
.ctx.fillStyle = color
for
(
var
i =
0
; i <
this
.width; i += n *
this
.scale) {
this
.ctx.fillRect(i,
0
,
1
,
this
.height) }
for
(
var
i =
0
; i <
this
.height; i += n *
this
.scale) {
this
.ctx.fillRect(
0
, i,
this
.width,
1
) } }