Published
Edited
Dec 31, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
linePlots = lineSeries(innings,
d => d.Wicket <= filters.wickets,
filters.runrules.map(d => { return {value: d, label: `${d} runs`}}),
filters.colorScheme)
Insert cell
innings = allInnings.filter((d) => {
return filters.inningsNumbers.indexOf(d.innings) !== -1
&& filters.testSeries.indexOf(d.series_name) !== -1
&& filters.testResults.indexOf(d.result) !== -1
}); //.map(d => d.fow)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
lineSeries = (innings = [], filterFn = d => d, yRules = [], colorScheme = "None") => {
let plots = [];

plots.push(Plot.ruleY(yRules.map(d => d.value), {stroke: "red"}))
plots.push(innings.map(inning => {
const color = getColorFromMap(colorScheme, inning);
return Plot.line(inning.fow.filter(filterFn),
{
x: "Wicket",
y: "Runs",
stroke: color
})
}));
plots.push(Plot.text(yRules,
{
x:(t) => { return 1; },
y:(t) => { return t.value; },
text:"label",
stroke: "red",
dy: -5,
dx: 50,
fontWeight: "lighter",
}))
return plots;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
require("d3-scale-chromatic@3")
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