Published
Edited
Jan 29, 2021
1 fork
12 stars
Insert cell
Insert cell
Insert cell
map = {
const svg = DOM.svg(960, 960);

d3.select(svg)
.attr("viewBox", [0, 0, n, m])
.selectAll("path")
.data(contoured)
.enter().append("path")
.attr("d", d3.geoPath())
.attr("fill", d => color(d.value));

return svg;
}
Insert cell
contoured = contours(floatArray)
Insert cell
color = d3.scaleSequential(d3.interpolateMagma)
.domain(extent)
Insert cell
contours = d3.contours()
.size([n, m])
.thresholds(thresholds || 20)
Insert cell
Insert cell
Insert cell
n = image.getWidth()
Insert cell
m = image.getHeight()
Insert cell
extent = d3.extent(floatArray)
Insert cell
floatArray = new Float32Array(values[0]).map(d => d === noDataValue ? 0 : d);
Insert cell
values = image.readRasters()
Insert cell
image = tiff.getImage()
Insert cell
tiff = GeoTIFF.fromUrl("https://s3-us-west-2.amazonaws.com/data.chrishenrick.com/sf_bay_area/Bathymetry_OffshoreSanFrancisco_resampled2.tif")
.catch(error => console.log(error))
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