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;
}