{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://datagraphics.dc.scilifelab.se/api/dataset/0ac8fa02871745048491de74e5689da9.csv"
},
"transform": [
{
"filter": "datum.channel=='Uppsala'"
},
{
"calculate": "datum.relative_copy_number",
"as": "relative_copy_number_total"
},
{
"sort": [
{
"field": "week",
"order": "descending"
}
],
"window": [
{
"as": "rank",
"op": "rank"
}
]
},
{
"filter": "datum.rank <= 20"
}
],
"width": 450,
"height": 250,
"mark": {
"type": "bar"
},
"encoding": {
"x": {
"title": "Week",
"field": "week",
"type": "nominal",
"axis": {
"labelAngle": 90
}
},
"y": {
"title": "N1-gene copy number per PMMOV gene copy number x 10^4",
"field": "relative_copy_number_total",
"type": "quantitative"
},
"color": {
"field": "channel",
"type": "nominal",
"scale": {
"domain": [
"Uppsala"
],
"range": [
"#8fd7f9"
]
},
"legend": {
"labelExpr": "{'Uppsala': 'Kungsängsverket'}[datum.label]",
"title": "Wastewater treatment plant"
}
},
"tooltip": [
{
"field": "week",
"type": "nominal",
"title": "Week"
},
{
"field": "channel",
"type": "nominal",
"title": "Wastewater treatment plant"
},
{
"field": "relative_copy_number_total",
"type": "quantitative",
"title": "Relative copy number of SARS-CoV-2 to PMMoV, %"
}
]
}
}