Plot.plot({
marks: [
Plot.frame({ stroke: settings.panelBorder == "show" ? "#ccc" : null }),
Plot.barX(tasks, {
y: "task",
x1: (d) => parser(d.startDate),
x2: (d) => parser(d.endDate),
fill: "group",
rx: settings.barRoundness,
insetTop: settings.barHeight,
insetBottom: settings.barHeight
}),
Plot.text(tasks, {
y: "task",
x: (d) => parser(d.startDate),
text: (d) => d.task,
textAnchor: "start",
dy: settings.textPosition,
fontSize: settings.fontSize,
stroke: "white",
fill: "dimgray",
fontWeight: 500
}),
Plot.tip(tasks, Plot.pointerY({
y: "task",
x1: (d) => parser(d.startDate),
x2: (d) => parser(d.endDate),
title: (d) =>
`Team: ${d.group}\nTask: ${d.task}\nDescription: ${d.description}\nStart: ${d.startDate}\nEnd: ${d.endDate}`
}))
],
height: settings.plotHeight,
width: settings.plotWidth,
x: { grid: (settings.gridlines == "x") | (settings.gridlines == "both") ? true : null },
y: {
domain: domainByDate,
label: null,
tickFormat: null,
tickSize: null,
grid: (settings.gridlines == "y") | (settings.gridlines == "both") ? true : null
},
color: { domain: domainByGroup, range: colors, legend: true }
})