tangram_minisky¶
The tangram-side frontend plugin that renders live MiniSky traffic on a tangram map.
Plugin and configuration¶
tangram_minisky
¶
tangram frontend plugin rendering live traffic from a MiniSky simulator.
This package is deliberately frontend-only: it registers no API routes and
runs no background services inside tangram. All simulator-side logic (unit
conversion, snapshot publishing, command handling) lives in MiniSky's own
TANGRAM plugin (packages/minisky-tangram/src/minisky_tangram/__init__.py in the MiniSky repo),
which talks to tangram exclusively over Redis pub/sub:
to:<channel>:new-datafull state snapshots (aviation units)to:<channel>:consoleechoed simulator console outputfrom:<channel>:commandstack commands pushed from the browser
The only thing tangram needs from this package is the compiled frontend
bundle in dist-frontend and the configuration schema below.
plugin
module-attribute
¶
plugin = tangram_core.Plugin(frontend_path='dist-frontend', config_class=MiniskyConfig, frontend_config_class=MiniskyFrontendConfig, into_frontend_config_function=into_frontend)
MiniskyConfig
dataclass
¶
MiniskyFrontendConfig
dataclass
¶
MiniskyFrontendConfig(channel: str, topbar_order: Annotated[int, FrontendMutable()], sidebar_order: Annotated[int, FrontendMutable()])
The subset of MiniskyConfig served to the
browser. topbar_order and sidebar_order are marked FrontendMutable so
tangram can let the user reorder the widgets at runtime.
into_frontend
¶
into_frontend(config: MiniskyConfig) -> MiniskyFrontendConfig
Lower a MiniskyConfig into the
frontend-facing MiniskyFrontendConfig
that tangram serves to the browser.
Source code in packages/tangram-minisky/src/tangram_minisky/__init__.py
45 46 47 48 49 50 51 52 53 | |