Parse Vector, Raster, NetCDF, GRIB2 or Zarr into a lazy Dataset; clip, mask, reclassify, reproject and reduce it with real spatial operations; render it through Google Maps or Leaflet. Quickly set up visualization and analysis elements for your web application.
dist/fimviz.js running on this page.
Four calls put a flood raster on a map. Everything else composes from the same three objects.
import { FimViz } from 'fimviz';
// Mount the engine with your preferred map provider.
const fim = await FimViz.mount('#map', { provider: 'leaflet' });
// Parse, transform and store your data in the application state
const ds = await fim.addDataset(file);
// This is the call, decode, colorize and draw the layer.
const layer = await fim.addLayer(ds);
layer.fit();
A root wraps a source; every operation returns a new node. Nothing is fetched, decoded or warped until it is rendered or accessed allowing increased efficiency in the browser.
Evented, map provider-neutral signature, and it never names an element of yours.
Each Layer is associated with ColorScale, Legend and
Stats objects for analyzing and modifying visuals of the data.
Shipped free from UI dependencies with output you can build in your own web application. Use the engine's event bus, to build reactive widgets.
Chain functions like: ds.clip(bbox).mask(poly).reclassify(rules). Functions return new Datasets, evaluated at render time
Results are chained, and memoized for efficient reuse.
With easy to reach and highly modifiable display operations for reprojection, reclassification, resampling, recoloring and more.
Dataset forces to exactly one of two value types. Every other dimension —
time, level, ensemble member, band — is a selection axis you resolve down with
select(), never an N-dimensional cube.
Map, vectors and static raster images go through a registered provider — Leaflet and Google ship with it, and a neutral style vocabulary is translated into each SDK's own names. The animated velocity canvas, HAZUS markers and ArcGIS depth tiers remain Google-only.
Layer.registerType, ColorScale.registerPalette,
Dataset.registerMaterializer, FimViz.registerMapProvider — the
library owns the mechanism, your app registers the specifics.
All of it runs in the browser. The heavy parts load only when something asks for them.
The engine bundle is around 210 KB and the UI module around 55 KB. GDAL (a ~38 MB wasm, for reprojection) and the NetCDF/GRIB2/Zarr reader are never bundled — they load on first use, so a consumer who parses a GeoTIFF and draws it downloads neither.
Runnable example pages with code and markup with explanation of operations and outputs.
Mount, parse, render, fit. The colour-scale precedence chain, live recolouring, the legend and statistics, a hover readout, a vector layer, and teardown.
Laziness and terminals, clip · mask · reclassify, terrain, band maths, zonal statistics and group-by, chaining off a Layer, rasterize, and the GDAL warp.
The three exclusive ColorScale modes, missingColor, Legend, Stats over rasters
and vectors, and the Filter family.
NetCDF4, Zarr, GRIB2 and NetCDF3 through the ordinary addDataset. The axis,
select, selectRange, reduce, and a scrubber.
Every fimviz/ui export mounted the way an app would mount it — panels, the four
selection tools, live read-models, and the engine-to-host bus.
toRecord/fromRecord, why values are stored verbatim, discovery,
migration, and a full store → rehydrate → force round trip.
Task-oriented, with parameter tables and worked examples. Start with the overview.
The guides above are the narrative; this is the exhaustive listing. It covers the public surface plus the seams a host implements — the map-provider contract, the materializer registry, and the layer-type registry.
Browse the API