Published
Edited
Jul 7, 2021
2 forks
16 stars
Kerkovits projectionA map of AfricaCupola ProjectionClipping spherical polygonsA conformal AiroceanFill with strokeMarkley’s tetrahedral mapSynchronized projectionsSatellite GLSLVan Der Grinten IV GLSLVan Der Grinten III GLSLVan Der Grinten II GLSLWinkel Tripel GLSLLee Modified Stereographic GLSLMiller Oblated Stereographic GLSLModified Stereographic GS48 GLSLModified Stereographic GS50 GLSLFoucaut GLSLLagrange GLSLKavrayskiy VII GLSLEisenlohr GLSLEckert VI GLSLEckert V GLSLEckert IV GLSLEckert III GLSLEckert II GLSLEckert I GLSLBertin1953 GLSLRobinson GLSLMiller GLSLRectangular Polyconic GLSLPatterson GLSLPolyconic GLSLLoximuthal GLSLCylindrical Stereographic GLSLCylindrical Equal-Area GLSLTransverse Fahey GLSLFahey GLSLCollignon GLSLBromley GLSLBottomley GLSLHammer GLSLBonne GLSLBoggs GLSLBerghaus GLSLBaker Transverse GLSLBaker GLSLAugust GLSLAiry GLSLAitoff GLSLArmadillo GLSLLarrivée GLSLCylindrical Equal-Area GLSLAzimuthal Equidistant GLSLLittrow GLSLVan Der Grinten GLSLEquirectangular GLSLConic Conformal GLSLConic Equidistant GLSLAlbers GLSLConic Equal-Area GLSLEqual Earth GLSLTimes GLSLWagner IV GLSLWagner VI GLSLWagner VII GLSLWiechel GLSLAtlantis GLSLMollweide GLSLMercator GLSLTransverse Mercator GLSL
Cordiform GLSL
WebMercator to globeVersor zooming for Three.jsAzimuthal Equal-Area GLSLBriesemeister GLSLRectilinear GLSLPhytoplanktonDanseiji projectionsTransverse MollweideThe 2D approximate Newton-Raphson methodInverting Lee’s Tetrahedral projectionAmerican PolyconicThe complex logarithm projectionRaster projection with GPU.jsH3 hexagons & geoContoursModified Stereographic ProjectionsFisheye Conformal Map (Cox)Fisheye Conformal MapFisheye Conformal Map (Tetrahedral)Reproject elevation tiles — worldTransverse projectionsThe Imago projectionD3 ProjectionsImago Projection Distorsion AnalysisEPSG:5530Imago tilingCordiform map projections 💛💗💖MultiPolygon clippingThe Nicolosi Globular ProjectionFisheye GlobeHerbert Bayer’s Pacific OceanThe Behrmann projectionOronce Finé’s triangle projectionDa Vinci’s octant projectionThe Lotus projection (1958)The Voronoi projectionUsing proj4js with D3 and PlotMurphey Butterfly ProjectionEquateur & tropiquesVega projectionsMercator projection of a Mercator globeThe truth about the Mercator projectionOcean-centric Mollweide projectionBuckminster Fuller’s triangle transformationExperimental two world projectionsTobler’s hyperelliptical projection (1973)Jacques Bertin’s projection (1953)A map without Antarctica (Bertin1953 projection)Square Root Azimuthal projectionThe Log-Azimuthal projectionPeirce Quincuncial Projection, centered on the South PoleTranslucent Earth (Satellite projection)Lee’s conformal projection in a tetrahedronAirocean projectionCubic projectionsCox conformal projection in a triangleIcosahedral projectionsDodecahedral projectionThe Cahill-Keyes projection (1975)Polyhedral projections with d3-geo-polygonWagner customizable projectionParametrized Equal Earth ProjectionThe Hufnagel projection systemTissot's indicatrixAn equal-area projection for the cubic EarthBase map
Also listed in…
GLSL projections
Insert cell
Insert cell
Insert cell
Insert cell
glproj = stabWerner(1 + 1 / 21, 60)
Insert cell
stabWerner = (ratio, max) => `
y -= halfPi;
${azimuthalEqualArea()}
applyRotation(vec3(0, -90, 0), lambda, phi);
transparent = false;
if (halfPi - rho < ${(max * radians).toFixed(10)}) {
phi = halfPi - rho;
lambda = (rho / cos(phi)) * atan(x, -y);
lambda /= ${ratio.toFixed(10)};
}

`
Insert cell
projection = {
const projection = d3
.geoProjection(stabWernerRaw(1 + 1 / 21, 60))
.preclip(
d3.geoClipPolygon({
type: "Polygon",
coordinates: [
[
[0, -90],
[-180 + 1e-4, 0],
[-180 + 1e-4, 60],
[-180, 60],
[180 - 1e-4, 60],
[180 - 1e-4, 0],
[0, -90]
]
]
})
)
.rotate([-10, 0])
.precision(0.1)
.fitSize([width, height], { type: "Sphere" });
return projection.scale(projection.scale() * 1);
}
Insert cell
function stabWernerRaw(ratio, max) {
/*
* simplified Bonne, with phi0 = halfPi ;
* https://github.com/d3/d3-geo-projection/blob/master/src/bonne.js
*/
function r(lambda, phi) {
const rho = halfPi - phi,
e = rho ? (lambda * cos(phi)) / rho : rho;
return [rho * sin(e), -rho * cos(e)];
}
r.invert = function(x, y) {
var rho = sqrt(x ** 2 + y ** 2),
phi = halfPi - rho;
return [(rho / cos(phi)) * atan2(x, -y), phi];
};

/* azimuthal equidistant for the pole part */
const az = d3
.geoAzimuthalEquidistant()
.rotate([0, -90])
.translate([0, 0])
.scale(1);

/* mix */
function forward(lambda, phi) {
if (phi < max * radians) {
lambda *= ratio;
return r(lambda, phi);
} else {
const p = az([lambda * degrees, phi * degrees]);
return [p[0], -p[1]];
}
}

function invert(x, y) {
let i = az.invert([x, -y]);
if (i[1] < max) {
i = r.invert(x, y);
i[0] /= ratio;
} else {
i[0] *= radians;
i[1] *= radians;
}
return [i[0], i[1]];
}

forward.invert = invert;

return forward;
}
Insert cell
// Ancient Earth Images by Christopher Scotese. https://www.earthbyte.org/paleomap-paleoatlas-for-gplates/
image = d3
.image(
`https://raw.githubusercontent.com/typpo/ancient-earth/master/images/scrape/${period}.jpg`,
{
crossOrigin: "anonymous"
}
)
.then(d => Object.assign(d, { style: "max-height:100px" }))
Insert cell
azimuthalEqualArea = () => `
float rho = sqrt(x * x + y * y);
if (rho > 2.0) {
transparent = true;
} else {
float c = 2.0 * asin(rho / 2.0);

float sinc = sin(c);
float cosc = cos(c);

lambda = atan(x * sinc, rho * cosc);
phi = asin(y * sinc / rho);
}
`
Insert cell
height = width
Insert cell
import { reglCanvas, createDrawCommand, regl } with {
width,
height,
projection,
glproj,
image
} from "@fil/phytoplankton"
Insert cell
d3 = require("d3@7", "d3-geo-projection@3", "d3-geo-polygon@1")
Insert cell
import { checkbox, radio, select } from "@jashkenas/inputs"
Insert cell
import { atan2, cos, degrees, halfPi, radians, sin, sqrt } from "@fil/math"
Insert cell
import { drag } from "@d3/versor-dragging"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more