From af3cee60856f53bfbc23456023829de8c6673e5f Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 31 Oct 2025 10:05:15 -0700 Subject: [PATCH] Add rich HTML table UI for Eric's query results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace raw JSON output with styled, scrollable table featuring: **Features**: - Thumbnail images (clickable to full size) - Placeholder "No image" boxes for samples without thumbnails - Clickable sample PIDs linking to OpenContext records - Clickable site names linking to site pages - Formatted descriptions with proper line breaks - Geographic coordinates (lat/lon) - Zebra-striped rows for readability - Sticky header that stays visible while scrolling - Result count display **Layout**: - Max height: 600px with vertical scrolling - 5 columns: Thumbnail | Sample | Description | Site | Location - Responsive sizing with max-widths - Alternating row colors (#f8f9fa background) **Handles edge cases**: - Loading state: shows "Loading samples…" - Empty results: friendly message about Path 1 requirements - Missing thumbnails: grey placeholder box - Long descriptions: max-width with proper wrapping Significantly improves data exploration experience over raw JSON. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tutorials/parquet_cesium.qmd | 84 ++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 4 deletions(-) diff --git a/tutorials/parquet_cesium.qmd b/tutorials/parquet_cesium.qmd index 986145f..7b7b367 100644 --- a/tutorials/parquet_cesium.qmd +++ b/tutorials/parquet_cesium.qmd @@ -897,10 +897,86 @@ This query implements Eric Kansa's authoritative `get_samples_at_geo_cord_locati ```{ojs} //| echo: false samples_combined = selectedSamplesCombined -combinedLoading ? md`(loading…)` : md`\`\`\` -${JSON.stringify(samples_combined, null, 2)} -\`\`\` -` +``` + +```{ojs} +//| echo: false +html`${ + combinedLoading ? + html`
Loading samples…
` + : + samples_combined && samples_combined.length > 0 ? + html`
+ + + + + + + + + + + + ${samples_combined.map((sample, i) => html` + + + + + + + + `)} + +
ThumbnailSampleDescriptionSiteLocation
+ ${sample.has_thumbnail ? + html` + ${sample.sample_label} + ` + : + html`
No image
` + } +
+
+ ${sample.sample_label} +
+ +
+
+ ${sample.sample_description || 'No description'} +
+
+
+ ${sample.sample_site_label} +
+ +
+ ${sample.latitude.toFixed(5)}°N
+ ${sample.longitude.toFixed(5)}°E +
+
+
+ Found ${samples_combined.length} sample${samples_combined.length !== 1 ? 's' : ''} +
` + : + html`
+ No samples found at this location via Path 1 (direct sampling events). +
` +}` ``` ## Geographic Location Classification