Published
Edited
Apr 19, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
values_mh = confirmed.map(d => d['MH'])
Insert cell
margin = 0
Insert cell
height= 200
Insert cell
import {chart as chart1} with {values_mh as data, height} from "@d3/histogram"
Insert cell
chart1
Insert cell
o = confirmed[0];
Insert cell
Insert cell
routes = d3.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vQUCSs0csjEYCJtgjQUxNJrcleDNHZ9-r_C79ebs3KRySQUFhBFng4k-By9MIJRQPIwTKzqCq7Ie1dx/pub?output=csv", d3.autoType)
Insert cell
routes.columns
Insert cell
Insert cell
vls = FileAttachment("values-1.json").json()
Insert cell
[d3.min(vls), d3.max(vls)]
Insert cell
import {chart as chartv} with {vls as data} from "@d3/histogram"
Insert cell
chartv
Insert cell
viewof mu = Scrubber(d3.ticks(-5,5, 200),{
format: x => `mu = ${d3.format("+.2d")(x)}`,
autoplay: false,
alternate: true
})
Insert cell
vls_gen = Float64Array.from({length:2000}, d3.randomNormal(mu, 2))
Insert cell
x = d3.scaleLinear([-10, 10])
Insert cell
x
Insert cell
import {chart as chartv3, width} with {x, vls_gen as data, height} from "@d3/histogram"
Insert cell
chartv3
Insert cell
md`## Scrubber on Covid Data`
Insert cell
function get_covid_values(i){
return Object.values(confirmed[i]).slice(1)
}

Insert cell
confirmed.length
Insert cell
viewof cdate= Scrubber(d3.ticks(0, confirmed.length, 10),{
format: x => `cdate = ${d3.format("+.2d")(x)}`,
autoplay: false,
alternate: true
})
Insert cell
vls_states = get_covid_values(cdate)
Insert cell
import {chart as chart_states} with {vls_states as data, height} from "@d3/histogram"
Insert cell
chart_states
Insert cell
Insert cell
import {Scrubber} from "@mbostock/scrubber"
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