Introduction

Kinesis.js is a TypeScript-first, framework-agnostic interpolation engine that smoothly animates real-time vehicle positions across any map — turning sparse, periodic pings into continuous 60fps motion.

The problem

Real-time fleet feeds are sparse. A backend sends each vehicle's position every one, five, or ten seconds — but a map redraws sixty times a second. Apply each update directly and every marker teleports: it sits still, then jumps to the next coordinate, then sits still again. On a dispatch screen that stays open all shift, the jitter is exhausting and makes positions hard to read.

The solution

Kinesis.js sits between your feed and your map. It keeps the last couple of points per vehicle and, on every animation frame, computes where the vehicle should be right now — interpolating along the path between two known positions. The marker glides instead of jumping.

minimal.tsts
import { Tracker } from '@kinesisjs/core';
import { OpenLayersAdapter } from '@kinesisjs/openlayers';

const tracker = new Tracker({
adapter: new OpenLayersAdapter(map),
interpolation: 'adaptive',
});

tracker.start();
ws.onmessage = (e) => tracker.ingest(JSON.parse(e.data));

The 30-second mental model

Two facts explain almost everything about how the engine behaves:

  • The engine only fills the gap between two known points. It interpolates; it does not predict the future. Until a second ping arrives, there is nothing to move between.
  • Display stays behind real time by roughly one feed period. A small render-lag buffer (renderLagMs, default 1000) guarantees there are always two points to interpolate between, so motion is continuous rather than snapping on arrival.
Rule of thumb

Set renderLagMs ≈ feed period. A 5-second feed wants renderLagMs: 5000; a 1 Hz feed is happy with the default.

Architecture at a glance

Kinesis.js ships as small, composable packages across three layers. You depend only on what your stack needs.

LayerPackage(s)Responsibility
Core@kinesisjs/coreClock, interpolation, lifecycle, events, math. Zero deps.
Adapter@kinesisjs/openlayers · @kinesisjs/leafletCreate / update / remove map features; styling and trails.
Wrapper@kinesisjs/angularReactive inputs and framework-managed teardown.

See Architecture & concepts for the full responsibility model and data pipeline.

Versioning & migration

Kinesis.js follows semantic versioning, and the 0.1.x line has stayed backward-compatible. Notable changes:

  • 0.1.0 → 0.1.1 — real-time interpolation fix: positions no longer snap on ingest; the renderLagMs buffer was introduced. Angular AOT build fix.
  • 0.1.1 → 0.1.2 — adaptive minPeriodMs default lowered 1000 → 500 so steady 1 Hz feeds no longer sit on the zone boundary. Four new directive inputs.
Note

None of the 0.1.x updates require code changes. Upgrade freely.

Next steps