Skip to content

Conversation

@cornhundred
Copy link
Collaborator

No description provided.

@cornhundred
Copy link
Collaborator Author

cornhundred commented Dec 4, 2025

Overview of yearbook_opus Branch Changes

Files Changed

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

  1. Yearbook Widget - Portrait grid visualization of selected cells

    • Configurable num_rows, num_cols, portrait_size_um
    • Centers each portrait on a specific cell
  2. Multi-Viewport Architecture - Each portrait is a separate OrthographicView

    • Synced zoom across all portraits (no panning)
    • layerFilter ensures per-portrait image layers render only in their viewport
  3. 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
  4. Pagination - Navigate through cells when more than grid capacity

    • Debounced to prevent rapid-click issues
    • UI stays in sync with actual displayed content
  5. Control Panel - Similar to Landscape widget

    • Gene bars and cell bars based on visible transcripts/cells
    • Image layer toggles, cell/transcript visibility sliders

Copy link
Collaborator Author

@cornhundred cornhundred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ready for testing

@cornhundred cornhundred marked this pull request as ready for review December 12, 2025 21:16
@cornhundred cornhundred requested a review from Copilot December 12, 2025 21:16
Copy link
Contributor

Copilot AI left a 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 Yearbook widget 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.

@cornhundred
Copy link
Collaborator Author

This pull request can be tested using the notebook Yearbook_HCRC.ipynb

Copy link
Contributor

@huanlity huanlity left a 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

  1. The ability to zoom in/out from any viewport
  2. Reducing rows/columns automatically results in larger viewports
  3. Overall responsiveness

Things to consider

  1. 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.
  2. 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.
  3. 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

  1. 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.
  2. I assume the zoom threshold isn’t constrained yet but nice to have.

@cornhundred
Copy link
Collaborator Author

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.

@cornhundred cornhundred merged commit d9f38d1 into main Dec 15, 2025
10 checks passed
@cornhundred cornhundred deleted the yearbook_opus branch December 15, 2025 17:23
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.

3 participants