Published
Edited
Nov 21, 2020
Insert cell
md`# The world according to Fish
The Spilhaus World Ocean in a Square is a map that depicts the world's oceans as a single body of water -their true configuration. Suitable for small scale visualizations of oceanic systems, this map provides a captivating visual framework for purposes that would benefit from revealing the contentedness of our planet's marine environment. Shout out to @toja for the tutorial`
Insert cell
{
const context = DOM.context2d(width, height);
const path = d3.geoPath(projection, context);

context.fillStyle = "#5e9ddb";
context.fillRect(0, 0, width, height);

context.strokeStyle = "#e9f2e9";
context.fillStyle = "#8cffcb";

context.beginPath();
path(graticule);
context.stroke();

context.beginPath();
path(land);
context.fill();

context.beginPath();
path(sphere);
context.stroke();
return context.canvas;
}
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
topojson = require("topojson-client@3")
Insert cell
graticule = d3.geoGraticule10()
Insert cell
world = fetch("https://cdn.jsdelivr.net/npm/world-atlas@2/land-110m.json").then(response => response.json())
Insert cell
projection = spilhausSquare()
.fitExtent([[50 , 50], [width - 50, height - 50]], sphere);
Insert cell
height = width
Insert cell
sphere = ({ type: "Sphere" })
Insert cell
d3 = require("d3-geo@1")
Insert cell
import {ellipticFactory, inverse} from "@toja/adams-world-in-a-square-i-ii"
Insert cell
import { spilhausSquare } from "@toja/spilhaus-world-ocean-map-in-a-square"
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