Skip to content

About

@navaramap/three-flood-mesh draws a water surface that changes over time, such as the result of a flood or tsunami simulation, on Navara’s 3D globe. It provides:

  • TimeSeriesFloodMeshDesc: a mesh descriptor that plays a series of water-surface heights read from a Zarr store, shaded as Navara’s water or colored by a property such as the depth or the flow speed.
  • Series functions: loadTimeSeriesFlood to load a series, sampleTimeSeriesFlood to read the water at a point, and timeToFrame / frameToTime to convert between times and frames.
  • Converters: the @navaramap/three-flood-mesh/convert entry and the navara-flood-zarr command, which write the Zarr group from simulation output (CSV, netCDF and CZML).

See it running in the example.

@navaramap/three-flood-mesh is published only in nightly builds. It requires @navaramap/three of the same nightly build, so install both from the nightly dist-tag:

Terminal window
npm install @navaramap/three@nightly @navaramap/three-flood-mesh@nightly
import ThreeView from "@navaramap/three";
import { TimeSeriesFloodMeshDesc } from "@navaramap/three-flood-mesh";
const view = new ThreeView({ animation: true });
await view.init();
view.registerMesh("timeSeriesFlood", TimeSeriesFloodMeshDesc);
const water = view.addMesh<TimeSeriesFloodMeshDesc>({
timeSeriesFlood: { url: "https://example.com/flood.zarr", frame: 0 },
});

See Usage Examples for playback, coloring and loading recipes.

@navaramap/three (core: ThreeView, MeshDesc)
└── @navaramap/three-flood-mesh
├── TimeSeriesFloodMeshDesc, loadTimeSeriesFlood (browser entry)
└── convertRasters, convertMesh, convertPolygons (/convert entry, browsers and Node)

The /convert entry and the navara-flood-zarr command need neither three nor @navaramap/three.

The package ships the navara-flood-mesh skill for AI coding agents such as Claude Code. It walks an agent from the simulation output to the viewer: inspecting the input, choosing the converter and writing its configuration, reading the report, serving the Zarr group, and playing and coloring it with TimeSeriesFloodMeshDesc. For the rest of the scene, it builds on the navara-usage skill of @navaramap/three (see Building with AI Coding Agents).

With pnpm 12.11 or later, run pnpm approve after installing to link it into your project’s agent skills directory, such as .claude/skills. With another package manager, copy node_modules/@navaramap/three-flood-mesh/skills/navara-flood-mesh there.