{
let rad = 300;
let nMax = drawMax / 2;
const data = [
new Set(),
new Set([0]),
..._.range(2, nMax).map((n) => {
return new Set(pisanoSequence(n, 0, 1));
})
];
return svg`<svg width="${rad * 2}" height="${
rad * 2
}" viewBox="${-rad} ${-rad} ${2 * rad} ${2 * rad}">
${_.range(1, nMax).flatMap((n) => {
let nRad = (rad * n) / nMax;
return _.range(0, n)
.filter((r) => data[n - 1].has(r))
.map((r) => {
let theta = (r / n) * 2 * Math.PI;
let x = nRad * Math.cos(theta - Math.PI / 2);
let y = nRad * Math.sin(theta - Math.PI / 2);
let fill = r === mod(highlight, n) ? "red" : "black";
return svg`<circle r="1.5" cx="${x}" cy="${y}" fill="${fill}"/>`;
});
})}
</svg>`;
}