{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://datagraphics.dc.scilifelab.se/api/dataset/6d6f551abc10413a97a6ab64ebac46bd.csv"
},
"width": 800,
"height": 250,
"transform": [
{
"sort": [
{
"field": "week"
}
],
"window": [
{
"op": "sum",
"field": "count",
"as": "cumulative_count"
}
],
"groupby": [
"class"
],
"frame": [
null,
0
]
},
{
"calculate": "if(datum.class === 'R&D', 'R&D*', datum.class)",
"as": "classUpdated"
}
],
"mark": {
"type": "line",
"point": {
"filled": false,
"fill": "white"
}
},
"encoding": {
"x": {
"title": "Week",
"field": "week",
"type": "nominal",
"axis": {
"labelOverlap": "parity"
}
},
"y": {
"title": "Cumulative number of tests",
"field": "cumulative_count",
"type": "quantitative",
"axis": {
"orient": "right"
}
},
"color": {
"field": "classUpdated",
"type": "nominal",
"scale": {
"domain": [
"R&D*",
"negative",
"positive"
],
"range": [
"#c7c7c7",
"#8fd7f9",
"#ef9292"
]
},
"legend": {
"title": "Test results"
}
},
"tooltip": [
{
"field": "week",
"type": "nominal",
"title": "Week"
},
{
"field": "classUpdated",
"type": "nominal",
"title": "Test result"
},
{
"field": "cumulative_count",
"type": "quantitative",
"title": "Cumulative number of tests"
}
]
}
}