Skip to content

Commit 67910ba

Browse files
authored
Merge pull request #181 from CU-ESIIL/codex/embed-interactive-ndvi-example-in-docs
Embed interactive NDVI Plotly iframe in cube viewer docs
2 parents bdb478e + 75fd867 commit 67910ba

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

docs/dev/legacy_reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ cd.show_cube_lexcube(cube, cmap="RdBu_r")
470470

471471
Lexcube widgets run only in live Python environments (JupyterLab, VS Code, Colab, Binder). They will not render on the static documentation site, so screenshots and Binder links are provided for reference.
472472

473-
![Stylized Lexcube example](../img/lexcube_example.svg)
473+
![Stylized Lexcube example](../assets/img/lexcube_hero.png)
474474

475475
*The SVG is a stylized capture so the documentation can ship a "screenshot" without introducing binary assets.*
476476

docs/stylesheets/extra.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,30 @@
3131
height: auto;
3232
max-height: 280px;
3333
}
34+
35+
/* Responsive interactive embeds (Plotly HTML iframes) */
36+
.interactive-embed {
37+
margin: 1rem 0 2rem 0;
38+
}
39+
40+
.interactive-embed iframe {
41+
width: 100%;
42+
height: 560px;
43+
border: 0;
44+
border-radius: 12px;
45+
overflow: hidden;
46+
box-shadow: var(--md-shadow-z2);
47+
background: var(--md-default-bg-color);
48+
}
49+
50+
@media (max-width: 900px) {
51+
.interactive-embed iframe {
52+
height: 420px;
53+
}
54+
}
55+
56+
.interactive-embed__fallback {
57+
margin: 0.5rem 0 0 0;
58+
font-size: 0.85em;
59+
opacity: 0.85;
60+
}

docs/viz/cube_viewer.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ ndvi = cd.ndvi(
2424
pipe(ndvi) | v.plot()
2525
```
2626

27+
<div class="interactive-embed">
28+
<iframe
29+
src="../assets/figures/ndvi_1_year.html"
30+
title="Interactive NDVI example (1 year)"
31+
loading="lazy"
32+
allowfullscreen
33+
></iframe>
34+
<p class="interactive-embed__fallback">
35+
If the interactive view doesn’t load, <a href="../assets/figures/ndvi_1_year.html" target="_blank" rel="noopener">open it in a new tab</a>.
36+
</p>
37+
</div>
38+
2739
## Controls
2840

2941
- **Rotate:** click + drag (or touch and drag) anywhere on the cube.

0 commit comments

Comments
 (0)