Skip to content

feat: heatmap render mode & FeatureCollection for Live Data Sources#114

Merged
ThomasHalwax merged 7 commits into
mainfrom
live-data-sources-improvement
May 21, 2026
Merged

feat: heatmap render mode & FeatureCollection for Live Data Sources#114
ThomasHalwax merged 7 commits into
mainfrom
live-data-sources-improvement

Conversation

@ThomasHalwax
Copy link
Copy Markdown
Member

@ThomasHalwax ThomasHalwax commented Apr 24, 2026

Summary

Extends Live Data Sources (SSE) with a heatmap render mode and support for FeatureCollection payloads, enables copy & paste for live data sources, plus a property-panel performance fix.

Changes

Features

  • Support FeatureCollection payloads in SSE streams (in addition to single Feature); per-feature IDs are prefixed consistently
  • New heatmap render mode per SSE service (alternative to vector), configurable via heatmapRadius, heatmapBlur, heatmapOpacity, accumulation heatmapInterval, and maxHeatmapFeatures cap (oldest evicted when exceeded)
  • properties.confidence is mapped to a weight attribute driving heatmap intensity (fallback 0.5)
  • Vector-mode opacity (vectorOpacity) now configurable per service
  • Live data sources can now be duplicated via copy & paste like other objects: the pasted copy gets a fresh id and feature namespace and is inserted with enabled: false

Fixes

  • Extracted connection status and live stats into independent sub-components — their 1 Hz polling no longer triggers re-renders of the surrounding properties form during streaming
  • Null-safe access in the SSE resolution strategy
  • ids.ord now sorts all entity types before their dependent entries (link/tags/style); the previous order processed tags before their owning sse-service/tile-service, leaving the remapped tags key broken on paste
  • Guard against a crash when deleting a tagged sse-service or marker: deleting the object emits a del op for its tags entry, which made SearchIndex rebuild the (already removed) owner's document; the sse-service and marker document handlers now return null for a missing entry, matching the tile-service/layer handlers

Spec

docs/live-data-source.md documents the base SSE feature. The new FeatureCollection support aligns with its "Data Format" section; the heatmap render mode is not yet documented — follow-up doc update recommended.

ThomasHalwax and others added 7 commits February 16, 2026 11:34
The change handlers coerced empty input to the default via `parseInt('') || default`,
which snapped state back to the default on every keystroke that produced an empty
or non-numeric intermediate value. Now the raw string is kept in state during
editing and only parsed (with defaulting) on blur.

Affects updateInterval, heatmapRadius, heatmapBlur, heatmapInterval,
maxHeatmapFeatures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Live data sources (sse-service entries) could not be duplicated via
copy & paste like other objects.

- Clipboard.canCopy: accept sse-service ids
- Import.clone: rewrite sse-service keys to a fresh id so paste creates
  a copy instead of overwriting the original; the copy gets a new
  featureIdPrefix namespace and is inserted with enabled: false
- ids.ord: sort all entity types before their dependent entries
  (link/tags/style). The previous order processed tags before their
  owning sse-service/tile-service, leaving the remapped tags key broken.
- add Import.clone tests for sse-service duplication
Deleting a tagged object emits a del op for its tags entry. SearchIndex
treats that as an associated change and rebuilds the owner's document,
but the owner is already gone, so the document handler received an
undefined entry and crashed on `.name`.

The tile-service and layer handlers already guard for this; add the
same `if (!entry) return null` guard to the sse-service and marker
handlers.
@ThomasHalwax ThomasHalwax merged commit 379ff94 into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant