3D charts for Bubble Tea terminals and booba browser applications.
import "github.com/NimbleMarkets/ntcharts3d"One ntcharts3d.Model combines named scatter, surface, bar, line, vector-field, or custom series
with a shared camera. Charts support orbit, pan, zoom, picking, color legends,
hover highlights, fixed axis and color ranges, plot proportions, and in-chart
axis labels with optional back-plane grids.
Rendering uses nimbleterminal.dev/nt3d for WebGPU, software, and wireframe.
nimbleterminal.dev/ntpicture owns terminal sessions, image transport, and glyph output.
The chart module remains github.com/NimbleMarkets/ntcharts3d.
Install v0.3.6:
go get github.com/NimbleMarkets/ntcharts3d@v0.3.6See the changelog, API guide, gallery instructions, transport diagnostic, and demo site.
bash scripts/bootstrap-deps.sh # download published module dependencies
go test -race ./...
cd examples/gallery
go run .
# Shared memory requires a compatible local terminal:
go run . -medium shmThe gallery has scatter, surface, bar, textured map, and vector-field tabs.
Run go -C examples/gallery run . -tab 4 -rotate=false from the root to try the
map: t swaps imagery, f toggles flat/terrain, and l toggles lighting. Press v to switch legend modes,
g to switch Kitty/glyph output, o to switch projection, and b for grid lines. Use PNG over SSH.
Run with -tab 5 -rotate=false for swirling arrows and streamlines: n normalizes
lengths, s toggles streamlines, and w changes stroke widths.
Terrain textures use 4× anisotropic filtering by default. Try
go -C examples/gallery run . -tab 4 -anisotropy 16 for more detail at shallow
angles, or -anisotropy 1 for mipmapping alone.
See the gallery instructions for browser builds and all controls.
Run go run ./examples/multichart (or task multichart) for two independently
controlled charts sharing one terminal session. Without WithTerminalSession,
each chart creates its own session and may issue its own Kitty probe. See the
multi-chart demo for message routing and cleanup.
Install Task, then run tasks from the
repository root. task builds the library and native examples into bin/.
| Command | Purpose |
|---|---|
task list |
List all tasks |
task deps |
Download dependencies for all three modules |
task ci |
Check formatting, modules, race tests, vet, and native/WASM builds |
task test-gpu |
Run hardware GPU tests without the race detector |
task gallery -- -render-mode software |
Run the gallery with flags |
task multichart -- -render-mode software |
Run two charts sharing terminal discovery |
task transport -- -medium shm |
Run the transport diagnostic with flags |
task go-tidy |
Update module files in all three modules |
task build-web |
Compile both WASM examples and generate browser assets |
task serve-gallery / task serve-transport |
Serve generated browser examples |
task build-wasm-site / task serve-wasm-site |
Build and serve the Go/TinyGo demo page |
task clean |
Remove compiled outputs, keeping browser assets |
Builds and CI check module files without updating them.
task build-web generates the browser assets bundled with booba v0.12.1,
including Kitty shared-memory support. No local terminal asset overlay is needed.
GitHub Actions runs task ci on Linux and macOS for pushes and pull requests.
Hardware GPU tests run separately with task test-gpu. WASM compilation does
not verify browser rendering. A separate Pages workflow builds the gallery with
Go and TinyGo and deploys from main. See the demo site instructions.
The Pages gallery uses Kitty shared memory with the bundled terminal assets.
The library and examples require Go 1.26.8. Dependencies resolve as published
Go modules: ntpicture v0.1.5, nt3d v0.8.1, ntgpuimage v0.6.0, and
ntcanvas v0.1.4. NTCharts is no longer a dependency.
Run task deps to download dependencies for all three modules. Local sibling
repositories and .deps/ snapshots are no longer needed. CI uses the same
module versions and checksums.
The gallery's ntcharts3d => ../.. replacement uses this repository directly.
Both examples use nimbleterminal.dev/booba v0.12.1 and its Bubble Tea WASM fork at 536722b0bdb6.
The bundled ntwebterm assets support browser shared memory.
The bundled ntwebterm graphics fixes restore frame updates in Safari and
prevent grey placeholder cells while dragging. Regenerate browser assets
with task web-assets after changing the booba pin.
- ntcharts3d: series, chart frames, axes, palettes, clipping, picking, hover, and layout.
- nt3d: geometry validation, shared math and textures, GPU/software/wireframe rendering.
- ntpicture: explicit terminal sessions, encoding, placement IDs, and presentation lifecycle.
- ntcanvas: terminal wireframe surfaces through nt3d.
- ntgpuimage: GPU execution and readback through nt3d (directly in the transport diagnostic).
- booba and the browser terminal: WASM hosting and Kitty image display.
The chart uses nt3d's frame/render interfaces directly. Its custom Renderer,
Frame, picking, and camera controls remain chart APIs; nt3d/widget is not
embedded. This preserves data-space surface-vertex picking, bar values, and
chart viewport behavior without coupling the generic widget to chart metadata.
Use nimbleterminal.dev/nt3d/math (package nt3dmath) directly for Vec3,
Mat4, Ray, and AABB; the local math3d package has been removed. Chart
primitive types still forward to engine types. Use nt3d directly for
MaxPoints, MaxVectors, MaxMeshTriangles, and MaxMeshIndices; the chart
exports have been removed. Transport options now use
nimbleterminal.dev/ntpicture. Replace WithKittyID with
WithImageIDAllocator; share WithTerminalSession between charts on one
connection. Execute Dispose() before quitting, then Close() after the event
loop exits. Terminal overrides are now NTPICTURE_KITTY=supported (or
unsupported) and NTPICTURE_TMUX_PASSTHROUGH=true (or false); sessions
snapshot these variables when created. See lifecycle details.
Extracted from ntcharts wgpu-shared-memory at 2ed8872.
MIT license; existing copyright notices are preserved.
