Public
Edited
Feb 8, 2024
1 fork
4 stars
Insert cell
Insert cell
w = width
Insert cell
h = w / 188 * 118
Insert cell
svg`<svg width="${w}" height="${h}">
<rect width="${w}" height="${h}" fill="none" stroke="yellow" />

<g transform="translate(${w/2}, ${h/2})">
${array(3).map(i => {
const p = Polygon.fromPath(`M${-r} 0 A ${r} ${r} 0 0 1 ${r} 0 A ${r} ${r} 0 0 1 ${-r} 0 Z`)
const hatches = p.getHatches(PI/4, 3, 2, true)
const c = ['cyan', 'magenta', 'yellow'][i]
return `<g transform="rotate(${120 * i}) translate(100)">
${pathFromHatches(hatches, `stroke="${c}" fill="none"`)}

<circle
stroke="${c}"
fill="none"
r="${r}"
/>
</g>`
}).join('\n')}
</g>
</svg>`
Insert cell
r = 200
Insert cell
Insert cell
import { array, Polygon, pathFromPolygon, pathFromHatches, PI } from '@makio135/utilities'
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more