-
Notifications
You must be signed in to change notification settings - Fork 2
Yearbook opus #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yearbook opus #283
Conversation
… recreation with unique IDs. Update make_image_layers and make_simple_image_layer functions to include dataset index and cache key for improved layer handling.
Overview of
|
| File | Changes | Description |
|---|---|---|
js/viz/yearbook.js |
+850 lines (new) | Main visualization logic |
js/ui/yearbook_ui.js |
+650 lines (new) | Control panel UI with pagination |
js/deck-gl/core/yearbook_viewports.js |
+208 lines (new) | Multi-viewport grid & discontiguous tile loading |
src/celldega/viz/widget.py |
+206 lines | Python Yearbook class |
js/deck-gl/layers/image_layers.js |
+71 lines | Per-portrait image layer support |
js/widget.js |
+59 lines | Widget routing for Yearbook |
src/celldega/__init__.py |
+2 lines | Export Yearbook |
src/celldega/viz/__init__.py |
+2 lines | Export Yearbook |
Key Features Implemented
-
Yearbook Widget - Portrait grid visualization of selected cells
- Configurable
num_rows,num_cols,portrait_size_um - Centers each portrait on a specific cell
- Configurable
-
Multi-Viewport Architecture - Each portrait is a separate
OrthographicView- Synced zoom across all portraits (no panning)
layerFilterensures per-portrait image layers render only in their viewport
-
Discontiguous Tile Loading - Loads only tiles needed for visible portraits
- Shared cell/transcript/path layers across all viewports
- Per-portrait image layers with extent restrictions
-
Pagination - Navigate through cells when more than grid capacity
- Debounced to prevent rapid-click issues
- UI stays in sync with actual displayed content
-
Control Panel - Similar to Landscape widget
- Gene bars and cell bars based on visible transcripts/cells
- Image layer toggles, cell/transcript visibility sliders
cornhundred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces the "Yearbook" widget, a new visualization component for displaying cell portraits in a grid layout. The widget provides a synchronized, multi-viewport interface where each cell gets its own zoomed-in view, enabling detailed comparative analysis across multiple cells simultaneously.
Key Changes:
- Added new
Yearbookwidget class supporting configurable grid layouts with synchronized zoom - Implemented pagination for navigating through large cell collections
- Extracted reusable scale bar utilities for shared use across visualization components
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/celldega/viz/widget.py | Added Yearbook widget class with grid configuration, pagination, and cell metadata handling |
| src/celldega/viz/init.py | Exported Yearbook widget for public API |
| src/celldega/init.py | Added Yearbook to top-level package exports |
| pyproject.toml | Bumped version to 0.15.0a4 |
| package.json | Updated JavaScript package version to match |
| notebooks/Yearbook_HCRC.ipynb | Added example notebook demonstrating Yearbook usage with Xenium data |
| js/widget.js | Added render_yearbook function and integrated Yearbook component routing |
| js/viz/yearbook.js | Implemented core yearbook visualization logic with multi-viewport rendering and zoom synchronization |
| js/viz/landscape_ist.js | Refactored to use extracted scale_bar utility |
| js/utils/scale_bar.js | Extracted scale bar creation into reusable utility module |
| js/ui/yearbook_ui.js | Created yearbook-specific UI with pagination controls and bar graph updates |
| js/deck-gl/layers/image_layers.js | Added make_yearbook_image_layers for per-portrait image layer creation |
| js/deck-gl/core/yearbook_viewports.js | Implemented viewport management utilities for grid layout and discontiguous tile loading |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This pull request can be tested using the notebook Yearbook_HCRC.ipynb |
huanlity
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅. Works as expected.
What I really like
- The ability to zoom in/out from any viewport
- Reducing rows/columns automatically results in larger viewports
- Overall responsiveness
Things to consider
- Only the first (upper-left) viewport currently supports panning. I find this quite useful when users want to quickly inspect surrounding cells, so it might be worth extending this capability to other viewports as well.
- Adding a minimal label to each viewport could be helpful for displaying basic information about the focused cell. This can be part of a new PR and would be better implemented once we define the criteria/strategy for selecting representative cells.
- The viewport divider could be more visually distinct. Right now it’s a thin white space, which works in most cases, but when the image is turned off it becomes difficult to see viewport boundaries and relative transcript (trx) locations. A light grey divider might improve clarity.
Minor, but nice-to-have
- Automatically setting the cell marker size so users don’t need to worry about it. At minimum, we could limit it so it doesn’t exceed ¼ of the viewport area; similarly, limit the trx marker size to ⅛ of the viewport area.
- I assume the zoom threshold isn’t constrained yet but nice to have.
|
Thanks @huanlity, I actually intended to not allow panning in any viewport but we can fix that later. I want to add cell labels in another pull request.3 sounds good too for a subsequent pull request. Agree on the nice to haves for a future pull request. |
No description provided.