Widgets¶
Rayfall API¶
;; Create widget (opens panel immediately)
(set grid1 (widget {type: 'grid name: "trades"}))
;; Push data to widget (replaces previous)
(draw grid1 (select {from: trades where: (> price 100)}))
;; Widget with interaction callback
(set grid1 (widget {type: 'grid name: "symbols"
on-select: (fn [row] (draw details row))}))
Widget Lifecycle¶
(widget {...})— Creates widget object, opens empty docked panel(draw widget data)— Sends data for rendering, replaces previous- User interaction → UI sends expression string to Rayforce
- Rayforce parses, allocates
obj_p, setswidget->post_query - Next draw applies
post_queryto data before rendering
Post-Query¶
Any Rayfall expression applied to data before rendering:
"(select {from: data where: (== sym 'AAPL)})" ;; Filter
"(select {from: data by: sym total: (sum size)})" ;; Aggregate
"(xdesc ['price] data)" ;; Sort
All obj_p allocation happens in Rayforce thread (thread-local heaps).
Widget Types¶
| Type | Purpose | Key Features |
|---|---|---|
| Grid | Table display | Row selection, column sorting, virtualized |
| Chart | Data visualization | Line/bar/scatter via ImPlot |
| Text | Value display | Simple formatted output |
| REPL | Core interaction | Rayfall input, result output, history |