# Frontend The Jellyscope frontend is a single-page application built with vanilla HTML, CSS, and JavaScript, using Plotly.js for all interactive visualizations. No frontend framework is needed. **Files covered**: - [web/templates/index.html](../src/jellyscope/web/templates/index.html) — HTML structure - [web/static/app.js](../src/jellyscope/web/static/app.js) — JavaScript controller - [web/static/style.css](../src/jellyscope/web/static/style.css) — Dark theme CSS --- ## index.html — Page Structure **Location**: `src/jellyscope/web/templates/index.html` This is a Jinja2 template rendered by FastAPI (via `Jinja2Templates`). It receives the following variables from the server: - `datasets`: list of available dataset names (e.g., `["galaxy_a", "galaxy_b"]` or `["default"]` for a flat layout) - `default_dataset`: name of the default dataset (active at page load) - `default_datacube`: name of the datacube to display first (first available datacube of the default dataset) - `datacubes`: list of available datacube names for the default dataset (e.g., `["nircam", "nircam_matched"]`) - `filters`: list of filter names for the default datacube (e.g., `["F070W", "F090W", ...]`) - `wavelengths`: dict mapping filter names to central wavelengths in µm These are exposed to JavaScript as `DATASETS`, `DEFAULT_DATASET`, `DEFAULT_DATACUBE`, `FILTERS`, and `WAVELENGTHS` constants. ### Layout The page uses CSS Grid with two columns: ```mermaid flowchart TB header["Header"] subgraph leftcol["Left column"] controls["Viewer controls"] viewer["Galaxy viewer"] controls --> viewer end subgraph rightcol["Right column"] properties["Properties panel"] clumplist["Clump list"] properties --> clumplist end header --> leftcol header --> rightcol ``` Left column: `1fr` (flexible) — the galaxy viewer expands to fill available space. Right column: `360px` fixed — the panels stack vertically. ### Key HTML Elements | Element ID | Type | Purpose | | ----------- | ------ | --------- | | `datacube-select` | `` | Intensity stretch: Log, Asinh (Lupton), Power | | `btn-view-single` / `btn-view-rgb` | `