Public
Edited
Sep 30, 2023
Insert cell
Insert cell
import { aq, op } from '@uwdata/arquero'
Insert cell
Plot.plot({
y: {
type: "log",
grid: true,
label: "↑ Unemployment (%)",
},
marks: [
Plot.ruleY([0]),
Plot.lineY(bls, {x: "Survey_date", y: "Exp_BG", z: "COVID_Study_ID", stroke: "Profession"})
]
})
Insert cell
bls = FileAttachment("survey_obs_test@4.csv").csv({typed: true})
Insert cell
20230902_survey_sero_obs.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
survey_obs_test@4.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
exp_log = bls.map(d => Math.log10(d.Exposure_sum_clinical))
Insert cell
Plot.plot({
y:{
type: "log"
},
marks: [
Plot.dot(bls, {x: "Survey_date", y: "Exposure_sum_clinical", stroke: "Profession"})
]
})
Insert cell
Plot.plot({
color: {scheme: "YlGnBu", legend: true},
marks: [
Plot.cell(heatmap1, Plot.binX({fill: "median"}, {x: {interval: "month", value: "Survey_date"}, y: "COVID_Study_ID", fill: "Exp_log", sort: {x: "y", order: "descending"}})),
]
})
Insert cell
heatmap1 = aq.from(bls)
Insert cell
heatmap1.orderby("Survey_date")
Insert cell
viewof Site = Inputs.select(d3.group(heatmap1, d => d.Site_group),
{label: "Site:"})
Insert cell
Plot.plot({
y: {label: ["Participants"],
tickFormat: null},
x: {label: ["Time"],
tickFormat: null},
color: {
scheme: "YlGnBu",
label: ["Median number of COVID exposures per month (log 10 scale)"],
legend: true},
marks: [
Plot.cell(Site, Plot.binX({fill: "median"}, {x: {interval: "3 months", value: "Survey_date"}, y: "COVID_Study_ID", fill: "Exp_log"})),
Plot.tickX(
Site.filter(d => d.COVID_date != "NA"),
{x: ("COVID_date"), y: "COVID_Study_ID", stroke: "red", strokeWidth: 3}
),
]
})
Insert cell
Plot.plot({
y: {label: null,
tickFormat: null},
marks: [
Plot.dot(bls, {x: "Survey_date", y: d => String(d.COVID_Study_ID), fill: "Site_group", opacity: 0.2, sort: {y: "x"}})
]
})
Insert cell
Insert cell
Plot.plot({
color: {
domain: ["Serology", "Surveys"],
legend: true},
marks: [
Plot.rectY(bls, Plot.binX({y: "count"}, {x: "Survey_date", fill: "brown", opacity: 0.5, insetLeft: 5})),
Plot.rectY(sero, Plot.binX({y: "count"}, {x: "COLLECTED", fill: "#6A5ACD", opacity: 0.5, insetRight: 5})),
Plot.ruleY([0]),
Plot.line(nsw, {x: "Date", y: d => (d.per_1000*60), curve: "basis", strokeWidth: 0.6})
]
})
Insert cell
20230902_sero_OBS@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
sero = FileAttachment("20230902_sero_OBS@1.csv").csv({typed: true})
Insert cell
nsw = FileAttachment("NSW_OBS.csv").csv({typed: true})
Insert cell
20230902_sero_OBS@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
survey_sero_obs@2.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
demographics = FileAttachment("survey_sero_obs@2.csv").csv({typed: true})
Insert cell
demographics
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
color: {
scheme: "Blues",
domain: ["Diagnosis by PCR / RAT", "Diagnosis by seroconversion only"],
legend: true
},
marks: [
Plot.rectY(demographics, Plot.binX({y: "count"}, {x: {interval: "month", value: "Sero_survey_date"} , fill: "lightblue"})),
Plot.rectY(demo2, Plot.binX({y: "count"}, {x: {interval: "month", value: "Only_NP"}, fill: "steelblue"})),
Plot.ruleY([0]),
Plot.line(nsw, {x: "Date", y: d => (d.per_1000*5), strokeWidth: 0.6})
]
})
Insert cell
demo2 = demographics.filter(d => d.Only_NP > new Date(2020, 9, 1))
Insert cell
Plot.rectY(bls, Plot.binX({y: "count"}, {x: "Survey_date", fill: "#A52A2A", opacity: 0.5, insetLeft: 5})),
,
Plot.line(nsw, {x: "Date", y: d => (d.per_1000*50)}
Insert cell
bls
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Plot.plot({
marks: [
Plot.rectY(bls, Plot.binX(
{y: "count"},
{x: {interval: "month", value: "Survey_date"} , fill: "COVID_exp", order: "sum", reverse: true})),
]
})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more