title: "Testplot for Debugging"
showAbove: true
height: 200
data:
  zip: "summaries.zip"
  url: "$RUN$.infections.txt.csv"
mark:
  type: "line"
  strokeWidth: 3
  tooltip: true
transform:
  - { calculate: "(datum.nSusceptibleVaccinated)+(datum.nTotalInfectedVaccinated)+(datum.nRecoveredVaccinated)", as: "vaccinated"}
  - { calculate: "(datum.nSusceptible)+(datum.nTotalInfected)+(datum.nRecovered)", as: "all"}
  - { calculate: "datum.vaccinated / datum.all", as: "ppv"}
  - { calculate: "datum.nContagiousVaccinated / datum.nContagious", as: "pcv"}
  - { calculate: "1 - ((datum.pcv/(1 - datum.pcv)) * ((1 - datum.ppv)/datum.ppv))", as: "veOld"}
  - { calculate: "datum.nTotalInfected - datum.nTotalInfectedVaccinated", as: "infNonVac" }
  - { calculate: "datum.all - datum.nVaccinated", as: "numberOfNonVaccinated" }
  - { calculate: "1- ((datum.nTotalInfectedVaccinated/datum.nVaccinated)/(datum.infNonVac/datum.numberOfNonVaccinated))", as: "ve" }
encoding:
  x: { field: "date", type: "temporal"}
  y: { field: "ve", type: "quantitative"}

