From 75ae78c8a60ea738d20dc86cb28d2fb0cf562005 Mon Sep 17 00:00:00 2001 From: Nicolas Fernandez Date: Tue, 1 Jul 2025 10:50:06 -0400 Subject: [PATCH 1/2] feat(viz): support cell-layer-only view --- docs/overview/file_formats.md | 6 +++++- js/viz/landscape_ist.js | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/overview/file_formats.md b/docs/overview/file_formats.md index bbd0fce0..598ce0e2 100644 --- a/docs/overview/file_formats.md +++ b/docs/overview/file_formats.md @@ -159,10 +159,14 @@ This file contains the configuration information about the dataset. See example ] } ], - "image_format": ".webp" + "image_format": ".webp", + "cell_layer_only": false } ``` +Setting `cell_layer_only` to `true` will render only the cell layer without +transcripts, cell boundaries, or images. + #### Gene Metadata The `gene_metadata.parquet` file contains gene level metadata including: average expression across all cells, standard deviation, max expression, proportion of cells with non-zero expression, and the color assigned to each gene. See example below: diff --git a/js/viz/landscape_ist.js b/js/viz/landscape_ist.js index f37eab62..7af52bde 100644 --- a/js/viz/landscape_ist.js +++ b/js/viz/landscape_ist.js @@ -273,6 +273,8 @@ export const landscape_ist = async ( await set_landscape_parameters(viz_state.img, base_url, viz_state.aws); + const cell_layer_only = + viz_state.img.landscape_parameters.cell_layer_only === true; const tmp_image_info = viz_state.img.landscape_parameters.image_info; viz_state.vector_name_integer = @@ -397,7 +399,12 @@ export const landscape_ist = async ( update_trx_layer_radius(layers_obj, trx_radius); - if (viz_state.umap.state === true) { + if (cell_layer_only) { + toggle_background_layer_visibility(layers_obj, false); + toggle_visibility_image_layers(layers_obj, false); + toggle_trx_layer_visibility(layers_obj, false); + toggle_path_layer_visibility(layers_obj, false); + } else if (viz_state.umap.state === true) { toggle_background_layer_visibility(layers_obj, false); toggle_visibility_image_layers(layers_obj, false); toggle_trx_layer_visibility(layers_obj, false); From 849291fc28ac167dbb461be664b8949fd09bd0bb Mon Sep 17 00:00:00 2001 From: Nicolas Fernandez Date: Tue, 1 Jul 2025 11:00:15 -0400 Subject: [PATCH 2/2] Disable close-up mode in cell-layer-only mode --- docs/overview/file_formats.md | 2 +- js/deck-gl/core/calc_viewport.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/overview/file_formats.md b/docs/overview/file_formats.md index 598ce0e2..dae3a9e4 100644 --- a/docs/overview/file_formats.md +++ b/docs/overview/file_formats.md @@ -160,7 +160,7 @@ This file contains the configuration information about the dataset. See example } ], "image_format": ".webp", - "cell_layer_only": false + "cell_layer_only": false } ``` diff --git a/js/deck-gl/core/calc_viewport.js b/js/deck-gl/core/calc_viewport.js index 45422cf1..ce75fe20 100644 --- a/js/deck-gl/core/calc_viewport.js +++ b/js/deck-gl/core/calc_viewport.js @@ -9,8 +9,11 @@ export const calc_viewport = async ( layers_obj, viz_state ) => { - const { tile_size } = viz_state.img.landscape_parameters; - const max_tiles_to_view = 50; + const { tile_size, cell_layer_only } = + viz_state.img.landscape_parameters; + // Setting max_tiles_to_view to 0 prevents close_up mode from + // being triggered, which avoids fetching sub-cellular parquet files + const max_tiles_to_view = cell_layer_only === true ? 0 : 50; const zoomFactor = Math.pow(2, zoom); const [targetX, targetY] = target; const halfWidthZoomed = width / (2 * zoomFactor);