diff --git a/docs/overview/file_formats.md b/docs/overview/file_formats.md index bbd0fce0..dae3a9e4 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/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); 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);