Data Update
This commit is contained in:
parent
015c2add84
commit
e50b5c3114
206 changed files with 6337 additions and 523 deletions
|
|
@ -1,6 +1,6 @@
|
|||
let base = [[[-200, 0], [200, 0]]];
|
||||
const doc = [...Array(12)].reduce((doc_a, _, lvl) => {
|
||||
const rg = step => `0${((80 + (lvl - 2) * step) % 256).toString(16)}`.slice(-2);
|
||||
const rg = step => `0${(80 + (lvl - 2) * step).toString(16)}`.slice(-2);
|
||||
return doc_a + base.splice(0).reduce((ga, [a, b]) => {
|
||||
const v = [b[0] - a[0], b[1] - a[1]];
|
||||
const [c, d, w] = [a, b, v].map(p => [p[0] + v[1], p[1] - v[0]]);
|
||||
|
|
@ -10,7 +10,7 @@ const doc = [...Array(12)].reduce((doc_a, _, lvl) => {
|
|||
}, `<g fill="#${rg(20)}${rg(30)}18">`) + '\n</g>\n';
|
||||
}, '<svg xmlns="http://www.w3.org/2000/svg" width="1200" stroke="white">\n') + '</svg>';
|
||||
|
||||
const [x, y] = base.reduce(([xa, ya], [[x, y],]) => [Math.min(xa, x), Math.min(ya, y)], [0, 0]);
|
||||
const [x, y] = base.flat().reduce((a, p) => a.map((xy, i) => Math.min(xy, p[i])));
|
||||
const svg = doc.replace('<svg ', `<svg viewBox="${[x, y, -x - x, -y]}" `);
|
||||
|
||||
if (globalThis.global) { // if the script is run from node.js - save the svg to a file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue