Get rid of lodash dependency
This commit is contained in:
parent
faf5aa129f
commit
ca9e8e56be
3 changed files with 599 additions and 550 deletions
|
|
@ -1,8 +1,13 @@
|
|||
const crypto = require('crypto')
|
||||
const seedrandom = require('seedrandom')
|
||||
const { range } = require('lodash')
|
||||
const { serialize } = require('@thi.ng/hiccup')
|
||||
|
||||
const range = function* (end) {
|
||||
for (let i = 0; i < end; i++) {
|
||||
yield i
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a pair of coordinates representing the center, returns the cartesian
|
||||
* coordinate for a straight line drawn at radian angle `alpha` with
|
||||
|
|
@ -53,8 +58,8 @@ const tenPrint = content => {
|
|||
const seed = Number.parseInt(hash, 16)
|
||||
const random = seedrandom(seed)
|
||||
const radius = width / numTiles / 2
|
||||
const xs = range(numTiles + 1).map(x => width * (x / numTiles))
|
||||
const ys = range(numTiles + 1).map(y => width * (y / numTiles))
|
||||
const xs = [...range(numTiles + 1)].map(x => width * (x / numTiles))
|
||||
const ys = [...range(numTiles + 1)].map(y => width * (y / numTiles))
|
||||
const startAngle = random() < 0.5 ? quarterTau : 0
|
||||
|
||||
return ["svg.ten-print",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue