List of tiles

The tiles represent the building blocks of Envision’s dashboards. Below, we list all the tiles supported by Envision.

Tile syntax
Color as a runtime option
assert tile
barchart tile
form tile
histogram tile
label tile
linechart tile
logo tile
markdown tile
piechart tile
plot tile
summary tile
table tile
Tile-level options
Column-level options
Date format strings
Number format strings
Single value display
treemap tile
upload tile

Tile syntax

The generic inline syntax for a tile is:

show table "hello" a1c2 tomato with
  x
  sum(y)
  avg(z)
  group by [x,a]
  order by [max(y), b] desc

The first argument after the tile name (table above) is the title of the tile. The title is followed by its position and size within the dashboard, encoded as an Excel-like grid (letters refer to column, numbers to lines). Finally, the color is specified, either as one of the web color, or as their hex name but without the # sign (ex: FF6347 for tomato).

The expressions passed as arguments after the with are automatically aligned by Envision, in order to treat the input data as a table for the tile. This input table can be exported with the syntax:

show table "hello" a1c2 tomato export:"/mytable.tsv" with x, y, z

The file formats CSV, TSV, XLSX (Excel) and RFF (raw flat file) are supported. If the specified file extension is unknown, then the export will trigger an error.

It is also possible to export the tile in two - or more - locations at once, using multiple export statements:

show table "hello" a1c2 tomato export:"/foo1.tsv" export:"/foo2.tsv" with x, y, z

In practice, as the entire statement for a tile tends to be long, Envision also provides a tile block syntax with:

show table "hello" a1c2 tomato export:"/foo1.tsv" export:"/foo2.tsv" with
  x as "My Name" 
  sum(y) as "My total" unit: "$"
  avg(z)
  group by [x, a]
  order by [max(y), b]

Color as a runtime option

The compact inline syntax for the tile color has one drawback: it’s not possible to programmatically pick your color. Envision provides the possibility to specify the color as a named option:

isMonday := today() mod 7 == 0
myColor := isMonday ? "black" : "red"
show label "Monday is Black" color: myColor

The option color expects a scalar text value. In the example above, the color of the tile changes depending on the present day. It will be black on Monday, and red for all the other days.

assert tile

This tile is intended to purposefully mark a run as failed if certain conditions are not met with the data. A list of conditions can be listed after the with keyword.

show assert "My flags" with
  count(Id) > 20 as "More than 20 items found"
  sum(Orders.1) > 20 as "More than 20 orders found"

barchart tile

This tile is intended to display a barchart. The expression passed after the with keyword should offer an aggregator. An explicit group by statement is expected.

show barchart "Stock per Brand" unit: "$" with
  sum(StockOnHand * PurchasePrice)
  group by Brand

The options available at the tile level are:

No column options are allowed.

form tile

This tile is intended to display a form where the values can be manually entered from the dashboard view. The variables listed for display in this tile are expected to be attached to the virtual Form table.

show form "My settings" with
  Form.myValue as "My Value"
  Form.secondValue as "Second Value"

Variables defined in forms are always scalar. Their scalar type is inferred from usage within the script. It is possible to list multiple variables within the form. As a rule of thumb, we suggest to assign a height (number of grid lines covered) equal to N+1, where N is the number of input Form variables listed after the with.

histogram tile

This tile is intended to display an histogram. Unlike the barchart, the bars of the histogram are vertical. The histogram tile expects only a single numeric vector to be provided as an argument.

show histogram "Quantities ordered" with
  Orders.Quantity

Also, the histogram tile can be used to display a scalar distribution:

show histogram "Poisson Law" with poisson(3)

If you have produced a probabilistic demand forecast, a single item needs to be selected. This can be achieved with:

where Id == "123"
  show histogram "My Forecast" with same(Demand)

At the tile level, the available options are:

There are options at the column level.

label tile

This tile is purely intended to display a piece of text within the dashboard. This is the simplest tile that takes no input data.

show label "Hello World"

linechart tile

This tile is intended to display time-series. This tile takes date-indexed data as input. Multiple expressions can be passed as an argument after the with keyword.

Week.sold := sum(Orders.NetAmount)
show linechart "Week sold/purchased" unit: "$" with
  Week.sold as "Sold" color: "red"
  sum(PO.NetAmount) color: "blue"

While the color can be defined at the tile-level - just like any other tile - it is also possible to specify the color of each line to be plotted, as illustrated above.

At the tile level, the options available are:

At the column level, the options available at:

logo tile

