Interactive plot for Stockholm with all inlets, small

API
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "config": {
    "view": {
      "stroke": null
    }
  },
  "data": {
    "url": "https://datagraphics.dckube.scilifelab.se/api/dataset/65f19e61386a4a039aa798010ca42469.csv"
  },
  "encoding": {
    "color": {
      "condition": {
        "field": "wwtp",
        "param": "hover",
        "title": "Wastewater treatment plant",
        "type": "nominal"
      },
      "value": "grey"
    },
    "opacity": {
      "condition": {
        "param": "hover",
        "value": 1
      },
      "value": 0.2
    },
    "x": {
      "field": "week",
      "title": "Week",
      "type": "nominal",
      "axis": {
        "labelAngle": 90
      }
    },
    "y": {
      "field": "value",
      "title": "Relative copy number of SARS-CoV-2 to PMMoV",
      "type": "quantitative"
    }
  },
  "height": 250,
  "layer": [
    {
      "description": "transparent layer to make it easier to trigger selection",
      "mark": {
        "point": {
          "filled": true,
          "size": 80
        },
        "stroke": "transparent",
        "strokeWidth": 8,
        "tooltip": true,
        "type": "line"
      },
      "params": [
        {
          "name": "hover",
          "select": {
            "fields": [
              "wwtp"
            ],
            "on": "mouseover",
            "type": "point"
          },
          "value": [
            {
              "wwtp": "Bromma WWTP, Järva Inlet"
            }
          ]
        }
      ]
    },
    {
      "mark": "line"
    }
  ],
  "transform": [
    {
      "filter": "datum.wwtp=='Käppala WWTP'|datum.wwtp=='Henriksdal WWTP, Sickla Inlet'|datum.wwtp=='Henriksdal WWTP, Henriksdal Inlet'|datum.wwtp=='Bromma WWTP, Hässelby Inlet'|datum.wwtp=='Bromma WWTP, Riksby Inlet'|datum.wwtp=='Bromma WWTP, Järva Inlet'"
    },
    {
      "sort": [
        {
          "field": "week",
          "order": "descending"
        }
      ],
      "window": [
        {
          "as": "rank",
          "op": "rank"
        }
      ]
    },
    {
      "filter": "datum.rank <= 80"
    }
  ],
  "width": 450
}
Owner: arnold
Modified 2021-12-03T10:39:30.346Z
Created 2021-10-12T11:50:49.464Z

DataGraphics 0.12.5