Skip to content

Fix visium#1067

Merged
alexvpickering merged 8 commits into
masterfrom
fix-visium
Jul 15, 2026
Merged

Fix visium#1067
alexvpickering merged 8 commits into
masterfrom
fix-visium

Conversation

@alexvpickering

@alexvpickering alexvpickering commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Adds multi-sample spatial layout with metadata-based grouping in Data Exploration: samples can be grouped into rows by a sample-level metadata track (via a rewritten group-by settings panel), with a shared grid layout keeping images, segmentations, centroids, and molecules aligned. Single-sample spatial plots now cap their view to the tissue extent (reading the pipeline's originalSize) so blank padding isn't shown, and segmentation overlays render with crisp nearest-neighbour pixels. Also includes performance fixes for large experiments — cheaper cell-set union/count passes, a memoised cell-set-hierarchy selector, cached colour parsing and zarr metadata — plus hiding the tissue image by default.

Details

URL to issue

N/A

Link to staging deployment URL (or set N/A)

N/A

Links to any PRs or resources related to this PR

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.
  • All new dependency licenses have been checked for compatibility.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

Add a grouping picker to the spatial tile settings: the default
"Samples" view is a flat grid that follows the Cell sets & metadata
sample order and re-lays out when samples are reordered there; picking a
metadata track instead arranges samples one group per row. A shared slot
map keeps the image grid, segmentation grid, centroids and molecules
aligned.

Also: hide tissue images by default, fill empty grid cells with the
neutral background, and guard out-of-bounds tile requests when the grid
resizes. Speed up regrouping by memoising zarr roots and multiscale
metadata and by skipping hidden image tiles.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
Single-sample spatial plots (QC, Plots & Tables) defaulted their zoom to
the full padded canvas, showing blank margins. Read the pipeline-written
originalSize from the image OME-Zarr and use it for the initial domain
and zoom-out bounds, keeping the y-flip anchored to the padded height.
Falls back to the full extent when originalSize is absent.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
Hiding/selecting clusters lagged in large experiments. Memoise the cell
set hierarchy on hierarchy/properties only, so hide/select no longer
churns it (and every downstream consumer). Count selected cells in one
pass instead of building several full-size Sets, drop the array-spread
in union, and cache colour parsing when building the bitmask LUT.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
This reverts commit a10731f.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
@alexvpickering alexvpickering added the safe to run Sensitive jobs are safe to be run label Jul 15, 2026
@dbmi-svc-checkmarx

dbmi-svc-checkmarx commented Jul 15, 2026

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details4b7650e4-7f70-478f-9dc4-5736119e43f9


New Issues (3) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 HIGH CVE-2026-62389 Npm-ws-7.4.6
detailsRecommended version: 7.5.0
Description: ws before 8.21.1 contains a memory exhaustion vulnerability in lib/receiver.js where the fragment guard only triggers when fragment count reaches m...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
2 HIGH CVE-2026-62389 Npm-ws-7.5.9
detailsDescription: ws before 8.21.1 contains a memory exhaustion vulnerability in lib/receiver.js where the fragment guard only triggers when fragment count reaches m...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package
3 HIGH CVE-2026-62389 Npm-ws-8.14.2
detailsRecommended version: 8.17.1
Description: ws before 8.21.1 contains a memory exhaustion vulnerability in lib/receiver.js where the fragment guard only triggers when fragment count reaches m...
Attack Vector: NETWORK
Attack Complexity: LOW
Vulnerable Package

Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 686.51 KB (🟡 +22 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/experiments/[experimentId]/data-exploration 1.51 MB (🟡 +799 B) 2.18 MB
/experiments/[experimentId]/data-processing 515.37 KB (🟡 +288 B) 1.17 MB
/experiments/[experimentId]/plots-and-tables/frequency 448.27 KB (-2 B) 1.11 MB
/experiments/[experimentId]/plots-and-tables/spatial-categorical 485.71 KB (🟡 +130 B) 1.14 MB
/experiments/[experimentId]/plots-and-tables/spatial-feature 491.6 KB (🟡 +163 B) 1.15 MB
/experiments/[experimentId]/plots-and-tables/spatial-molecules 643.98 KB (🟡 +338 B) 1.3 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.19018% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.02%. Comparing base (c7246a2) to head (41e674c).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...data-exploration/spatial/createZarrArrayAdapter.js 5.55% 12 Missing and 5 partials ⚠️
...ponents/data-exploration/spatial/SpatialViewer.jsx 69.38% 15 Missing ⚠️
...ata-exploration/spatial/SpatialGroupBySettings.jsx 7.14% 13 Missing ⚠️
...components/data-exploration/spatial/loadOmeZarr.js 12.50% 6 Missing and 1 partial ⚠️
...mponents/data-exploration/spatial/bitmaskLayers.js 25.00% 5 Missing and 1 partial ⚠️
src/components/plots/useSpatialStream.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1067      +/-   ##
==========================================
+ Coverage   77.01%   77.02%   +0.01%     
==========================================
  Files         607      608       +1     
  Lines       14678    14763      +85     
  Branches     3670     3710      +40     
==========================================
+ Hits        11304    11371      +67     
- Misses       3160     3173      +13     
- Partials      214      219       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 686.52 KB (🟡 +38 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/experiments/[experimentId]/data-exploration 1.51 MB (🟡 +1022 B) 2.18 MB
/experiments/[experimentId]/data-processing 515.37 KB (🟡 +288 B) 1.17 MB
/experiments/[experimentId]/plots-and-tables/frequency 448.27 KB (-2 B) 1.11 MB
/experiments/[experimentId]/plots-and-tables/spatial-categorical 485.71 KB (🟡 +130 B) 1.14 MB
/experiments/[experimentId]/plots-and-tables/spatial-feature 491.6 KB (🟡 +163 B) 1.15 MB
/experiments/[experimentId]/plots-and-tables/spatial-molecules 643.98 KB (🟡 +338 B) 1.3 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Signed-off-by: Alex Pickering <alexvpickering@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 686.52 KB (🟡 +38 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/experiments/[experimentId]/data-exploration 1.51 MB (🟡 +1.11 KB) 2.18 MB
/experiments/[experimentId]/data-processing 515.37 KB (🟡 +288 B) 1.17 MB
/experiments/[experimentId]/plots-and-tables/frequency 448.27 KB (-2 B) 1.11 MB
/experiments/[experimentId]/plots-and-tables/spatial-categorical 485.71 KB (🟡 +130 B) 1.14 MB
/experiments/[experimentId]/plots-and-tables/spatial-feature 491.6 KB (🟡 +163 B) 1.15 MB
/experiments/[experimentId]/plots-and-tables/spatial-molecules 643.98 KB (🟡 +338 B) 1.3 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

@alexvpickering
alexvpickering merged commit 1f719d0 into master Jul 15, 2026
14 checks passed
@alexvpickering
alexvpickering deleted the fix-visium branch July 15, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to run Sensitive jobs are safe to be run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants