38
densa is a Rust toolkit designed for applications that need to display a large amount of live, dynamic data with exceptional performance. It focuses on keeping live data in order as it changes and rendering it on the GPU at the display's refresh rate, ensuring a smooth experience from data stream to pixel. This toolkit is ideal for software where every pixel carries critical, rapidly updating information.
Live Tables: Efficiently upsert Arrow record batches by key. Views can be sorted, filtered, and aggregated, with changes reflected incrementally without full recomputation. Batches are shared, not copied, and reading a view never allocates memory. Selections remain with their data as it moves.
Widgets: A retained tree of widgets, laid out using flexbox, that handles pointer, keyboard, and input method events. This system can run without a window, allowing interfaces to be built, driven, and tested headless. Features include labels, buttons, text inputs, scroll views, splitters, panels, and docking capabilities.
Data Grid and Charts: A high-performance data grid and chart component that tracks live data, offering zoom and pan functionality. Charts can be linked to grids, displaying data for selected instruments in real-time.
Rendering: Utilizes a batched rendering approach, combining rectangles and glyphs into a single instanced draw call per frame. The data grid directly accesses cell data, eliminating the need for model copying. Charts draw lines efficiently, and glyph atlases grow dynamically.
Text Rendering: Paragraphs are shaped, wrapped, and aligned, sharing a glyph atlas with the grid. Supports bidirectional text, colored spans, and various alignments. Features include click-to-caret selection, keyboard navigation, and input method editing (IME).
Data Handoff: Implements a wait-free data hand-off mechanism between producer and UI threads, ensuring that the UI thread always picks up the newest data snapshot once per frame without blocking.
Engineering Guarantees: The project emphasizes reliability through rigorous testing, including no allocation per frame, no locks between threads, correct pixel rendering verification, and thorough checking of unsafe code.
densa is open source under the MIT or Apache-2.0 license and supports Linux, macOS, and Windows. It requires Rust 1.90+ and a GPU with Vulkan, DX12, or Metal support.
Built with