Skip to content

One-call views, marks that name their tables, stable labels, and plain docs - #83

Merged
lukelowry merged 14 commits into
mainfrom
develop
Oct 27, 2026
Merged

lukelowry merged 14 commits into
mainfrom
develop

Conversation

@lukelowry

Copy link
Copy Markdown
Owner

Views draw from data sources in one call, marks name their tables directly, labels stop flickering, and the examples and docs are rebuilt in plain language. Releases as a minor version through the six changesets in .changeset/, which list every breaking change.

API

  • View.create(canvas, scene, { region, camera, sources, gpu }) replaces gpu.view and gpu.canvas. Views share the first Gpu created.
  • A mark names its table in its kind key: { vertices: grid.table('Bus'), radius: 4 }. A view loads the datasets its scene's tables come from.
  • Data applies every Patch change directly. set and replace given only fields write rows 0 to n - 1.
  • Views draw from sources: Data, Snapshot, or Tiles. Every wait takes { signal } and times out, and every error is a LatkitError with a code.
  • One way to write a value: '$name' reads a field, any other string is a CSS color, and null is missing.
  • Shot.of(view) pictures what a canvas shows. new Shot(size, { views }) places views in a picture.

Rendering

  • Labels are placed from each frame alone. Where labels would overlap, the row drawn on top keeps its label, so priority decides. Only labels that show get their text, so dense views settle. An empty text gives no label.
  • The text atlas never evicts text still on screen.
  • Large tables draw in pages that stay on the GPU, and an edit rebuilds only the pages it touches. A vector tile costs only the rows it brings.
  • A flat map is one world, and camera moves stay within the camera's zoom and pan limits.
  • Fits wait for layout jobs, so topology layouts are framed. Plot legends sit inside the axes.

Examples and docs

  • The example app is five pages on one shared shell: power grids (ACTIVSg2000 to 70k and a 2M-bus continent, with height by kV and a topology layout), a soft body, orbits, live telemetry, and a diagram editor. The grids page draws the grid before its basemap loads.
  • The docs gallery is rebuilt on the new API. The banner is no longer an example page.
  • Every doc comment, docs page, and changeset is rewritten in plain language.

Measured (Chrome on the GPU)

Before After
Power grids page, first frame (ACTIVSg25k with coasts and borders) 1,340 ms 460 to 550 ms
ACTIVSg70k with labels, time to settle kept waiting on labels under 1 s

Testing

  • cargo xtask ci rust, native-cli, and npm: clippy in every configuration, the GPU tests (new tests for label overlap, empty labels, fits after layouts, and plot legends), the browser gate on all five pages, and the packed-package consumer test
  • pnpm format:check, and the docs build with warnings as errors
  • Rebased on main (0.2.1)

@lukelowry
lukelowry merged commit 3ef5134 into main Oct 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant