frame

frame, tile type

The frame tile combines values, horizontal bars, images, navigation buttons, and lists in a table-like layout. It can display detail rows alongside their parent summaries. Use region-based placement, as in the examples below.

Table of contents

Syntax

Declare ordinary column expressions directly inside with, without a columns block. Each expression produces a column; as "Label" sets its header. Values from a common table are aligned row by row. Use group by for aggregated rows, or group into T to select an existing table as the aggregation target. Without downstream details, order by sets row order.

The following blocks can accompany ordinary columns:

Block Contents Display
bar as "Label" One number expression A horizontal bar and its numeric value per row
image as "Label" One text expression containing an image URL An image per row
button as "Label" One text expression containing the button label A navigation button per row; set its destination with href
column as "Label" Values or bar, image, button, and list blocks An explicit column with its own cell layout
downstream into T Values, display blocks, or further downstream blocks Detail rows from a related downstream table
list into T One value expression from a related downstream table A list of tags in each parent cell

For bars and buttons, an omitted header defaults to the label of the contained expression. Use an explicit as on the block to keep the header distinct from the displayed button label or numeric expression.

Images and buttons

Images fit inside their cells while preserving their aspect ratio. The URL must point to image content, not an HTML preview page. For images in the Lokad file tree, use downloadUrl, including for entries inside a filepack. A separate button can use previewUrl to open the file preview.

Buttons navigate to their href; they do not submit edited dashboard data. Both the label and destination can vary by row. Images and buttons can be top-level columns or appear inside a downstream block. They are also accepted inside column, subject to the layout limitation below.

Column blocks

An explicit column groups its contents under one header. Its cellHeight sets the height available per row in grid rows, not pixels; the default is one grid row. This is useful, for example, for a taller bar display.

Positioning multiple values or display blocks within one column is not yet fully supported. Do not assume that they will automatically stack without overlapping. Use separate top-level columns for a product image, description, and button. Increasing cellHeight alone does not position these contents.

Downstream details

downstream into T adds columns whose cells contain the related rows of T, alongside values at the parent level. It does not aggregate away those details. The parent row expands to accommodate its detail rows.

The detail table must be downstream of the parent table through a dimension relationship, or be the source table of the enclosing group by. Matching text labels alone do not establish that relationship. Parent values can be broadcast into detail expressions, and detail values can be aggregated in parent columns. Nested downstream blocks follow successive relationships.

Use group into Parent to select an existing parent table explicitly, or group by T.Key to form the parent groups directly. A frame containing only downstream blocks needs one of these clauses to establish its parent rows.

downstream is not allowed inside column. It does not accept order by, and neither does a block containing downstream details. For a separately sorted list, use a frame without downstream blocks or a table tile.

Lists in cells

list into T displays the related values from table T as tags in one cell per parent row. It follows the same parent-to-detail relationship as downstream into T. A list can appear alongside ordinary columns or inside an explicit column block. If the enclosing block contains only lists or downstream displays, use group by or group into to establish its parent rows. Both the list and the enclosing block must omit order by.

Examples

Each expression below produces a column:

table T = with
  [| as Name, as Qty |]
  [| "A", 10 |]
  [| "B", 5 |]

show frame "Items" { 1..6, 1..8 } with
  T.Name
  T.Qty

For numeric comparisons, a bar block contains one numeric expression. Here, the bars compare stock surpluses and shortages against a target:

table T = with
  [| as Item, as OnHand, as Target |]
  [| "A", 30, 20 |]
  [| "B", 5, 20 |]
  [| "C", 20, 20 |]

show frame "Stock gaps" { 1..6, 1..8 } with
  T.Item
  bar
    T.OnHand - T.Target { color: blue }

The gaps are 10, -15, and 0. Positive bars extend to the right of zero; negative bars extend to the left.

Product images and preview buttons. This example assumes that /catalog/images.fp already contains shirt.png and hat.png, and that the dashboard viewer can access them:

table Products = with
  [| as Name, as ImagePath |]
  [| "Shirt", "/catalog/images.fp/shirt.png" |]
  [| "Hat", "/catalog/images.fp/hat.png" |]

Products.ImageUrl = downloadUrl(Products.ImagePath)
Products.PreviewUrl = previewUrl(Products.ImagePath)

show frame "Product catalog" { 1..8, 1..8 } with
  Products.Name as "Product"
  image as "Picture"
    Products.ImageUrl
  button as "File preview"
    "Open" { href: #[Products.PreviewUrl] ; buttonVariantMode: "secondary" }

The image expression supplies the image source; the button’s href supplies the navigation destination. Both refer to the same filepack entry here.

Parent totals with order details. The grouping creates one parent row per supplier, while downstream into Orders retains the individual orders:

table Orders = with
  [| as Supplier, as Order, as Qty |]
  [| "Alpha", "PO-101", 30 |]
  [| "Alpha", "PO-102", 20 |]
  [| "Beta", "PO-103", 15 |]

show frame "Orders by supplier" { 1..8, 1..10 } with
  Orders.Supplier as "Supplier"
  sum(Orders.Qty) as "Total units"
  downstream into Orders
    Orders.Order as "Order"
    bar as "Order units"
      Orders.Qty { color: blue }
  group by Orders.Supplier

Alpha has a total of 50 units, with order details of 30 and 20 units; Beta has 15 units and one order. With an existing grouping table declared as table Suppliers[supplier] = by Orders.Supplier, the parent columns can instead use supplier and sum(Orders.Qty), followed by group into Suppliers. The downstream block stays unchanged.

Order identifiers in one cell per supplier.

table Orders = with
  [| as Supplier, as Order |]
  [| "Alpha", "PO-101" |]
  [| "Alpha", "PO-102" |]
  [| "Beta", "PO-103" |]

table Suppliers[supplier] = by Orders.Supplier

show frame "Orders by supplier" { 1..6, 1..8 } with
  supplier as "Supplier"
  list into Orders
    Orders.Order as "Orders"
  group into Suppliers

Alpha’s Orders cell contains tags for PO-101 and PO-102. Beta’s Orders cell contains a single tag for PO-103.

A taller bar column. One bar occupies each explicit column cell:

table Items = with
  [| as Item, as Qty |]
  [| "Shirt", 30 |]
  [| "Hat", 15 |]

show frame "Stock" { 1..6, 1..10 } with
  Items.Item
  column as "Units in stock" { cellHeight: 2 }
    bar
      Items.Qty { color: green }

Headers, values, and links. A header selector keeps the header’s appearance separate from that of the values. Here the quantity header has a tooltip, and the product names link to their respective pages:

table Products = with
  [| as Name, as Qty, as Page |]
  [| "Shirt", 30, "https://example.com/products/shirt" |]
  [| "Hat", 15, "https://example.com/products/hat" |]

show frame "Stock links" { 1..6, 1..8 } with
  Products.Name as "Product" { value { href: #[Products.Page] } }
  Products.Qty as "Units" {
    header { columnTooltip: "Units currently in stock" ; textAlign: right } ;
    value { textAlign: right ; textColor: blue }
  }

StyleCode

StyleCode attaches to the tile, column headers, displayed values, and display blocks. See the frame element reference and StyleCode scoping.