This tile is intended to display a company logo. The tile displays the image file logo.png or logo.jpg that should be located at the root of your Lokad account. If you haven’t uploaded such a logo file yet, the tile will propose to upload the image file. The recommended dimensions for the logo are 150x70px (one column wide) or 310x70px (two columns wide).

show logo "My Company"

markdown tile

This tile is intended to display contextual documentation formatted in Markdown, a very simply markup language that can help you produce a readable document online.

show markdown "My title" a6h6 with """
# Part A
## Subpart A.1
A list of **important** remarks.

* remark 1
* remark 2
* remark 3

## Subpart A.2
# Part B

Less important remarks.
"""

We recommend leaving the title empty, as the tile title is usually redundant with the title defined within the Markdown section itself, as illustrated by:

show markdown "" with """ ... """

piechart tile

This tile is intended to display a piechart. The expression passed after the with keyword should offer an aggregator. An explicit group by statement is expected.

show piechart "Stock per Brand" unit: "$" with
  sum(StockOnHand * PurchasePrice)
  group by Brand

plot tile

The tile is intended to display a function f(x)=y.

show plot "My function" with T.X, T.Y

The tile-level options that are available are:

summary tile

This tile is intended to gather multiple scalar values, typically KPIs. Each value can be associated to a label and a unit.

show summary "Key stock figures" a1b2 with
  sum(StockOnHand) as "Units on hand"
  sum(StockOnOrder) as "Units on order"
  sum(Stock * BuyPrice) as "Stock value" unit: "$"

table tile

The table is the most versatile tile offered by Envision. This tile is intended to display a table, and this table can optionally be exported as a flat file.

show table "Top sellers" export:"/tops.tsv" with
  Supplier as "Supplier Name"
  Category as "Category"
  sum(Orders.NetAmount) as "Sold" unit:"$"
  group by [Supplier, Category]
  order by sum(Orders.NetAmount) desc

The table tile supports both the group by and order by aggregation options. In both cases, a tuple can be provided instead of a single value.

Tile-level options

The table tile supports multiple options defined at the tile-level. Those options are specified after the title, as illustrated by:

show table "options" color: "red" unit: "$" with 123

The list of options available are:

Column-level options

Each column can benefit from options on its own. This syntax is illustrated by:

show table "Some column-level options" with
  Id as "Produce ID"
  StockOnHand as "On Hand" unit: "ea"
  BuyPrice unit: "$"

The list of options at the column level are:

Date format strings

The format string for dates is a mini-syntax that lets you specify how the dates should be formatted in the table tile. For example:

show table "Last sold"  date: "yyyy-MM-dd" with
  max(Orders.Date)

The available tokens are:

Any other characters are used as in the output string.

Number format strings

The format string for numbers is a mini-syntax that allows you to specify how the numbers should be formatted in the table tile. For example:

show table "Total sold" number:"1,000.00" with
  sum(Orders.NetAmount)

The syntax imitates the actual desired output for the numbers:

Single value display

When a table tile contains only a single column and a single line, the table display is adjusted to reflect a single value display.

show table "Total Stock Value" with
  sum(StockOnHand * BuyPrice)

treemap tile

The treemap tile displays a treemap. Treemaps are intended to better grasp the respective weights of elements within a potentially large dataset. This tile expects two arguments: first the label, second the value. Then a grouping is expected to be specified through the group by statement.

show treemap "Stock Value" with
  Name
  StockOnHand * PurchasePrice
  group by Category

The cells displayed by the treemap are proportional to the sum of the values.

upload tile

The upload tile is intended to facilitate the upload of typically smaller files directly from an Envision dashboard, without navigating back and forth to the Files area in your Lokad account. When considering complex simulators that involve many parameters, it is often simpler to have all those parameters gathered in a spreadsheet, as opposed to entering all those values within a web page. While it is possible to upload such a spreadsheet like any other file in your Lokad account, it is more practical if the upload can happen directly within the dashboard. The upload tile is precisely intended to support this use case.

read upload as MySuppliers[*] with 
  SupplierId : text
  SupplierQuota : number
  SupplierCountry : text

show upload "Supplier settings" with MySuppliers.*

Unlike other tiles, the upload tile is tightly coupled with a corresponding read upload statement. Indeed, the syntax offers a way to treat the data uploaded by the user, just like any other table also accessible to Envision. The syntax lets you specify the expected format for the table columns to be uploaded within the dashboard. Also, just like any other data inputs, Envision provides a complete versioning of the uploaded files previously processed. The previously uploaded files can be re-downloaded from the Run History link of the dashboard.

This upload feature is accessible to any user who has access to the dashboard, without requiring the user to have access to the file storage area of your Lokad account. Thus the upload tile is also handy to provide more granular user accesses.