Public
Edited
Aug 27, 2019
Importers
5 stars
Insert cell
Insert cell
projection = d3.geoImago().k(k)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
colorArea = d3
.scaleLinear()
.range(["green", "white", "purple"])
.domain([-0.8, 0, 0.8])
Insert cell
Insert cell
Insert cell
land_angle_distortion = d3.max(delta.filter((_, i) => inLand[i]), d => d.angle)
Insert cell
land_area_distortion = {
const e = d3.extent(delta.filter((_, i) => inLand[i]), d => d.area);
return e[1] / e[0];
}
Insert cell
function distorsion(point, projection) {
const [c, n, e, c1, n1] = [
point,
[point[0], point[1] + epsilon],
[point[0] + epsilon / cos(point[1] * radians), point[1]]
].map(projection);

const area =
((e[1] - c[1]) * (n[0] - c[0]) - (e[0] - c[0]) * (n[1] - c[1])) /
epsilon ** 2;
const s1ps2 = Math.hypot(
e[0] - c[0] + (n[1] - c[1]),
e[1] - c[1] - (n[0] - c[0])
),
s1ms2 = Math.hypot(
e[0] - c[0] - (n[1] - c[1]),
e[1] - c[1] + (n[0] - c[0])
),
angle = (s1ps2 - s1ms2) / (s1ps2 + s1ms2),
orientation = Math.atan2(n[1] - c[1], n[0] - c[0]);

return {
area: log(abs(area)),
angle: abs(log(abs(angle))),
orientation: orientation
};
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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