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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more