Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f19d8e2
add spatialdata.js dependencies
xinaesthete Jun 19, 2026
2300b25
initial implementation of spatial chart, dialog and related helpers
xinaesthete Jun 19, 2026
5546f78
fix mobx state for ShapesLayerPanel
xinaesthete Jun 19, 2026
026a7f0
Avoid new object churn in spatial data rendering with new render stac…
xinaesthete Jun 19, 2026
e9195aa
plan for local refactor
xinaesthete Jun 19, 2026
7c9a126
Consolidate spatial render stack adapters
xinaesthete Jun 19, 2026
3b7b6ac
add explicit zarrextra dependency and change version specifiers for s…
xinaesthete Jun 22, 2026
ea98581
bump spatialdata.js versions for fixed codec-worker build
xinaesthete Jun 22, 2026
2cbfc6a
enable chunk worker when using spatialdata
xinaesthete Jun 23, 2026
759718e
Clean up spatialdata chart config ownership
xinaesthete Jun 23, 2026
fa182d7
Merge branch 'feat/spatialdata_chart_0.2' into codex/spatialdata-char…
xinaesthete Jun 23, 2026
d51359d
partially working bridge for colour channel to use our ui
xinaesthete Jun 23, 2026
f74c1e4
wip image layer/colour panel refactor
xinaesthete Jun 24, 2026
555a062
plans for next step
xinaesthete Jun 24, 2026
129c313
new sd.js versions, add avivatorish
xinaesthete Jun 24, 2026
e189e8f
fix missing region in new chart config
xinaesthete Jun 24, 2026
ebbbdf6
intermediate work on image state, with annoying patch to tsconfig
xinaesthete Jun 24, 2026
a7a95d8
patches for spatialdata.js, should fix upstream
xinaesthete Jun 24, 2026
fcbaa3a
WIP image layer handling and channel management; replace deprecated r…
xinaesthete Jun 24, 2026
9068979
Image and channel ui mostly working but still laggy and bloated.
xinaesthete Jun 24, 2026
287e0e6
remove patches and use local version of sd.js while we stabilise API
xinaesthete Jun 25, 2026
82d570b
refactor(spatial): single source of truth for channel config + tone
xinaesthete Jun 25, 2026
d3436a7
chore(spatial): opt-in perf instrumentation for image render path
xinaesthete Jun 25, 2026
d6b6955
refactor(spatial): adopt library useChannelSelectionStats for channel…
xinaesthete Jun 25, 2026
b2e97bd
refactor(spatial): lean on react-compiler for tone/panel-context memo…
xinaesthete Jun 25, 2026
29331c3
chore(deps): relock @spatialdata/* to the re-packed tarballs with use…
xinaesthete Jun 25, 2026
1653d08
chore(deps): consume published @spatialdata/* 0.2.4 from npm
xinaesthete Jun 25, 2026
0b7b684
chore(deps): track @spatialdata/* via the npm `next` dist-tag
xinaesthete Jun 25, 2026
dd4b3fc
add general-purpose error handlingto SpatialLayer dialog elements
xinaesthete Jun 26, 2026
a7d435c
update sd.js, new version enables worker by default.
xinaesthete Jun 26, 2026
0dba021
fix worker config (hopefully)
xinaesthete Jun 26, 2026
e530b88
fix ImageLayerPanel default, remove depracated context
xinaesthete Jun 26, 2026
6d62737
use unique layer-id to allow multiple layers with same element
xinaesthete Jun 26, 2026
1780cd5
assert config must have renderStack
xinaesthete Jun 26, 2026
bb0fa13
filter out mdv 'deck:' layers in spatial layer dialog
xinaesthete Jun 26, 2026
3d8def8
spatial layer dialog has separate tree-view for arranging layers and …
xinaesthete Jun 26, 2026
b7ca58d
hide host deck layers in spatial dialog
xinaesthete Jun 26, 2026
80ec054
increase default height of layer dialog
xinaesthete Jun 26, 2026
72d23a1
use color inputs in ShapesLayerPanel and limit stroke width max
xinaesthete Jun 26, 2026
bf74623
add opacity control for shape color
xinaesthete Jun 26, 2026
0058653
comment-out props that don't work yet
xinaesthete Jun 26, 2026
6582d29
fix(spatial): address CodeRabbit review on PR #514
xinaesthete Jun 29, 2026
e4aac06
fix(spatial): silence trigger-dep biome warnings via bare references
xinaesthete Jun 29, 2026
0f30906
refactor(spatial): drop manual memoization the compiler now handles
xinaesthete Jun 30, 2026
f4c405c
fix(spatial): insert new spatial layers below host overlays
xinaesthete Jun 30, 2026
b135703
fix(spatial): restore manual memoization in observer-wrapped dialog
xinaesthete Jun 30, 2026
0eec915
fix(spatial): memoize ImageLayerPanel context value (observer, compil…
xinaesthete Jun 30, 2026
acbd220
fix(spatial): drive image-extent auto-fit from MDV, not the racy libr…
xinaesthete Jul 1, 2026
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
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ Triage uses the default labels: `needs-triage`, `needs-info`, `ready-for-agent`,
### Domain docs

Domain docs are configured as a single-context layout. See `.agents/domain.md`.

### Spatial image channel controls

For the SpatialData chart image layer panel (`ImageLayerPanel`, `ColorChannelComponents` spatial branch, `image_layer_runtime.ts`):

- Contrast limits, tone, and histogram brush must update **immediately** — do not debounce these writes.
- Persistence is MobX `renderStack` entry props (`channels`, `vivLayerProps`) via `useLayerChannelState` / `patchLayer`; the canvas reads those props through the Render Stack Adapter.
- Per-panel zustand (`VivProvider`) is a one-way UI projection only, not a second persistence path.
- If controls lag or the histogram brush fights itself, fix state ownership/wiring (see `docs/spatialdata-vis-integration.md` § Image channel controls). Debouncing here masks design problems.
- Do not bump `renderStackGeneration` on in-place `props` patches (channels, tone, opacity); that recreates `vivPassthrough` and stalls the spatial renderer.
18 changes: 17 additions & 1 deletion CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,20 @@ detail, no decisions. Decisions that are hard to reverse live in `docs/adr/`.

- **Installer / lockfile manager** — the tool that resolves, locks, and installs
dependencies into an environment (e.g. `uv`, `pip`, `poetry`). Produces the lockfile
(`uv.lock`). Independent of the build backend.
(`uv.lock`). Independent of the build backend.

## SpatialData.js integration terms

Canonical rendering vocabulary lives in [SpatialData.js CONTEXT.md](https://github.com/Taylor-CCB-Group/SpatialData.js/blob/main/CONTEXT.md). MDV chart code uses the same terms:

- **Render Stack** — saved draw order on chart config (`renderStack.entries`), not parallel `layerOrder` arrays
- **Stack Entry** — one ordered item (`kind: spatial | host | group`)
- **Host Overlay** — MDV deck layer referenced by `hostLayerId` in the stack, resolved at runtime
- **Runtime Attachment** — `hostLayerResolver`, tooltip hooks, `deckProps`; not serialized in `entry.props`
- **Image Layer Registry** — chart-owned runtime attachment (`SpatialDataMdvReact`): callbacks that expose loaded Viv image data (`getImageLoadedDataByElementKey`, load state) from the spatial renderer. The viewer populates it; the layer dialog consumes it via `ImageLayerContextProvider`. Bridges separate React trees (chart vs dialog portal) without duplicating image load paths.
- **Spatial Image Panel Context** — React context on [`ImageLayerPanel`](src/react/components/spatialLayers/ImageLayerPanel.tsx): wraps `ImageLayerContextProvider` (upstream loaded-image defaults) and exposes `useLayerChannelState` write API (`setChannels`, `addChannel`, `removeChannel`) to channel UI. Persisted field edits go through the hook, not zustand `channelsStore`.
- **Image Layer Runtime Bridge** — pure helpers in `image_layer_runtime.ts`: `channelId`-keyed stats cache (`domains`, `raster`), viewer parallel-array sync (`channelOptions`, loading flags), and tone → `vivLayerProps` helpers. Not a second MobX persistence bridge.
- **MobX Control Island** — layer dialog UI that patches `config.renderStack` directly
- **Layer Channel Config** — serializable image channel state on `renderStack.entries[].props.channels` (`ChannelConfig` in `@spatialdata/vis`): colors, contrast limits, visibility, selections, and extension-related data fields. Tone (brightness/contrast) is **not** part of `channels`; it persists in `entry.props.vivLayerProps`. Distinct from runtime UI state in avivatorish stores.
- **Root Viv Config** — MDV-only legacy path where `VivMdvReact` serializes `config.viv.channelsStore` on the chart root. Not used by the SpatialData chart; not an upstream SpatialData.js concern.
- **App Viv Extensions** — runtime attachment: host app supplies Viv `LayerExtension` instances (and passes related props into the renderer). Extension classes are not serialized; extension data may live on Layer Channel Config when persistence is needed.
213 changes: 213 additions & 0 deletions docs/spatialdata-vis-integration.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
"@radix-ui/react-radio-group": "^1.1.3",
"@react-spring/web": "^10.0.3",
"@slickgrid-universal/common": "10.6.0",
"@spatialdata/avivatorish": "^0.2.5",
"@spatialdata/core": "^0.2.5",
"@spatialdata/layers": "^0.2.5",
"@spatialdata/react": "^0.2.5",
"@spatialdata/vis": "^0.2.5",
"@tanstack/react-query": "^5.80.0",
"@tanstack/react-virtual": "^3.11.1",
"@turf/clone": "6.5.0",
Expand Down Expand Up @@ -171,6 +176,7 @@
"use-debounce": "^10.0.2",
"uuid": "^11.1.1",
"wordcloud": "^1.2.2",
"zarrextra": "^0.2.3",
"zod": "^3.25.49",
"zustand": "^5.0.6"
},
Expand Down
Loading
Loading