Published
Edited
Jul 21, 2021
13 stars
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
dem.filter(d => d.elevation > 0)
Insert cell
dem.filter(d => d.elevation < 0)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
myline = negatives.filter(d => d.y == lines[l])
Insert cell
mylines = {
let myline = positives.filter(d => d.y == lines[l]);
let ybase = d3.min(myline, d => d.y);
let myline2 = myline
.map(d => ({
x: d.x,
y: d.y - k * d.z
}))
.sort(function(x, y) {
return d3.ascending(x.x, y.x);
});
let a = { x: xmin, y: ybase };
let b = { x: xmax, y: ybase };
myline2.unshift(a);
myline2.push(b);
return myline2;
}
Insert cell
mylines2 = {
let myline = negatives.filter(d => d.y == lines[l]);
let ybase = d3.max(myline, d => d.y);
let myline2 = myline
.map(d => ({
x: d.x,
y: d.y - k * d.z
}))
.sort(function(x, y) {
return d3.ascending(x.x, y.x);
});
let a = { x: xmin, y: ybase };
let b = { x: xmax, y: ybase };
myline2.unshift(a);
myline2.push(b);
return myline2;
}
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