Published
Edited
Apr 4, 2022
1 fork
14 stars
Plot: A few custom time axesAccess to Family planningPlot: MarimekkoAutoplot matrixWhat do people buy on Bandcamp?Plot: colorContrast transformA Timeline of Democratic Presidential CandidatesPlot: Diverging stacked barsPlot: Horizon ChartPlot: Ridgeline PlotTwo-Tone Pseudo Color Scales with Observable Plot & Vega-LiteRecreating Östling’s regression visualizationsError barsPlot: regressionSkies PlotHorizon graph & Barcode with PlotTemporal AliasingPlot for mathematiciansPlot Isotype dot plotCOVID-19 Netherlands Reproduction Number TutorialPlot Mountain SunsetSpine chartsGreenhouse gas emission projectionsRaincloud Plots with Observable PlotUpset Plots with Observable PlotExploring CIELChabNature variant waves graphicWhen Presidents Fade AwayThe Coronavirus landscapeOur World In Data charts visualisationThe normal modelVisualizing The New York Times’s Mini CrosswordDistributions and summary statistics - a collection of Plot examplesVariants of SARS-Cov-2 in EuropeLaid off: 6 million jobs and countingConcentration values vs. TimeTopological subsamplingPlot of plotsCyclical time scale, v2Bullet graph IIPlot: Bullet graphCyclical time scaleRoad traffic under COVID restrictions (France)K-means binningMatrix diagramELD ViewerHappy anniversary, Project Gutenberg!
ROC curve
Plot stargazer historyPlot HyperboloidPhone bar plotsLog-scale histogramDatabase Outage PlotBertin’s hotelIreland’s top trade partnersBump chartBubble MatrixRenko ChartGitHub BurndownPlot: Grid choroplethCandlestick Chart
Also listed in…
Fil’s plots
Plot
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
result = `${testname}_result`
Insert cell
roc = d3.sort(d3.shuffle(data.filter((d) => d[result] >= 0)), (d) => d[result])
Insert cell
threshold = (roc[threshold_i][result] + roc[threshold_i + 1][result]) / 2
Insert cell
// this is the threshold value where the test's interpretation changes (from "NOT detected" to "DETECTED")
threshold_i = {
const interpretation = `${testname}_interpretation`;
for (let i = 0; i < roc.length - 1; i++)
if (roc[i][interpretation] !== roc[i + 1][interpretation]) return i;

// for random and ideal, set the threshold at the number of true negative
return N - 1;
}
Insert cell
T = Uint8Array.from(roc, (d) => +(d.status === "P"))
Insert cell
X = d3.cumsum(T)
Insert cell
P = X[T.length - 1] // equiv. d3.sum(T)
Insert cell
Y = X.map((x, i) => 1 + i - x) // equiv. d3.cumsum(T, t => 1 - t)
Insert cell
N = Y[T.length - 1] // equiv. d3.sum(T, t => 1 - t)
Insert cell
AUC = 1 - d3.sum(T, (t, i) => (1 - t) * X[i]) / (N * P)
Insert cell
Insert cell
Insert cell
Insert cell
data = FileAttachment("supplementary_dataset2.xlsx")
.xlsx()
.then((xl) => xl.sheet("all_samples", { headers: true }))
.then(
(data) => (
data.forEach((d) => {
d.status = d.samplecollection === "obb_negatives" ? "N" : "P";

d.status_result = 1 + +(d.status === "P");

d.diasorin_result =
d.diasorin_result[0] === "<"
? +d.diasorin_result.slice(1).trim()
: d.diasorin_result;

d.siemens_result =
d.siemens_result[0] === "<"
? +d.siemens_result.slice(1).trim()
: d.siemens_result;

d.random_result = random();
}),
data
)
)
Insert cell
random = d3.randomExponential(1)
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