StealThis .dev

Science — Interactive Figure (toggle series)

A journal-grade interactive figure drawn entirely with inline SVG and vanilla JS — no charting library. It plots three abyssal monitoring stations as smoothed line-plus-marker series over sea-surface temperature, with gridlines, axis titles, units and bootstrap 95% confidence whiskers. A clickable legend toggles each station with smooth fades, a segmented control switches the y-axis between linear and log scale, and per-point hover tooltips read out temperature, NPP and CI. Seeded data renders identically offline.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Interactive Figure (toggle series)

A research-grade scientific figure built without any charting dependency. Axes, gridlines, the line series, the data markers and the 95% confidence whiskers are all generated as inline SVG from seeded data, so the plot looks and behaves the same on every load and works fully offline. Three fictional abyssal stations — Drake Passage, Weddell Gyre and Kerguelen Plateau — are fit to a modified Eppley curve relating net primary production to sea-surface temperature, with units and significant figures set in JetBrains Mono.

The figure is genuinely interactive. The legend is a row of toggle pills: click one to show or hide its station with a smooth opacity transition, and the y-axis automatically rescales to the visible data (the plot refuses to go empty). A segmented control flips the y-axis between linear and log₁₀ scale, regenerating ticks and the axis label. Two checkboxes toggle the error whiskers and the data markers independently, and Reset view restores every default.

Hovering — or keyboard-focusing — any marker raises an accessible tooltip that reads out the exact temperature, NPP value and confidence interval, colour-matched to its series. Everything carries a bold Figure 3. caption with a descriptive source line, fictional DOI and dataset version, and the layout collapses cleanly to a single column with horizontal scroll for the plot below 640px.

Illustrative UI only — fictional authors, data, and figures; not real scientific results.