Public
Edited
May 3, 2021
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
precision= d3.format(".6f")
Insert cell
Insert cell
Insert cell
squares = Math.sqrt(observations)
Insert cell
observations = data.length
Insert cell
Insert cell
Insert cell
Insert cell
data = datasets[datasetRadio]
Insert cell
Insert cell
datasets =[moondata, sundata]
Insert cell
moondata = d3.csvParse(await FileAttachment("earth_moon_yearly_422.csv").text(), ({date, distance}) => ({date: new Date(date), value: precision(distance)})).sort((a, b) => a.date - b.date)
Insert cell
sundata = d3.csvParse(await FileAttachment("earth_sun_yearly_422@1.csv").text(), ({date, distance}) => ({date: new Date(date), value: precision(distance)})).sort((a, b) => a.date - b.date)
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require('d3@6')
Insert cell
import {radio } from "@jashkenas/inputs"
Insert cell
import {legend, swatches} from "@d3/color-legend"
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