Public
Edited
Jun 5, 2023
Insert cell
Insert cell
state_wise_successful_ppl.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data = {
const top3 = state_wise.filter(f => f.count > 40).reduce((p, c) => p+c.count,0)
const rest = state_wise.filter(f => f.count < 40).reduce((p, c) => p+c.count,0)
return [{count: top3,states:"Top3"}, {count: rest,states:"Rest"}]
}
Insert cell
Plot.plot({
marks: [
Plot.barY(data, {x: "states", y: "count", sort: {x: "y", reverse: true},fill: (f) => f.states == "Top3" ? "#0061ff" : "lightgray"}),
Plot.ruleY([0])
]
})
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