Published
Edited
Feb 23, 2021
2 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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
sparkuniverse(ic_top_five)
Insert cell
function sparkuniverse(data) {
const sparkbars = []
data.forEach((d,i) => {
const data = extractValues(d.state_name, "initial_claims")
const sparkbar_ = bar(data, {"width": 100, "height" : 45, "highlights" : {"end" : ibm[0].hex}})
sparkbars.push(
{"rank" : bigtext(i + 1, {"font" : "bold 25px 'Kumbh Sans'", "color" : "dimgray"}),
"state" : bigtext(d.state_abbreviation, {"font" : "bold 25px 'Kumbh Sans'", "baseline" : "middle", "color" : ibm[0].hex}),
"trend" : sparkbar_,
"recent" : bigtext(parseInt(d.initial_claims/1000).toString().concat("k"), {"font" : "bold 25px 'Kumbh Sans'", "baseline" : "middle", "color" : ibm[0].hex})})
})
return sparkbars;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
format_percent = d3.format(Object.assign(d3.formatSpecifier("%"), {align: ">", precision: d3.precisionFixed(0.1)}))
Insert cell
Insert cell
ibm = colors.color_blind_safe.ibm
Insert cell
import {colors} from "@hamzaamjad/color-palettes"
Insert cell
import { bar, bigtext, table } from "@probitascap/tiny-charts"
Insert cell
import { vl } from "@vega/vega-lite-api"
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