Interactive plot with all municipalities, small

API
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "url": "https://datagraphics.dc.scilifelab.se/api/dataset/0ac8fa02871745048491de74e5689da9.csv"
  },
  "width": 450,
  "height": 250,
  "transform": [
    {
      "calculate": "datum.gene_copy_number/1000000000000000000",
      "as": "gene_copy_number_div"
    },
    {
      "window": [
        {
          "op": "rank",
          "as": "rank"
        }
      ],
      "sort": [
        {
          "field": "week",
          "order": "descending"
        }
      ]
    },
    {
      "filter": "datum.rank <= 100"
    }
  ],
  "encoding": {
    "x": {
      "field": "week",
      "type": "nominal",
      "title": "Week"
    },
    "y": {
      "field": "relative_copy_number",
      "type": "quantitative",
      "title": "Relative copy number of SARS-CoV-2 to PMMoV, %"
    },
    "color": {
      "condition": {
        "param": "hover",
        "field": "channel",
        "type": "nominal",
        "title": "Municipality"
      },
      "value": "grey"
    },
    "opacity": {
      "condition": {
        "param": "hover",
        "value": 1
      },
      "value": 0.2
    }
  },
  "layer": [
    {
      "description": "transparent layer to make it easier to trigger selection",
      "params": [
        {
          "name": "hover",
          "value": [
            {
              "channel": "Uppsala"
            }
          ],
          "select": {
            "type": "point",
            "fields": [
              "channel"
            ],
            "on": "mouseover"
          }
        }
      ],
      "mark": {
        "type": "line",
        "strokeWidth": 8,
        "stroke": "transparent",
        "tooltip": true,
        "point": {
          "filled": true,
          "size": 80
        }
      }
    },
    {
      "mark": "line"
    }
  ],
  "config": {
    "view": {
      "stroke": null
    }
  }
}
Owner: arnold
Modified 2021-09-15T11:59:31.883Z
Created 2021-09-15T11:58:09.212Z

DataGraphics 1.0.4