Skip to content

v0.2.0 — same-place threats render as a self-loop

Choose a tag to compare

@BogdanTaranenko BogdanTaranenko released this 21 Jul 10:07
· 12 commits to main since this release

Highlights

An attack whose origin and destination resolve to the same place now renders as a self-loop instead of an invisible point.

This covers a domestic incident in a country with no subdivisions (DE → DE), lateral movement inside one US state (US-CA → US-CA), and two hosts given identical city coordinates. All three produce a zero-length chord, which previously degenerated the arc: the renderer skips zero-length polylines, so those threats drew no track and no trail — just an origin dot with the head sitting on top of it. They could not be hovered either, since hit-testing measures distance to line segments and there were none.

buildArc now emits a circle tangent to the shared point: the origin marker sits on the point, the head travels the loop, and the impact ripple fires back on the same spot. It is ordinary geometry, so batching, fading, and hit-testing work with no special cases.

<ThreatMap attacks={[{ id: '1', from: 'DE', to: 'DE', severity: 'high' }]} />

Behaviour change

This is why the release is minor rather than patch. If your feed contains same-region attacks that previously rendered as static dots, they now render as animated loops. Nothing else about existing arcs changes.

Endpoints do not have to be exactly equal — anything projecting within half a pixel counts as the same place, since a sub-pixel line cannot be seen or hovered anyway. The tradeoff is that two genuinely distinct points can render as a loop when the viewport is zoomed far enough out.

The loop radius is clamped to 6–18 px so a same-place attack stays visible on a world map, and deliberately ignores curvature — curvature is the height of a lift applied to a chord, and a self-loop has no chord, so coupling them would make curvature: 0 erase these threats entirely.

Full rationale in DECISIONS.md §6.

Docs & demo

  • New README section covering same-place attacks.
  • New Domestic attacks demo panel showing all three behaviours against one feed, switching only the projection: Germany (Frankfurt → Frankfurt), United States (state-to-state via geoAlbersUsa), and World (both together).

Verification

Typecheck, 245 tests across node 18/20/22, coverage 94.45%, geo data in sync, demo build, and package smoke test — all green.

Full changelog: v0.1.2...v0.2.0