Cumulative serology test numbers

API
Dataset
Other graphics for same dataset
Cumulative plot, small 2022-01-11T04:00:14.118Z
Total serology test numbers 2024-02-19T07:06:54.211Z
Weekly serology test numbers 2024-03-21T05:40:22.141Z
{
  "$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"
      }
    ]
  }
}
Owner: arnold
Modified 2021-09-16T07:50:12.403Z
Created 2021-01-12T15:33:27.172Z

DataGraphics 1.0.4