Add tangram bridge: TANGRAM plugin, frontend package, and docs - #19
Conversation
…er Redis Publishes SI-unit snapshots to to:<channel>:* (rate-capped via tangram_max_hz) and listens for stack commands on from:<channel>:*. Redis ships as an optional extra (uv sync --extra tangram); tests run against fakeredis in the dev group. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…trol widgets) Vue/TS tangram plugin package with an aircraft map layer, trail layer, aircraft-count and sim-control widgets; frontend build output ignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Hi @abc8747, I have moved the plugin here. Ill work on getting it to match xoolive/traffic#531 Regarding the simulation time controls. Currently minisky can stream a simulation and exposes controls such as play, stop, reset, and changing speed. I suspect these could get out of sync with other tangram plugins since minisky takes care of its own clock. It is possible to control the simulation without using the stream server. see here. In this way the minisky tangram plugin can effectively control the speed of the simulation and stay in sync with other data. Note that minisky does not yet support rewinding. Not sure if this is something that will be necessary. |
Match the setup recommended in the tangram plugin guide (https://mode-s.org/tangram/plugins/frontend/) and xoolive/traffic#531: - make example_plugins/tangram_minisky a uv workspace member, so `uv sync --all-packages` installs tangram_core and the plugin (editable) into the repo venv; `uv run tangram serve` / `check-plugin` then work straight from this repository - add tsconfig.vite.json (extends tangram-core's tsconfig.node.json) and the documented @ts-expect-error for the vite-plugin subpath that ships without declarations in tangram_core 0.5.0 - add eslint (typescript-eslint + eslint-plugin-vue) and vue-tsc with lint / typecheck / typecheck:vite / check npm scripts; fix the one real finding (btoa browser global) and the auto-fixable style issues - extend pyright to example_plugins and fix what it found: a dict typing error in tangram.py and Optional-access bugs in example.py - align npm dependency ranges with tangram-core 0.5.0 so `tangram check-plugin` passes - document the dev commands, the workspace run route, and the tangram_exe pattern for running against a local tangram checkout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| bridge = None | ||
|
|
||
|
|
||
| def convert_snapshot(snapshot: dict[str, Any]) -> dict[str, Any]: |
There was a problem hiding this comment.
I'm not too familiar with minisky, but is there a TypedDict or dataclass defined somewhere which we can use as annotations instead of bare dicts? Since pyright is already setup I prefer removing these untyped .get() calls (ideally strict mode too)
There was a problem hiding this comment.
I think this applies to the entire file too, there are lots of bare dict[str, Any] manipulations that are difficult to keep track of
There was a problem hiding this comment.
I currently get a bunch of failures when we do strict mode. so for now, I will just enforce on plugins and then in future can update core
|
@amorfinv Thanks! I'll work on improving/exposing the clock API in the tangram core (play, pause, playback speed) and hope to get it done by Thursday. It will very much look like this in the video (let me know if you would like anything!). Fyi, I haven't used bluesky (or any air traffic simulator) at all so I don't know too much about its internals/typical painpoints. I assume when you say "lack of rewinding" it's because it's not always possible to step physics or controller actions backward. But let's say I need to seek backward from Before I start designing the historical playback side of tangram, can you tell me what are some long-standing missing functionality you'd like to see in minisky? I'm happy to start contributing to minisky but I might only be free starting mid-Aug |
|
Hi @abc8747 thanks for all the comments. I should have some time to go over them later this week/weekend. You are assumption about rewind is correct. currently, the only way to go from Regarding, the clock api, I think an important part would probably be to enforce that the slowest component dictates the speed. For example, let's say we have quite a large minisky simulation. If we request a playback speed of 10x it could happen that we can only reach 5x in minisky because conflict detection is quite slow. I will try to put this into a list somewhere else but there are a couple of parts of minisky that could use some work. These are in no particular order and vary in difficulty.
If you want to play a bit with air traffic simulator you can check my website. I currently only support bluesky simulations but also hoping to add minisky soon |
This is not an easy problem actually, and maybe it shouldn't be solved with a quick generic patch making it look easy. Still, it is a nice use case to be able to replay history (tangram_history) and compare with the result of a simulation, provided a scenario reconstruction strategy. I will be your first client 👍 |
|
Hi @xoolive. Yeah this will likely be quite challenging. Also perhaps it does not actually belong in the core code since it is mostly scenario generation. |
process() used to iterate cmdstack and then clear it, so a command appended by another thread (e.g. the tangram Redis listener) in the window between the loop ending and the clear was silently dropped. Stack.commands() now detaches the pending list up front: a racing append lands either on the detached list (runs this step) or the fresh one (runs next step).
|
@amorfinv Thanks! I will take a closer look at it later tonight. The clock API is not ready yet because I was busy working on integrating navaids/fixes/field 15 to tangram over at open-aviation/tangram#313, but once it is merged, we will release v0.6 then I think we can start working on it in tangram v0.7 |
|
@abc8747 Ok awesome! Which x-plane data version are you using? i could not find license info about x-plane 11 |
|
I'm not too sure about the xplane data version because the
Btw, I remember the xplane site used to say data is licensed under GPL, but after some digging it seems like the GPL clause was removed from the website somewhere between 2026-01-21 and 2026-02-07 🤔 Edit: 1901 is the likely AIRAC version |
…ace/lock removes duplicate `uv.lock` and `.venv`. - docs: replace all `npm` with `pnpm` - upgrade to pnpm v11 and update ci - remove python version pin - remove brittle automated `just link_core`
fixes #19 (comment) temporarily expose config, which will be refactored away when we work on #24
…ugin id addresses #19 (comment) continues work in fb70b16
Summary
TANGRAMexample plugin (example_plugins/tangram.py) bridging the simulation to a tangram deployment over Redis: publishes SI-unit snapshots onto:<channel>:*(wall-clock rate-capped viatangram_max_hz) and listens for stack commands onfrom:<channel>:*uv sync --extra tangram);fakeredisadded to the dev group so tests need no Redis servertangram_miniskyfrontend plugin package (Vue/TS): aircraft map layer, trail layer, aircraft-count and sim-control widgetsdocs/guides/tangram.mdwired into the mkdocs navTest plan
uv run pytest tests/unit/test_tangram_plugin.py tests/integration/test_tangram_bridge.py— 19 passed🤖 Generated with Claude Code