Documentation

Introduction

@infoplaza/platform

React components and providers for Infoplaza weather on a MapLibre map, plus a portable timeseries forecast table, timeseries charts, and ensemble plume charts. PlatformMap is the general map shell; weather is optional via WeatherLayers.

What you get

Four sibling products, one package. Import each from its own entry point — do not nest timeseries, timeseries charts, or ensemble under the map barrel.

  • Map — PlatformMap ± WeatherLayers (providers, events, Deck overlay, HUD).
  • Timeseries — location-aware forecast table. Catalog and rows load through PlatformAuth.
  • Timeseries charts — Recharts LINE / DIRECTION / VALUE / PRECIPITATION_TYPE charts from the same timeseries catalog.
  • Ensemble — plume / line / bar charts from the ensemble catalog.

What you need

  • A React 18 or 19 application.
  • An API token from the Infoplaza developer platform, plus the platform auth route mounted on your server with PLATFORM_API_KEY — this powers the internal models and forecast requests. See Server setup.
  • For maps: a MapLibre style (built-in MAP_STYLES or your own) and MapLibre 6 worker wiring. See MapLibre 6.
  • Package styles imported once: @infoplaza/platform/styles.css or styles.embed.css in a Tailwind host. See Styling.
  • MapLibre CSS imported once: maplibre-gl/dist/maplibre-gl.css.

Entry points

Prefer the subpath that matches the product. The top-level @infoplaza/platform barrel re-exports map components, providers, layers, and defaults — not auth, events, timeseries, timeseries charts, ensemble, or CSS.

Imports

ImportTypeDefaultDescription
@infoplaza/platformbarrel—Top-level API: PlatformMap, WeatherLayers, providers, LayerComposer / LayerOverlay, MAP_STYLES.
@infoplaza/platform/componentsmap—PlatformMap, WeatherLayers, BaseMap, MapControlHud.
@infoplaza/platform/providersmap—Providers, usePlatformMap, useModels, useProviders.
@infoplaza/platform/defaultsmap—MAP_STYLES, MapStyle type, beforeId constants.
@infoplaza/platform/authserver—PlatformAuth catch-all route handler.
@infoplaza/platform/eventsmap—MapEventsProvider.
@infoplaza/platform/layersmap—LayerComposer, LayerOverlay. Deep imports /composer and /overlay.
@infoplaza/platform/timeseriestable—TimeseriesForecast, models/provider, toolbar, builder, chart, footer.
@infoplaza/platform/timeseries-chartscharts—TimeseriesChartsForecast, models/provider, toolbar, builder, chart, graph.
@infoplaza/platform/ensemblecharts—EnsembleForecast, models/provider, toolbar, builder, chart, graph.
@infoplaza/platform/styles.csscss—Full stylesheet including Tailwind preflight — standalone apps.
@infoplaza/platform/styles.embed.csscss—Prefixed utilities only, no preflight — Tailwind hosts.
Weather models are fetched internally by Providers / WeatherLayers. Timeseries and ensemble catalogs load the same way. You must create an API token and mount the auth route — without them, maps, tables, and charts will not load data.

Next steps

  1. Install the package and peer maplibre-gl.
  2. Create an API token on the Infoplaza developer platform.
  3. Mount PlatformAuth with PLATFORM_API_KEY.
  4. Follow the Quick start for a map, or jump to timeseries / ensemble.
  5. See live API request counts and token credits in the platform examples: maps and charts (timeseries and ensemble).
npm install @infoplaza/platform maplibre-gl