Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c8ac468
gallery: restyle the live trading desk showcase
cpsievert Nov 20, 2026
dbf782e
gallery: give the issue atlas a gallery page and screenshots
cpsievert Nov 20, 2026
1ca7ba5
gallery: matching before/after frames for whales and stars
cpsievert Nov 20, 2026
f361db4
gallery: put whales, stars, the issue atlas, and trading desk on the …
cpsievert Nov 20, 2026
a7a6705
gallery: fix a false claim in the issue atlas's sidebar tip
cpsievert Nov 20, 2026
959192f
gallery: self-review fixups (accessor name, line count, crop ordering)
cpsievert Nov 20, 2026
0d727ad
gallery: load the stars sky from IRSA, re-shoot whales and stars at 1…
cpsievert Nov 20, 2026
5990f8d
landing: start the gallery stage when it scrolls into view
cpsievert Nov 20, 2026
4866179
landing: hovering the gallery stage pauses and resumes it in place
cpsievert Nov 20, 2026
951a26f
landing: stop a paused showcase's progress bar refilling after it's left
cpsievert Nov 20, 2026
bce9070
landing: clicking a showcase plays it, even with the pointer on the s…
cpsievert Nov 20, 2026
8fb9462
gallery: add loan-chat (querychat + plotly) and county-clusters (k-me…
cpsievert Nov 20, 2026
3bd7922
landing: only the screenshot pauses the gallery stage
cpsievert Nov 20, 2026
1e6bee3
landing: reorder gallery stage — counties, loans, whales, stars, issu…
cpsievert Nov 20, 2026
6a5ec2d
landing: rewrite lede around shipping rich experiences from Python
cpsievert Nov 20, 2026
7fdbb36
docs: sync plotly linked-highlight snippet with its example (#498 fol…
cpsievert Nov 21, 2026
801abc7
address Copilot review on #499
cpsievert Nov 21, 2026
86008d4
address Copilot's second review on #499
cpsievert Nov 21, 2026
59484be
county-clusters: drop retired CT counties, add current Census boundaries
cpsievert Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ uv.lock
website/gallery/showcases/whale-slowdown/data/
website/gallery/showcases/nearby-stars/data/
website/gallery/showcases/issue-atlas/data/

# county-clusters commits its small counties.parquet, but caches plotly's public
# counties GeoJSON (~3 MB) on first run instead
website/gallery/showcases/county-clusters/data/geojson-counties-fips.json
200 changes: 184 additions & 16 deletions website/_tools/check_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import urllib.parse
from collections.abc import Callable
from pathlib import Path
from typing import TypedDict

import yaml
from playwright.sync_api import Browser, Locator, Page, sync_playwright
Expand Down Expand Up @@ -269,8 +270,8 @@ def gallery(page: Page, base: str) -> list[str]:
problems: list[str] = []
page.goto(base + "gallery/index.html")
items = page.locator(".quarto-listing .quarto-grid-item")
if items.count() != 30:
problems.append(f"{items.count()} gallery items, expected 30")
if items.count() != 35:
problems.append(f"{items.count()} gallery items, expected 35")
# Cards show a crop of each app's widgets (img/card.webp), not the whole-app screenshot.
srcs = page.evaluate(
"[...document.querySelectorAll('.quarto-grid-item img.thumbnail-image')].map(i => i.getAttribute('src'))"
Expand Down Expand Up @@ -373,30 +374,29 @@ def landing(page: Page, base: str) -> list[str]:
problems.append(f"tab {LANDING_TABS[i]}: images failed to load: {broken}")

picker = page.locator("#picker li")
if picker.count() != 7:
problems.append(f"{picker.count()} showcases in the stage, expected 7")
if picker.count() != 6:
problems.append(f"{picker.count()} showcases in the stage, expected 6")
else:
picker.nth(5).click()
if "Terrain explorer" not in page.locator("#picker li.on").inner_text():
problems.append("clicking the 6th showcase doesn't select Terrain explorer")
picker.nth(1).click()
if "Lending Club" not in page.locator("#picker li.on").inner_text():
problems.append("clicking the 2nd showcase doesn't select Lending Club")
page.wait_for_load_state("networkidle")
if broken := page.evaluate(IMAGES_LOADED_JS):
problems.append(f"stage images failed to load: {broken}")

# Keyboard: stage items are focusable, Enter selects one, and focus pauses autoplay.
# Keyboard: stage items are focusable and Enter selects one. (The "stage" check
# covers how focus pauses autoplay.)
page.goto(base + "index.html")
item = page.locator("#picker li button").nth(2)
if item.count() == 0:
problems.append("stage items aren't keyboard-focusable buttons")
else:
item.focus()
page.keyboard.press("Enter")
if "World development" not in page.locator("#picker li.on").inner_text():
if "Ships slow down for whales" not in page.locator("#picker li.on").inner_text():
problems.append(
"Enter on the 3rd stage item doesn't select World development"
"Enter on the 3rd stage item doesn't select the whales showcase"
)
if "paused" not in (page.locator("#stage").get_attribute("class") or ""):
problems.append("keyboard focus in the stage doesn't pause autoplay")

# A visitor who picks light on a docs page still gets the dark landing page, and
# their docs pages stay light.
Expand Down Expand Up @@ -432,13 +432,181 @@ def motion(page: Page, base: str) -> list[str]:
calm.wait_for_timeout(8000)
if calm.locator("#picker li.on").inner_text() != before:
problems.append("the stage auto-advances under reduced motion")
return problems


class StageState(TypedDict):
app: int # index of the active showcase
screen: str # #screen's classes: zoom, gesture, after
paused: bool
bar: float # active progress bar, as a fraction of its track
s1: float # opacity of the "after" screenshot
idle: list[float] # inactive bars' fill heights (px)


STAGE_JS = """() => {
const bar = document.querySelector('#picker li.on .bar i');
const px = (el) => parseFloat(getComputedStyle(el).height);
return {
app: [...document.querySelectorAll('#picker li')].findIndex((l) => l.classList.contains('on')),
screen: document.getElementById('screen').className.replace('screen', '').trim(),
paused: document.getElementById('stage').classList.contains('paused'),
bar: px(bar) / px(bar.parentElement),
s1: +getComputedStyle(document.getElementById('s1')).opacity,
idle: [...document.querySelectorAll('#picker li:not(.on) .bar i')].map(px),
};
}"""


@check("stage")
def stage(page: Page, base: str) -> list[str]:
"""The gallery stage's autoplay, through a visitor's whole session with it.

Each step's timing follows landing.js: a showcase lasts 7s, its gesture caption
shows at 1.6s and the "after" screenshot fades in at 2.6s.
"""
problems: list[str] = []
state: StageState
page.set_viewport_size({"width": 1440, "height": 900})

def at(wait_ms: int) -> StageState:
page.wait_for_timeout(wait_ms)
result: StageState = page.evaluate(STAGE_JS)
if any(result["idle"]):
problems.append(f"inactive showcases' bars fill: {result['idle']}")
return result

def expect(ok: bool, problem: str, state: StageState) -> None:
if not ok:
problems.append(f"{problem} ({state})")

def held_still(a: StageState, b: StageState) -> bool:
return (a["app"], a["screen"], a["s1"]) == (
b["app"],
b["screen"],
b["s1"],
) and (abs(a["bar"] - b["bar"]) < 0.005)

def leave() -> None:
page.mouse.move(5, 5)

page.goto(base + "index.html")
first = page.locator("#picker li.on").inner_text()
page.wait_for_timeout(8000)
if page.locator("#picker li.on").inner_text() == first:
problems.append("the stage doesn't auto-advance with motion allowed")
state = at(1500)
expect(
state["bar"] == 0 and state["screen"] == "",
"the stage plays before it's in view",
state,
)

page.locator("#screen").scroll_into_view_if_needed()
state = at(3000)
expect(
state["app"] == 0 and 0.3 < state["bar"] < 0.6 and "after" in state["screen"],
"the stage doesn't play once it's in view",
state,
)

# Hovering the screenshot pauses everything where it is.
page.locator("#screen").hover()
paused = at(0)
state = at(2000)
expect(
state["paused"] and held_still(paused, state),
"hovering the screenshot doesn't hold the stage still",
state,
)

# Leaving resumes from there: the bar continues, and the showcase ends after the
# time it had left rather than a whole new 7s.
leave()
state = at(500)
expect(
not state["paused"] and paused["bar"] < state["bar"] < paused["bar"] + 0.15,
"leaving the screenshot doesn't resume from where it paused",
state,
)
state = at(4100)
expect(state["app"] == 1, "after a pause, the showcase doesn't end on time", state)

# The app list isn't the screenshot: hovering it doesn't pause.
page.locator("#picker li").nth(3).hover()
before = at(0)
state = at(1000)
expect(
not state["paused"] and state["bar"] > before["bar"] + 0.1,
"hovering the app list pauses the stage",
state,
)

# Clicking an app plays it from the start.
page.locator("#picker li:not(.on) button").first.click()
clicked = at(400)
expect(
clicked["app"] != state["app"]
and clicked["bar"] < 0.15
and "after" not in clicked["screen"]
and clicked["s1"] == 0,
"clicking an app doesn't play it from the start",
clicked,
)
state = at(2600)
expect(
"after" in state["screen"], "a clicked app doesn't reach its after state", state
)

# After a click, the screenshot still pauses on hover and resumes on leaving.
page.locator("#screen").hover()
paused = at(0)
state = at(1500)
expect(
state["paused"] and held_still(paused, state),
"after a click, hovering the screenshot doesn't pause",
state,
)
leave()
state = at(500)
expect(
not state["paused"] and state["bar"] > paused["bar"],
"after a click, leaving the screenshot doesn't resume",
state,
)

# Keyboard: focus in the screenshot pauses like the pointer; focus in the list
# doesn't.
page.locator("#picker li button").last.focus()
state = at(300)
expect(
not state["paused"], "keyboard focus in the app list pauses the stage", state
)
page.keyboard.press("Tab")
focused = page.evaluate("document.activeElement.id")
paused = at(0)
state = at(1000)
expect(
focused == "view-src" and state["paused"] and held_still(paused, state),
f"keyboard focus on the screenshot's link ({focused!r}) doesn't pause",
state,
)
page.keyboard.press("Shift+Tab")
state = at(500)
expect(
not state["paused"] and state["bar"] > paused["bar"],
"moving keyboard focus off the screenshot doesn't resume",
state,
)

# Scrolling away and back restarts the current app.
page.evaluate("window.scrollTo(0, 0)")
away = at(1000)
page.locator("#screen").scroll_into_view_if_needed()
state = at(400)
expect(
state["app"] == away["app"]
and state["bar"] < 0.15
and "after" not in state["screen"],
"scrolling back to the stage doesn't restart the current app",
state,
)
return problems


Expand Down
29 changes: 16 additions & 13 deletions website/_tools/make_landing_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,18 @@ def front_matter_hero(page: Path) -> str:
"step-2": ("guide/first-app/img/02_after.webp", (0.01, 0.115, 0.99, 0.975), MAX_WIDTH),
"step-3": ("guide/first-app/img/03_summary.webp", FULL, MAX_WIDTH),
# The stage: each showcase's hero and the screenshot after its gesture
"show-chat-0": ("gallery/showcases/map-chart-chat/img/hero.webp", FULL, MAX_WIDTH),
"show-chat-1": ("gallery/showcases/map-chart-chat/img/after_fly_to.webp", FULL, MAX_WIDTH),
"show-whales-0": ("gallery/showcases/whale-slowdown/img/hero.webp", FULL, MAX_WIDTH),
"show-whales-1": ("gallery/showcases/whale-slowdown/img/after_brush.webp", FULL, MAX_WIDTH),
"show-stars-0": ("gallery/showcases/nearby-stars/img/before.webp", FULL, MAX_WIDTH),
"show-stars-1": ("gallery/showcases/nearby-stars/img/hero.webp", FULL, MAX_WIDTH),
"show-issues-0": ("gallery/showcases/issue-atlas/img/hero.webp", FULL, MAX_WIDTH),
"show-issues-1": ("gallery/showcases/issue-atlas/img/after_summary.webp", FULL, MAX_WIDTH),
"show-counties-0": ("gallery/showcases/county-clusters/img/before.webp", FULL, MAX_WIDTH),
"show-counties-1": ("gallery/showcases/county-clusters/img/hero.webp", FULL, MAX_WIDTH),
"show-loans-0": ("gallery/showcases/loan-chat/img/before.webp", FULL, MAX_WIDTH),
"show-loans-1": ("gallery/showcases/loan-chat/img/hero.webp", FULL, MAX_WIDTH),
"show-trade-0": ("gallery/showcases/trading-desk/img/hero.webp", FULL, MAX_WIDTH),
"show-trade-1": ("gallery/showcases/trading-desk/img/after_pivot.webp", FULL, MAX_WIDTH),
"show-world-0": ("gallery/showcases/world-development-dashboard/img/hero.webp", FULL, MAX_WIDTH),
"show-world-1": ("gallery/showcases/world-development-dashboard/img/after_click.webp", FULL, MAX_WIDTH),
"show-digits-0": ("gallery/showcases/digits-atlas/img/hero.webp", FULL, MAX_WIDTH),
"show-digits-1": ("gallery/showcases/digits-atlas/img/after_lasso.webp", FULL, MAX_WIDTH),
"show-cells-0": ("gallery/showcases/single-cell-atlas/img/hero.webp", FULL, MAX_WIDTH),
"show-cells-1": ("gallery/showcases/single-cell-atlas/img/after_top.webp", FULL, MAX_WIDTH),
"show-terrain-0": ("gallery/showcases/terrain-explorer/img/hero.webp", FULL, MAX_WIDTH),
"show-terrain-1": ("gallery/showcases/terrain-explorer/img/after_peak.webp", FULL, MAX_WIDTH),
"show-brain-0": ("gallery/showcases/brain-atlas-explorer/img/hero.webp", FULL, MAX_WIDTH),
"show-brain-1": ("gallery/showcases/brain-atlas-explorer/img/after_landmark.webp", FULL, MAX_WIDTH),
# Going further
"more-data": ("guide/performance/img/15_bigdata_datashader_100k.webp", (0.04, 0.08, 0.78, 0.96), MAX_WIDTH),
"more-ai": ("gallery/showcases/map-chart-chat/img/hero.webp", (0.0, 0.07, 1.0, 0.97), MAX_WIDTH),
Expand All @@ -116,15 +114,20 @@ def front_matter_hero(page: Path) -> str:
"showcases/aoi-workbench": (0.16, 0.16, 0.66, 0.74),
"showcases/brain-atlas-explorer": (0.25, 0.10, 0.97, 0.80),
"showcases/chemical-explorer": (0.22, 0.10, 0.92, 0.78),
"showcases/county-clusters": (0.27, 0.19, 0.74, 0.61),
"showcases/digits-atlas": (0.00, 0.10, 0.92, 0.99),
"showcases/issue-atlas": (0.34, 0.06, 0.99, 0.99),
"showcases/les-miserables-network": (0.22, 0.18, 0.85, 0.83),
"showcases/loan-chat": (0.00, 0.22, 0.56, 0.72),
"showcases/map-chart-chat": (0.00, 0.08, 0.88, 0.93),
"showcases/nearby-stars": (0.22, 0.07, 0.99, 0.80),
"showcases/orrery": (0.00, 0.15, 0.64, 0.83),
"showcases/rhodopsin-in-motion": (0.33, 0.08, 0.97, 0.70),
"showcases/single-cell-atlas": (0.33, 0.07, 0.99, 0.73),
"showcases/stdlib-import-graph": (0.24, 0.10, 0.82, 0.80),
"showcases/terrain-explorer": (0.00, 0.24, 0.66, 0.90),
"showcases/trading-desk": (0.37, 0.05, 0.99, 0.66),
"showcases/trading-desk": (0.27, 0.27, 0.99, 0.97),
"showcases/whale-slowdown": (0.00, 0.07, 0.56, 0.93),
"showcases/world-development-dashboard": (0.27, 0.10, 0.97, 0.80),
"templates/altair-weather-brush": (0.00, 0.08, 0.62, 0.70),
"templates/drawdata-classifier-playground": (0.25, 0.08, 0.95, 0.78),
Expand Down
Binary file added website/assets/landing/img/show-counties-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-counties-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-issues-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-issues-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-loans-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-loans-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-stars-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-stars-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/assets/landing/img/show-trade-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/assets/landing/img/show-trade-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-whales-0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/assets/landing/img/show-whales-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 16 additions & 19 deletions website/assets/landing/landing-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,22 @@ def clicked_out():
// The gallery stage. Gesture captions describe what the "after" screenshot shows.
// Images: img/show-<id>-{0,1}.webp.
const SHOWCASES = [
{ id: "chat", title: "Map + chart + chat", widgets: ["ipyleaflet", "plotly", "shinychat"], lines: 105,
blurb: "A map, a chart, and an LLM all read the same bounds() accessor, so they can never disagree.",
gesture: "Chat: “fly to the West Island”", href: "gallery/showcases/map-chart-chat/index.html" },
{ id: "trade", title: "Live trading desk", widgets: ["perspective"], lines: 207,
{ id: "counties", title: "Which US counties are alike?", widgets: ["plotly"], lines: 240,
blurb: "k-means groups 3,152 counties; click one and its closest matches light up, often a continent away.",
gesture: "Click King County, WA", href: "gallery/showcases/county-clusters/index.html" },
{ id: "loans", title: "Lending Club loans, in plain English", widgets: ["plotly"], lines: 242,
blurb: "10,000 loans you filter by asking; lasso a band on the scatter and Claude describes exactly those loans.",
gesture: "Lasso a rate band, ask Claude", href: "gallery/showcases/loan-chat/index.html" },
{ id: "whales", title: "Ships slow down for whales", widgets: ["lonboard", "mosaic"], lines: 325,
blurb: "2.68M AIS pings on a GPU map reveal the 10-knot limit ships keep near California whales.",
gesture: "Brush 9–10.5 knots off California", href: "gallery/showcases/whale-slowdown/index.html" },
{ id: "stars", title: "Every star within 330 light-years", widgets: ["jscatter", "k3d", "ipyaladin"], lines: 332,
blurb: "256k Gaia stars linked across three views: lasso one, and the same stars light up everywhere.",
gesture: "Press Hyades", href: "gallery/showcases/nearby-stars/index.html" },
{ id: "issues", title: "The Shiny issue atlas", widgets: ["embedding-atlas"], lines: 207,
blurb: "6,088 GitHub issues mapped by meaning; Claude summarizes whatever region you select.",
gesture: "Select a cluster, ask Claude", href: "gallery/showcases/issue-atlas/index.html" },
{ id: "trade", title: "Live trading desk", widgets: ["perspective"], lines: 215,
blurb: "One streaming table feeds a blotter and a treemap; value boxes follow the grid's live filter.",
gesture: "Switch the blotter to a pivot", href: "gallery/showcases/trading-desk/index.html" },
{ id: "world", title: "World development", widgets: ["lonboard"], lines: 156,
blurb: "A GDP choropleth with population-scaled cities that restyle and fly in place.",
gesture: "Click a city", href: "gallery/showcases/world-development-dashboard/index.html" },
{ id: "digits", title: "Handwritten digits", widgets: ["embedding-atlas"], lines: 79,
blurb: "Crossfilter 1,797 digit images; Python averages the pixels of whatever you select.",
gesture: "Select the 3s", href: "gallery/showcases/digits-atlas/index.html" },
{ id: "cells", title: "300,000 cells", widgets: ["jupyter-scatter"], lines: 160,
blurb: "Two linked GPU scatter plots with Python-driven selection and camera presets.",
gesture: "Find the top 1% CD3E cells", href: "gallery/showcases/single-cell-atlas/index.html" },
{ id: "terrain", title: "Terrain explorer", widgets: ["k3d"], lines: 130,
blurb: "Orbit a real elevation model, click to read the height, fly to the peaks.",
gesture: "Fly to highest point", href: "gallery/showcases/terrain-explorer/index.html" },
{ id: "brain", title: "Brain atlas", widgets: ["niivue"], lines: 109,
blurb: "Jump the crosshair to a landmark from Python, click to look up the region beneath it.",
gesture: "Jump to primary visual cortex", href: "gallery/showcases/brain-atlas-explorer/index.html" },
];
3 changes: 2 additions & 1 deletion website/assets/landing/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ body.sw-home .sw-landing :not(pre) > code { background: none !important; color:
.sw-landing .picker li.on h3 { color: var(--fg); }
.sw-landing .picker li.on p { display: block; }
.sw-landing .picker li.on .bar i { animation: sw-fill var(--dur) linear forwards; }
.sw-landing .stage.paused .picker li.on .bar i, .sw-landing .stage.calm .picker li.on .bar i { animation: none; height: 100%; }
.sw-landing .stage.offscreen .picker li.on .bar i, .sw-landing .stage.paused .picker li.on .bar i { animation-play-state: paused; }
.sw-landing .stage.calm .picker li.on .bar i { animation: none; height: 100%; }
@keyframes sw-fill { to { height: 100%; } }
.sw-landing .browser { border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #2a2f3d;
box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 50px 120px -30px rgba(0, 0, 0, .95), 0 30px 60px -40px rgba(124, 242, 201, .25); }
Expand Down
Loading