Published
Edited
May 6, 2022
1 star
Insert cell
Insert cell
data = FileAttachment("IND_Cities_WB_Max_TableToExcel.csv").csv({typed: true})
Insert cell
viewof name = Inputs.select(d3.group(data, d => d.NAME), {label: "Select one", order:"WBMAX"})
Insert cell
n = name[0].NAME
Insert cell
n
Insert cell
Insert cell
Plot.plot({
width: width,
inset: 8,
//grid: true,
color: {
range: ["grey"],
//legend: true,
},
facet:
{
data: data,
//x: "ADM1NAME",
},
fx:
{
order: "WBMAX",
axis: null,
},
y:
{
domain: [10,30],
//clamp: true,
//hidden: true,
},
x:
{
ticks: 5,
tickSize: 0,
},
marks: [
Plot.line(data,
{
x: "Date",
y: "WBMAX",
sort: "DATE",
stroke: "NAME",
strokeWidth: .25,
//curve: "natural",
//stroke: "sex"
}),
Plot.line(data,
Plot.binX({y: "max",},{
x: "Date",
y: "WBMAX",
sort: "Date",
stroke: "#e63946",
//stroke: "ADM1NAME",
//stroke: "sex"
})),
Plot.line(data,
Plot.binX({y: "mean",},{
x: "Date",
y: "WBMAX",
sort: "Date",
stroke: "grey",
curve: "natural",
//stroke: "ADM1NAME",
//stroke: "sex"
}))
]
})
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