Published
Edited
Jul 29, 2019
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dem = getElevationData([-113.0737505875,35.7777790821,-111.8228267097,36.6950696661], width, width)
Insert cell
imshow(dem, 1, d3.interpolateViridis)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
color = d => d3.interpolateRainbow((d-elevRange[0])/(elevRange[1]-elevRange[0]))
Insert cell
// Scale function for cooridinates in contour
// (Without scaling, coordinates corresponds to index)
function scaleContour(contours, scale) {
return contours.map(({type, value, coordinates}) => (
{type, value, coordinates: coordinates.map(rings => (
rings.map(points => (
points.map(([x, y]) => ([
x*scale, y*scale
]))
))
))}
));
}
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