Skip to content

Spatial view rewrite#1290

Open
adkinsrs wants to merge 19 commits into
develfrom
spatial-view-rewrite
Open

Spatial view rewrite#1290
adkinsrs wants to merge 19 commits into
develfrom
spatial-view-rewrite

Conversation

@adkinsrs

Copy link
Copy Markdown
Member

This pull request introduces several improvements to the spatial viewer backend and frontend, focusing on modernizing dependencies, improving the Panel app export and embedding workflow, and enhancing layout and styling for spatial visualizations. The changes streamline the process of generating and embedding spatial visualizations, improve maintainability, and address some UI/UX issues related to layout and resource loading.

Backend and API improvements:

  • Refactored the SpatialPanel API resource to return a script tag for embedding the Panel viewer app using bokeh.server_document, with support for passing configuration arguments and toggling between standard and zoomed-in views. This replaces the previous filename-based workflow and enables more flexible embedding. [1] [2] [3] [4]
  • Added a new utility function get_viewer_script for generating the embedding script, including environment-based domain URL selection and argument passing.

Panel app and export enhancements:

  • Updated the Panel download plugin to use the refactored ExpandedSpatialViewer, improving export reliability and presentation by stripping interactive controls and embedding all resources into a single HTML file. [1] [2]
  • Added the BOKEH_RESOURCES=cdn environment variable in Docker, systemd, and compose templates to ensure Bokeh resources are loaded from CDN, reducing resource loading issues in offline exports. [1] [2]

Dependency and environment updates:

  • Upgraded key dependencies (panel to 1.9.3, added hvplot and spatialpandas) in both requirements.txt and developer documentation to support new features and improve compatibility. [1] [2] [3] [4]
  • Simplified the Docker build process and set PYTHONPATH explicitly for the spatial service. [1] [2]

Frontend and styling improvements:

  • Improved grid and card layout for spatial visualizations, allowing better aspect ratio handling and preventing content overflow; removed hardcoded iframe heights for more flexible embedding. [1] [2] [3] [4] [5]

Codebase cleanup:

  • Removed unused or outdated code, such as the arg_mapping and manual settings construction in the download plugin, to reduce complexity and improve maintainability.

These changes collectively modernize the spatial viewer infrastructure, improve user experience for exporting and embedding visualizations, and ensure the system is ready for future enhancements.

adkinsrs added 18 commits March 1, 2026 10:27
- Updated create_spatial_plot to improve NaN handling and hover tooltips.
- Modified create_umap_plot to include dynamic category display and adjusted plot settings.
- Simplified panel_app_expanded.py by removing unnecessary template wrapping.
- Enhanced BaseSpatialViewer with new properties and improved opacity handling.
- Added zoom panel update functionality in ExpandedSpatialViewer.
- Added 'mode' parameter to create_spatial_plot for different tool configurations.
- Updated default tools for spatial plots based on mode.
- Removed redundant code in panel_app and panel_app_expanded.
- Implemented a loading overlay in tilegrid.js for improved user experience during data loading.
…olbar adjustments; improve CSS for overflow handling in spatial plots
…ected layer; adjust unselected_alpha and color for better visibility in spatial viewer
@adkinsrs adkinsrs marked this pull request as ready for review June 25, 2026 14:51
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