Skip to content
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

bringing in Clustergrammer-PY back-end #53

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/python/clust/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Clust Module API Reference

::: celldega.clust
10 changes: 5 additions & 5 deletions docs/python/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Python API Overview

## [Neighborhood Overview](nbhd/api)
The `nbhd` module contains methods for calculating tissue neighborhoods.

## [Pre Module Overview](pre/api)

The `pre` module contains methods for pre-processing LandscapeFiles.

## [Clust Module Overview](clust/api)
The `clust` module contains methods for clustering high-dimensional data.

## [Viz Module Overview](viz/api)
## [Neighborhood Overview](nbhd/api)
The `nbhd` module contains methods for calculating tissue neighborhoods.

## [Viz Module Overview](viz/api)
The `viz` module contains functions and classes for data visualization.
2 changes: 0 additions & 2 deletions docs/python/nbhd/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Neighborhood Module API Reference

<!-- ::: celldega.pre.landscape -->
<!-- ::: celldega.pre -->
::: celldega.nbhd
2 changes: 1 addition & 1 deletion docs/python/viz/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

## Widget Classes

::: celldega.viz.widget
::: celldega.viz

14 changes: 10 additions & 4 deletions js/deck-gl/make_tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export const make_tooltip = (viz_state, info) => {
let inst_name = ''
let inst_cat = ''

console.log(info.layer.id)

if (info.layer.id.startsWith('cell-layer') || info.layer.id.startsWith('path-layer')) {
inst_name = info.layer.id.startsWith('cell-layer') ? viz_state.cats.cell_names_array[info.index] : viz_state.cats.polygon_cell_names[info.index]
inst_cat = viz_state.cats.dict_cell_cats[inst_name]
Expand All @@ -26,8 +24,16 @@ export const make_tooltip = (viz_state, info) => {
inst_html = `<div>neighborhood: ${inst_name}</div><div>cluster: ${inst_cat}</div>`
}

d3.selectAll('.deck-tooltip')
.style('margin-top', '75px')
// d3.selectAll('.deck-tooltip')
// .style('margin-top', '75px')

// console.log(viz_state.root)

// select the parent element of .deck-tooltip within viz_state.root
const tooltipContainer = viz_state.root.querySelector('.deck-tooltip');
tooltipContainer.style.marginTop = '50px'
const tooltipParent = tooltipContainer.parentElement.parentElement;
tooltipParent.style.position = 'unset'

return {
html: inst_html,
Expand Down
7 changes: 5 additions & 2 deletions js/deck-gl/matrix/matrix_tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ export const get_tooltip = (viz_state, params) => {

const {object, layer} = params;

d3.selectAll('.deck-tooltip')
.style('margin-top', '50px')
// select the parent element of .deck-tooltip within viz_state.root
const tooltipContainer = viz_state.root.querySelector('.deck-tooltip');
tooltipContainer.style.marginTop = '50px'
const tooltipParent = tooltipContainer.parentElement.parentElement;
tooltipParent.style.position = 'unset'

if (object) {
// Check which layer the tooltip is currently over
Expand Down
2 changes: 2 additions & 0 deletions js/viz/landscape_ist.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const landscape_ist = async (

let viz_state = {}

viz_state.root = el

viz_state.buttons = {}
viz_state.buttons.blue = '#8797ff'
viz_state.buttons.gray = 'gray'
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ nav:
- Python API:
- python/index.md
- pre: python/pre/api.md
- clust: python/clust/api.md
- nbhd: python/nbhd/api.md
- viz: python/viz/api.md

- JavaScript API:
Expand All @@ -39,6 +41,7 @@ nav:
- examples/index.md
- Brief Notebooks:
- Landscape View Xenium: examples/brief_notebooks/Landscape_View_Xenium.ipynb
- Landscape-Matrix View Xenium: examples/brief_notebooks/Landscape-Matrix_Xenium.ipynb
- Pre-Process LandscapeFiles: examples/brief_notebooks/Pre-process_Xenium_V1_human_Pancreas_FFPE_outs.ipynb
# - Tutorials:
# - examples/Landscape_View_Xenium.ipynb
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies = [
"imagecodecs~=2024.1.1",
"scanpy~=1.10.2",
"squidpy~=1.5.0",
"clustergrammer2==0.18.0",
"shapely~=2.0.5",
"polars~=1.10.0",
"libpysal~=4.8.1"
Expand Down
2 changes: 2 additions & 0 deletions src/celldega/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from celldega.pre import landscape
from celldega.nbhd import alpha_shape

from celldega.clust import Network

# temporary fix for libpysal warning
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
Expand Down
Loading
Loading