Feature Library

Minimap, exploration and compass

0.06 CPU ms
A still of the Minimap, exploration and compass demo
Still
The live demo starts when it’s in view.Click the view, then arrows or WASD to walk and turn · M opens the full map · Esc closes it · press Read bearing to hear your heading

A change-driven navigation HUD: player-up or north-up minimap, numbered markers pinned at its rim, a saveable exploration bitmap, an accessible full map and a…

A change-driven navigation HUD: player-up or north-up minimap, numbered markers pinned at its rim, a saveable exploration bitmap, an accessible full map and a compass strip. Canvas redraws only for changed map content or position; turns move the map and player view cone with CSS transforms. No framework or map server required.

What it costs a frame

0.06 ms
GPU
not used
CPU, median
0.06 ms
CPU, 95th pct
0.13 ms
Draw calls
0
Weight
Light

Measured 19 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 0.06–0.06 ms). What ran: Navigation alone: a 64×64 exploration bitmap, three markers and a cached 1024-pixel atlas. A scripted walk updates the pose each frame; canvas redraws are coalesced to at most 10 Hz, while the compass and player view cone use CSS transforms. No 3D scene is constructed or rendered. Phones: tiers are being measured next.

How steadily it runs on RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference

Typical frame ?
0.49 ms
1% low ?
761 fps
Varies by ?
±0.17 ms
All metricsRTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900H · reference
p50p95p990.15 ms1.26 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run back to back, each starting once the GPU has finished the last, so frame times show the work itself. They have a floor of about 4–5 ms from the browser’s own scheduling: GPU and CPU ms stay the measure of cost.

Frames

Median (p50) ?
0.49 ms
p95 ?
0.82 ms
p99 ?
1.14 ms
Slowest ?
1.76 ms
Mean ?
0.51 ms
Standard deviation ?
0.17 ms
1% low ?
761 fps
0.1% low ?
568 fps
Hitches ?
12 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.0 / 0.5 / 0.5 ms

Input

No input during this run.

Memory

JavaScript heap ?
33.4 → 36.0 MB
Growth ?
+2.56 MB

Browser

JavaScript a frame ?
0.00 ms
All tasks a frame ?
0.33 ms
Layout / style ?
0.05 / 0.03 ms
Main thread busy ?
64%

Garbage collection

Collections ?
2 (2 minor, 0 major)
Pauses ?
0.4 ms in all, longest 0.2

What it needs

Renders with
Canvas 2DA 2D canvas: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages
With an agent
install("minimap-compass")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it up

What it’s for

  1. Navigation in a walking or driving game
  2. Exploration maps with persistent discovery
  3. A north-up overview and player-up local map
  4. Accessible bearings and destination lists

Pitfalls, in brief

  1. Coordinates are metres with +x east and +z south; heading is degrees clockwise from north (-z).
  2. Import navigation.css and both dialog styles, base before look.
  3. setPose answers turns with CSS transforms; moved positions, changed fog and explicit invalidations queue at most one redraw per interval (100 ms by default).
  4. The atlas is cached at no more than 1024 pixels on its longest side.
  5. Exploration is permanent discovery, not current visibility.
4 more in brief
  1. Markers are hidden until their cell is explored unless alwaysVisible is true.
  2. The compass announces only when its button or announceBearing is called.
  3. The full map defaults to document.body so its dialog makes the page inert.
  4. The demo uses three.js 0.187 for its surrounding scene, with WebGL2 fallback; the copied navigation module needs only DOM and Canvas 2D.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

WAI-ARIA Authoring Practices Guide (W3C): Dialog labelling, focus containment and return, via the copied accessible-dialog core.

minimapcompassfog of warexplorationnavigationHUDmapbearingsavekeyboardcanvas2ddomno dependencies

Near it in the frame