Public
Edited
Nov 6, 2023
Insert cell
Insert cell
Insert cell
Insert cell
elev_scale = d3.scaleLinear([
min_thresh,
d3.max(elevations_nth_lat.map(d => d.value)),
]
, [0,2e-1])
Insert cell
elev_scale(11)
Insert cell
d3.extent(elevations_nth_lat.map(d => d.value))
Insert cell
min_thresh = 0.01
Insert cell
min_value = d3.min(elevations_nth_lat.map(d => d.value))
Insert cell
every_nth = 1
Insert cell
elevations_nth_lat = elevations.filter(d => (d.lat_number-1) % every_nth === 0)
Insert cell
db
with initial_table as (
select *
from elevations
order by lat, lon
),

the_lons as (
select
row_number() over (order by lon) as lon_number,
lon
from (select distinct lon from elevations order by lon)
),
the_lats as (
select
row_number() over (order by lat) as lat_number,
lat
from (select distinct lat from elevations order by lat)
),

the_lon_lats as (
select *
from the_lons
cross join the_lats
),

with_lons as (
select *
from elevations
left join the_lons
using (lon)
),

with_lon_lat as (
select *
from with_lons
left join the_lats
using (lat)
)

select *
from the_lon_lats
left join with_lon_lat
using (lon_number, lat_number)
order by lat_number, lon_number
Insert cell
db
select *
from elevations
order by lat, lon
Insert cell
db = DuckDBClient.of({elevations: FileAttachment("elevations.csv")})
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