[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115010":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":29,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":33,"discoverSource":34},115010,"gpui-kit-grid","GigLaboCom\u002Fgpui-kit-grid","GigLaboCom","Data grid component for GPUI, built on gpui-kit. Apache-2.0.","https:\u002F\u002Fgkg.giglabo.com",null,"Rust",94,5,2,0,1,35,6,65.33,"Other",false,"main",[24,25,26,27,28],"data-grid","gpui","gpui-kit","rust","ui-components","2026-11-20 10:42:55","2026-11-22 20:15:55","# gpui-kit-grid\n\nA live GPUI data grid, for applications built with [gpui-kit](https:\u002F\u002Fgpui-kit.com): a real-time table of hundreds of thousands of rows that takes thousands of updates per second from any thread, with change highlight and with sorting, filtering, grouping and trees in the background.\n\n[![The quotes example: simulated stock quotes grouped by sector, each changed cell flashing green or red with an arrow, and live totals on the sector rows](.github\u002Fassets\u002Fquotes.gif)](https:\u002F\u002Fgkg.giglabo.com\u002Fdemo\u002Fquotes\u002F)\n\nThe quotes example: every change highlighted as it arrives, live totals per sector. [Run it in the browser](https:\u002F\u002Fgkg.giglabo.com\u002Fdemo\u002Fquotes\u002F), where the examples are compiled to WebAssembly and drawn with WebGPU: the [WebGPU demo](https:\u002F\u002Fgkg.giglabo.com\u002Fwebgpu-demo\u002F) page says how, and the [trade blotter](https:\u002F\u002Fgkg.giglabo.com\u002Ftrade-blotter\u002F) page has one to fill.\n\nIt is a separate crate on top of gpui-kit. Rows are addressed by key and written from any thread; a background ingest collapses updates by key and publishes snapshots; the order on screen is rebuilt in the background; one custom element paints the visible cells. The ideas come from the LiveGrid grid (WinForms), rethought for GPUI.\n\n**Documentation: https:\u002F\u002Fgkg.giglabo.com\u002F** · [Getting started](https:\u002F\u002Fgkg.giglabo.com\u002Fstart\u002F) · [Examples](https:\u002F\u002Fgkg.giglabo.com\u002Fexamples\u002F) · [Live demos](https:\u002F\u002Fgkg.giglabo.com\u002Fdemo\u002F) · [API](https:\u002F\u002Fgkg.giglabo.com\u002Fapi\u002F)\n\n> **Status:** stages 1–3 are done: the live core, grouping, aggregates and trees, then editing, elements in cells, export and drag and drop. The API will still change. What may come next is in [ROADMAP.md](ROADMAP.md).\n\n## Why a new grid when gpui-kit has DataTable\n\n`DataTable` builds an element for each cell, addresses rows by index and calls its delegate through `&mut` on the UI thread. That is enough for static tables, not for live data: with 1500 visible cells under 2k updates a second a frame takes 12–14 ms, and after a re-sort the selection points at a different row.\n\n|  | `DataTable` | `gpui-kit-grid` |\n|---|---|---|\n| Painting | An element per cell | One custom element, glyphs painted directly |\n| Frame, 1500 cells, 2k updates\u002Fs | 12–14 ms | ~1.1 ms |\n| Rows and selection | By index | By key: survive re-sorting and removal |\n| Data | `&mut` delegate on the UI thread | `GridWriter` from any thread, background ingest |\n| Sorting and filtering | Synchronous, on click | In the background, automatic when data changes |\n| Change highlight | No | Yes, with direction arrows and fading removed rows |\n| Structure | Flat rows | Grouping, aggregates, totals and trees, built in the background |\n| Editing and export | No | Editors under live updates; copy as TSV, CSV and custom formats in the background |\n\nMeasured with the headless `spike_bench` example (release, macOS); the [Performance](https:\u002F\u002Fgkg.giglabo.com\u002Fperformance\u002F) page has every scenario.\n\n## Quick start\n\n```sh\ncargo run --release -p gpui-kit-grid --example quickstart\n```\n\nA row is an immutable value with a key; `value` borrows from it and must not allocate:\n\n\u003C!-- region crates\u002Fgrid\u002Fexamples\u002Fquickstart.rs#row -->\n```rust\n\u002F\u002F 2. Rows: an immutable value with a key. `value` must not allocate: it runs\n\u002F\u002F    for every visible cell on every frame and for every row when sorting.\n#[derive(Clone)]\nstruct Trade {\n    id: u64,\n    instrument: Arc\u003Cstr>,\n    sell: bool,\n    quantity: i64,\n    price: f64,\n}\n\nimpl GridRow for Trade {\n    type Key = u64;\n    type Column = TradeColumn;\n\n    fn key(&self) -> &u64 {\n        &self.id\n    }\n\n    fn value(&self, column: TradeColumn) -> CellValue\u003C'_> {\n        match column {\n            TradeColumn::Id => CellValue::Int(self.id as i64),\n            TradeColumn::Instrument => CellValue::Text(&self.instrument),\n            TradeColumn::Side => CellValue::Text(if self.sell { \"Sell\" } else { \"Buy\" }),\n            TradeColumn::Quantity => CellValue::Int(self.quantity),\n            TradeColumn::Price => CellValue::Float(self.price),\n        }\n    }\n}\n```\n\nThe grid state gets a schema, a delegate for styling, a store of its own and a sort:\n\n\u003C!-- region crates\u002Fgrid\u002Fexamples\u002Fquickstart.rs#state -->\n```rust\n\u002F\u002F 5. The grid state: schema, delegate, its own store, a sort.\nlet schema = GridSchema::new()\n    .with_frozen(1)\n    .column(GridColumn::new(TradeColumn::Id, \"Id\").with_width(px(80.)))\n    .column(GridColumn::new(TradeColumn::Instrument, \"Instrument\").with_width(px(140.)))\n    .column(GridColumn::new(TradeColumn::Side, \"Side\").with_width(px(80.)))\n    .column(GridColumn::new(TradeColumn::Quantity, \"Quantity\"))\n    .column(GridColumn::new(TradeColumn::Price, \"Price\"));\nlet grid = cx.new(|cx| {\n    LiveGridState::new_standalone(schema, Trades, StoreOptions::default(), cx)\n        .with_view(ViewSpec::new().with_sort([(TradeColumn::Price, SortDirection::Descending)]))\n});\n```\n\nAny thread writes rows by key:\n\n\u003C!-- region crates\u002Fgrid\u002Fexamples\u002Fquickstart.rs#writer -->\n```rust\n\u002F\u002F 7. Data from any thread: replace everything, then upsert by key.\nlet writer = grid.read(cx).writer();\nstd::thread::spawn(move || {\n    let instruments: Vec\u003CArc\u003Cstr>> = [\"SBER\", \"GAZP\", \"LKOH\", \"YNDX\", \"VTBR\"]\n        .map(Arc::from)\n        .to_vec();\n    let mut rng = fastrand::Rng::new();\n    let mut trades: Vec\u003CTrade> = (0..1_000)\n        .map(|id| Trade {\n            id,\n            instrument: instruments[rng.usize(..instruments.len())].clone(),\n            sell: rng.bool(),\n            quantity: rng.i64(1..10_000),\n            price: rng.f64() * 300.,\n        })\n        .collect();\n    writer.replace_all(trades.iter().cloned().map(Arc::new));\n    while !writer.is_closed() {\n        let trade = &mut trades[rng.usize(..1_000)];\n        trade.price *= 1. + (rng.f64() - 0.5) \u002F 100.;\n        writer.upsert(trade.clone());\n        std::thread::sleep(Duration::from_millis(5));\n    }\n});\n```\n\nThe window shows `LiveGrid::new(&grid)`, and the application calls `gpui_kit_grid::init(cx)` after `gpui_kit::init(cx)` for the grid's keys. The whole program is [`crates\u002Fgrid\u002Fexamples\u002Fquickstart.rs`](crates\u002Fgrid\u002Fexamples\u002Fquickstart.rs); [Getting started](https:\u002F\u002Fgkg.giglabo.com\u002Fstart\u002F) walks through it, with installation.\n\n## Examples\n\n| Example | What it shows |\n|---|---|\n| `quickstart` | The smallest application: 1000 trades from a producer thread |\n| `cookbook` | Recipes: a reload with progress, a held order, a saved layout, a custom export, a WebSocket feed |\n| `blotter` | Every feature of stages 1 and 2 on a trade blotter: grouping, totals, change arrows, a held order, a status bar on `LiveGridHandle` |\n| `portfolio` | A live tree of funds, desks, books and positions |\n| `dock_layout` | Grids in a dock, with layouts saved and restored |\n| `orders` | Orders edited in place under live updates: every editor, elements in cells, CSV export, drag and drop |\n| `desk`, `ladder`, `wire`, `broker` | Trading screens over a simulated market |\n| `ops` | A data-centre console in a simulated alert storm |\n| `orbit` | About 17,000 satellites from CelesTrak's public data |\n| `transit` | Munich by the timetable, and Helsinki live |\n| `wiki` | Wikimedia's live edits, a row per wiki |\n| `ships` | Every vessel around Finland, live from AIS |\n| `perf` | This machine's processes and GPU, live (macOS and Linux) |\n| `spike_bench` | The headless benchmark (macOS) |\n\nRun one with `cargo run --release -p gpui-kit-grid --example \u003Cname>` (`spike_bench` also needs `--features test-support`). Each example lists its environment variables at the top of its `main.rs`. The showcase examples' fonts are downloaded with `python3 -I script\u002Ffetch-example-fonts`, and `orbit`'s and `transit`'s data with `script\u002Ffetch-orbit-data` and `script\u002Ffetch-transit-data`. `desk`, `broker`, `ops`, `orbit`, `transit`, `wiki` and `ships` also run in the browser, with a quotes page beside them (`crates\u002Fgrid-web`; see [Web](https:\u002F\u002Fgkg.giglabo.com\u002Fweb\u002F)).\n\n## Documentation\n\n- [Concepts](https:\u002F\u002Fgkg.giglabo.com\u002Fconcepts\u002F): rows by key, ingest and snapshots, background rebuilds, and what the grid is for.\n- [Replaceable behaviors](https:\u002F\u002Fgkg.giglabo.com\u002Fconcepts\u002Freplaceable-behaviors\u002F): every default is a strategy you can replace.\n- Guides: [grouping](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fgrouping\u002F), [tree](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Ftree\u002F), [live changes](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Flive-changes\u002F), [cells](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fcells\u002F), [editing](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fediting\u002F), [export](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fexport\u002F), [drag and drop](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fdrag-and-drop\u002F), [columns](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fcolumns\u002F), [keyboard](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fkeyboard\u002F), [settings](https:\u002F\u002Fgkg.giglabo.com\u002Fguides\u002Fsettings\u002F).\n- [Cookbook](https:\u002F\u002Fgkg.giglabo.com\u002Fcookbook\u002F), [Performance](https:\u002F\u002Fgkg.giglabo.com\u002Fperformance\u002F), [Web](https:\u002F\u002Fgkg.giglabo.com\u002Fweb\u002F), [Embedding](https:\u002F\u002Fgkg.giglabo.com\u002Fembedding\u002F).\n\nThe site is built from `site\u002F` (Astro Starlight): `bun install --cwd site --frozen-lockfile`, then `bun run --cwd site build` and `bun test --cwd site`. Code on its pages comes from `\u002F\u002F #region` blocks of compiled files, and `bun test` checks that this README's snippets match them. The site also ships as a container image, `ghcr.io\u002Fgiglabocom\u002Fgpui-kit-grid-site` (nginx, `docker\u002Fsite\u002F`), released on its own tags; see \"Releases\" in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Development\n\nRequires Rust 1.95 (`rust-toolchain.toml`). gpui-kit comes from GitHub, pinned to one revision of its `next` branch; to build against a local gpui-kit checkout instead, see \"A local gpui-kit checkout\" in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n| Path | Contents |\n|---|---|\n| `crates\u002Fgrid` | The grid (`gpui-kit-grid`): `model`, `store`, `engine`, `policy`, `state`, `element`; property and headless UI tests; the examples |\n| `crates\u002Fgrid-macros` | `#[derive(GridColumns)]`, behind the `derive` feature |\n| `crates\u002Fgrid-web` | The browser pages, a separate workspace built for `wasm32-unknown-unknown` |\n| `crates\u002Fgrid-feed`, `crates\u002Fgrid-gateway` | The quotes feed protocol and its WebSocket gateway |\n| `crates\u002Fproducts` | The examples' \"More from GigLabo\" button and dialog (`giglabo-products`, not released) |\n| `site` | The documentation site |\n| `script`, `docker\u002Flinux` | Gate checks, data downloads, the benchmark charts; Linux builds and the end-to-end suite |\n\n```sh\ncargo fmt --all --check\ncargo clippy --workspace --all-targets --features gpui-kit-grid\u002Ftest-support -- --deny warnings\ncargo test --workspace --features gpui-kit-grid\u002Ftest-support\nRUSTC_BOOTSTRAP=1 cargo check -p gpui-kit-grid --lib --target wasm32-unknown-unknown --features decimal,derive\ntypos && cargo machete && bun script\u002Fcheck-gpui-kit-pin.ts\n```\n\nLinux in Docker: `docker\u002Flinux\u002Ftest.sh`, `docker\u002Flinux\u002Fsmoke.sh` and `docker\u002Flinux\u002Fe2e.sh`. Rules: [CONTRIBUTING.md](CONTRIBUTING.md) and [AGENTS.md](AGENTS.md).\n\n## Data in the examples\n\nThe examples download their data with the scripts above; nothing is committed.\n\n| Example | Source | Licence |\n|---|---|---|\n| `orbit` | [CelesTrak](https:\u002F\u002Fcelestrak.org), derived from the US Space Force's public catalog | No redistribution granted; fetched at most once per update |\n| `transit` (Munich) | MVV's GTFS feed \"Soll-Fahrplandaten MVV-Gesamtnetz\", © Münchner Verkehrs- und Tarifverbund GmbH, via [opendata.muenchen.de](https:\u002F\u002Fopendata.muenchen.de) | CC BY 4.0; scheduled, not real-time |\n| `transit` (Helsinki) | © HSL, [high-frequency positioning](https:\u002F\u002Fdigitransit.fi\u002Fen\u002Fdevelopers\u002Fapis\u002F5-realtime-api\u002Fvehicle-positions\u002Fhigh-frequency-positioning\u002F) and GTFS | CC BY 4.0 |\n| `wiki` | [Wikimedia EventStreams](https:\u002F\u002Fstream.wikimedia.org\u002Fv2\u002Fstream\u002Frecentchange); titles by Wikimedia contributors | CC BY-SA 4.0 |\n| `ships` | Source: Fintraffic \u002F [digitraffic.fi](https:\u002F\u002Fwww.digitraffic.fi\u002Fen\u002Fmarine-traffic\u002F) | CC BY 4.0 |\n| `quotes`, `desk`, `ladder`, `wire`, `broker` | Simulated prices, not market data | — |\n| `ops` | Simulated: a made-up data center | — |\n| `perf` | This machine's processes and GPU, read locally; nothing leaves the machine | — |\n\nThe live examples keep their sources' rules: one connection each, backoff with jitter on reconnect, and no personal data kept. [Licenses](https:\u002F\u002Fgkg.giglabo.com\u002Flicenses\u002F) lists what the web demos serve and their third-party notices.\n\n## Sponsor\n\nIf the grid is useful to you, consider [sponsoring its development](https:\u002F\u002Fgkg.giglabo.com\u002Fsponsor\u002F).\n\n## License\n\nSoftware source and examples: [Apache-2.0](LICENSE-APACHE), as in gpui-kit.\n\n- Built on [gpui-kit](https:\u002F\u002Fgithub.com\u002Flongbridge\u002Fgpui-kit) by Longbridge, also Apache-2.0. gpui-kit in turn is built on GPUI, the UI framework from Zed Industries, also Apache-2.0.\n- Contribution rules, gates and agent guidance (`AGENTS.md`, `CONTRIBUTING.md`, `.agents\u002F`) are adapted from gpui-kit and extended.\n","gpui-kit-grid 是一个面向高性能实时数据场景的 Rust 数据网格（Data Grid）UI 组件，专为 GPUI 框架及 gpui-kit 生态构建。其核心支持毫秒级响应的高吞吐更新（数千次\u002F秒）、基于键值的行寻址、后台异步排序\u002F过滤\u002F分组\u002F树形结构构建、变更高亮（含方向箭头与颜色反馈）以及聚合总计。采用单自定义元素+直接字形绘制架构，显著优于传统逐单元格渲染方案，在 1500 单元格+2000 更新\u002F秒负载下帧耗仅约 1.1ms。适用于金融行情终端、实时交易簿、监控仪表盘等需低延迟、高刷新、结构化动态表格的桌面或 WebAssembly 应用。","2026-11-24 04:50:04","CREATED_QUERY"]