Skip to content

add interactive webgl and cesiumjs renderers for web based globe visualizations with probing support#190

Open
Hackshaven wants to merge 4 commits intostagingfrom
68-add-interactive-webgl-and-cesiumjs-renderers-for-web-based-globe-visualizations-with-probing-support
Open

add interactive webgl and cesiumjs renderers for web based globe visualizations with probing support#190
Hackshaven wants to merge 4 commits intostagingfrom
68-add-interactive-webgl-and-cesiumjs-renderers-for-web-based-globe-visualizations-with-probing-support

Conversation

@Hackshaven
Copy link
Collaborator

This pull request adds support for interactive previewing of generated globe visualization bundles in the CLI API examples page. It introduces new globe-related example configurations (including WebGL and Cesium visualizations with drought risk and seafloor datasets), enables preview iframes and status messaging in the web UI, and adds a secure API route for serving generated example assets. Additionally, it improves CLI argument handling for boolean flags and includes a minor documentation addition for sample datasets.

Globe visualization examples and preview support:

  • Added multiple new globe visualization examples to list_cli_examples(), covering WebGL and Cesium-based globes with drought risk imagery, seafloor age data, and NASA GIBS VIIRS tiles. Each example includes preview iframe configuration and warnings where necessary.
  • Enhanced the CLI examples page UI to display preview iframes for visualizations, with status messaging for preview availability, command/job success, and error handling. Preview is automatically refreshed on successful runs. [1] [2] [3] [4]

API for serving generated example assets:

  • Added a new API route /examples/view/{bundle}/{asset_path} to securely serve generated example bundles and assets from the api_examples directory, resolving directory requests to index.html and restricting access to only the allowed path. [1] [2]

CLI argument handling improvements:

  • Improved boolean flag handling in _args_dict_to_argv to support explicit negation flags (e.g., --no-probe, --no-lighting, --no-auto-rotate) for globe visualization commands.

Documentation:

  • Added a module docstring and SPDX license header to src/zyra/assets/samples/__init__.py.

Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>
Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>
- Introduced new commands for generating interactive globe bundles using webgl-sphere and cesium-globe.
- Added detailed options for rendering, including texture handling, animation modes, and probe configurations.
- Implemented tests for globe renderers, ensuring proper functionality with various input scenarios, including legends, remote textures, and video sources.
- Enhanced testing for handling frame patterns and time-based animations.
- Included support for shared gradients and NetCDF probe data in both WebGL and Cesium renderers.

Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>
@Hackshaven Hackshaven self-assigned this Oct 16, 2025
if not asset_path or asset_path.endswith("/"):
relative = relative / "index.html"

target = (examples_root / relative).resolve()

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
except ValueError as exc: # pragma: no cover - defensive
raise HTTPException(status_code=404, detail="Not found") from exc

if not target.exists() or not target.is_file():

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
except ValueError as exc: # pragma: no cover - defensive
raise HTTPException(status_code=404, detail="Not found") from exc

if not target.exists() or not target.is_file():

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
raise HTTPException(status_code=404, detail="Not found")

media_type = mimetypes.guess_type(str(target))[0] or "application/octet-stream"
return FileResponse(target, media_type=media_type)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
"""

parsed = urlparse(source)
if source.startswith("vimeo:") or "vimeo.com" in parsed.netloc:

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

The string
vimeo.com
may be at an arbitrary position in the sanitized URL.
…ation

Signed-off-by: Eric Hackathorn <erichackathorn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments