List of tiles

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

Table of contents

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) as "Stock value"
  group by Brand

No column options are allowed.

Error 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"

Form tile

This tile is intended to display a form where 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. Variables defined in forms are always scalars and their type should be explicitly declared.

expect Form.Coef : number
expect Form.IsTicked : boolean
show form "My settings" with
  Form.Coef as "Coefficient"
  Form.IsTicked as "Check this case to modify the coefficient"

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

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. Linechart 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.

Line chart also supports group by SomeDate. To see how group by SomeDate can be used in practice, refer to dashboard slicing.

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 """ ... """

The markdown tile offers a printable version. In order to access this feature, expand the markdown tile with single click on the tile itself, and then click the button Display plain tile in the top right corner.

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) as "Stock value"
  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

Scalar tile

The scalar tile is created with show scalar:

show scalar "options" {tileColor: "red" ; unit: "$" } with 123

Besides numbers, dates, text and booleans, a scalar tile can also be used to display ranvar and zedfunc. For displaying ranvar and zedfunc, the tile will result in a histogram or a plot.

show scalar "Poisson Law" {tileColor: "red"} with poisson(3)

Scatter tile

The tile is a type of plot or mathematical diagram using Cartesian coordinates and is intended to display values for two different numeric variables for a set of data. Scatter plots display dots. The position of each dot on the horizontal and vertical axis indicates values for an individual data point. Scatter plots facilitate the observation of the relationships between variables.

show scatter "Show scatter: X-axis: PO Quantity, Y-axis: PO NetAmount" with
  PO.Quantity as "Quantity"
  PO.NetAmount as "NetAmount"

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 "Stock on Hand"
  sum(StockOnOrder) as "Stock 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 scalar "options" {color: "red" unit: "$"} with 123

The list of options available are:

Moreover, Envision provides the possibility of specifying the color as a named runtime option. In the following example, the color of the tile changes depending on the present day (black on Monday, and red for all the other days):

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

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 "Product ID"
  StockOnHand as "Stock 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 scalar "Last sold" date: "yyyy-MM-dd" with max(Orders.Date)
//equivalent to
oend = max(Orders.Date)
show scalar "Last sold" with "\{oend:yyyy-MM-dd}"

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 scalar "Total sold" number:"1,000.00" with

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 scalar "Total Stock Value" with
  sum(StockOnHand * BuyPrice)

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 "customsuppliers" as MySuppliers with
  SupplierId : text
  SupplierQuota : number
  SupplierCountry : text

show upload "Supplier settings" editable:"customsuppliers"

Unlike other tiles, the upload tile is tightly coupled with a corresponding read upload statement by means of a shared identifier (in the above example, "customsuppliers" is the shared identifier). 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 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.