chore: live-data example WebSocket host (ws → addToDataset) - #3687
Merged
Conversation
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a WebSocket-based “live updates” mode to the examples/live-data host app, demonstrating the “transport pattern” of mapping ws messages into addToDataset (without making kepler.gl itself a WebSocket client).
Changes:
- Add a minimal Node WebSocket hub (
upgradehandling + periodic JSON broadcast) to the live-data CSV server. - Add a new “WebSocket” mode to the live-data example UI that connects to
LIVE_WS_URLand upserts incoming rows viaaddToDataset. - Update example docs and changelog to describe the new mode and configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/README.md | Updates the examples index to mention the new WebSocket mode in Live Data. |
| examples/live-data/websocket.mjs | New minimal WebSocket hub implementation used by the live-data server. |
| examples/live-data/src/app.tsx | Adds “WebSocket” UI mode and client-side mapping from WS messages to addToDataset. |
| examples/live-data/server.mjs | Serves a WS endpoint alongside CSV and broadcasts periodic JSON upserts. |
| examples/live-data/README.md | Documents the new WebSocket mode behavior and intent (transport pattern). |
| examples/live-data/esbuild.config.mjs | Injects process.env.LIVE_WS_URL for the example build. |
| CHANGELOG.md | Notes the new live-data example WebSocket mode in Unreleased. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
lixun910
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a WebSocket mode to the live-data example. Kepler.gl is not a websocket client: the host app opens
ws://localhost:4010/vehicles.wsand maps each JSON upsert toaddToDataset(..., {upsertBy: 'id'}). Threews-*points move on a 20s loop; layer id and style stay put. Kepler still rebuilds layer data on every message (no incremental deck path).Related issues
ws → addToDataset). It does not add a Kepler websocket client, a streaming dataset type, or a cheaper layer rebuild. render realtime data coming from websocket for example #322 stays open for incremental deck updates.addToDataset/ upsert-by-id API (already landed). DuckDB/Arrow in-place edits are out of scope.This PR does not close #322 or #176.
Test plan
yarn start:live-data, wait for the 3 CSV points, switch to WebSocketws-01…ws-03keep moving; ids do not keep growingopenand a rising message count