Skip to main content
100%

geoShape

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Jan 31, 2017
Created on Jan 31, 2017

Six parametric curves define custom shapes on a sphere, each generated by a `d3.geoShape().generator(t)` function. These shapes animate, changing their position, size, and form every 800 milliseconds. The visualization uses D3 v4's `d3.geoPath` with a `d3.geoConicEqualArea` projection to render the sphere and the shapes as SVG paths. The shapes, filled with semi-transparent colors from `d3.schemeCategory10`, demonstrate how the `geoShape` generalization of `d3.geoCircle` creates diverse closed forms.

AI-generated description

A generalization of d3.geoCircle with a parametric curve generator:

d3.geoCircle() == d3.geoShape().generator(t => [Math.cos(t), Math.sin(t)])

TODO: add a .rotate() method, based on:

// rotation
var r = angle * Math.PI/180,
    c = Math.cos(r),
    s = Math.sin(r);
return [x * c - y * s, y * c + x * s];
```

See the code at [github:Fil/d3-geo/geoShape](https://github.com/Fil/d3-geo/commit/cd6ad7a916ed99d5f74bd6004cd9ad66a67a6266)
mit Licensed

Similar vizzes