Type/to search
Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
Status Bar Components
grid
tabs
kpi
stat
progress
gauge
sparkline
chart
heatmap
calendar
histogram
pie
timeline
markdown
alert
badge
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
Built-in Variables and Constants
Conventions
Exchanges

Arranges components in columns and drops columns automatically when the container gets narrow.

Examples

Three KPI cards in one row show the best bid, best ask and last price.

javascript
function main() { var ticker = exchange.GetTicker() if (!ticker) return LogStatus({ type: "grid", cols: 3, minColWidth: 160, items: [ {type: "kpi", title: "Bid", value: ticker.Buy}, {type: "kpi", title: "Ask", value: ticker.Sell}, {type: "kpi", title: "Last", value: ticker.Last} ] }) }
python
def main(): ticker = exchange.GetTicker() if not ticker: return LogStatus({ "type": "grid", "cols": 3, "minColWidth": 160, "items": [ {"type": "kpi", "title": "Bid", "value": ticker["Buy"]}, {"type": "kpi", "title": "Ask", "value": ticker["Sell"]}, {"type": "kpi", "title": "Last", "value": ticker["Last"]} ] })
rust
fn kpi(title: &str, value: f64) -> String { format!(r#"{{"type": "kpi", "title": "{}", "value": {}}}"#, title, value) } fn main() { let Ok(t) = exchange.GetTicker(None) else { return }; let items = [kpi("Bid", t.Buy), kpi("Ask", t.Sell), kpi("Last", t.Last)]; // A component is JSON text passed to LogStatus! as is, without backticks LogStatus!(format!( r#"{{"type": "grid", "cols": 3, "minColWidth": 160, "items": [{}]}}"#, items.join(",") )); }

Attributes

NameTypeDescription

type

string

Required. Always grid.

items

array

Required. Child components: any status bar component, or table and button objects.

cols

number

Desired number of columns, 1–12. Defaults to the number of children.

minColWidth

number

Minimum column width in pixels; columns are dropped when they do not fit. Default 180.

gap

string

Gap: sm, md or lg. Default md.

title

string

Title shown above the grid.

id

string

Stable identifier. Set it when the number or order of components changes, so refreshes do not rebuild the component.

span

number

Number of columns it spans in the enclosing grid. Default 1.

See Also

Remarks

The actual column count is the largest value that does not exceed cols and keeps every column at least minColWidth wide. A child's span scales proportionally: a component spanning 2 of 4 columns spans 1 column when the grid drops to 2 columns, and the full row at 1 column.

grid and tabs can be nested in each other up to 6 levels; deeper parts show an error card.

Passing an array of components directly (for example LogStatus([a, b])) is the same as a one-column grid: the components are stacked from top to bottom.