List of tiles in Envision

List of tiles












Home » Resources » Here

The tiles represent the building block of dashboards in Envision. Below, we list all the tiles supported by Envision.


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

  • Most tiles can take several arguments passed after the with keyword.
  • The group by statement is optional and supports multiple expressions. When group by is used, expressions should expose aggregators unless they are pre-aggregated already.
  • The order by statement is optional and supports multiple expressions as well. The statement desc can be omitted. When present, ordering is done in decreasing order.

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 provided 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 on 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:
  • color (scalar text): The primary color to draw the bars.
  • download (scalar text): The file name when the tile downloaded from the dashboard.
  • export (scalar text): The local file name where the content of the tile is expected.
  • unit (scalar text): the default unit associated to numerical values.

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 rule of thumb, we suggest to assign an height (number of grid line 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 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:
  • color (scalar text): the primary color to be used for the histogram.
  • unit (scalar text): the default unit to be applied to numerical values.

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 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:
  • color (scalar text): the primary color used to draw the first line.
  • unit (scalar text): the default unit used for numerical values.

At the column level, the options available at:
  • color (scalar text): the color to be used for the line associated to the column.
  • unit (scalar text): a second unit can be defined. When a second unit is defined, both the Y-axis on the left and the one on the right come with graduations.

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 you help produce a readable document on the web.
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:
  • color (scalar text): the primary color used to display the plotted line.
  • unit (scalar text): the unit to be applied by default to numerical values.

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:

  • color (scalar text): the primary color used for the tile.
  • date (scalar text): the default date format for dates columns (see below for the format specification).
  • download (scalar text): the default file name used when the tile is downloaded by a user from the dashboard.
  • export (scalar text): the file path where the content of the table gets stored within the Lokad account. For example "export: "/foo/bar.csv". It is allowed to write multiple export options; multiple exports will be created accordingly.
  • numbers (scalar text): the default number format for numeric columns (see below for the format specification).
  • precision (scalar number): define how many numbers are displayed after the decimal point for all numeric columns.
  • quotes (scalar Boolean): when true, forces quotes around the data in generated CSV or TSV files. The default value is false.
  • unit (scalar text): the default unit used when displaying numerical values.

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 (scalar text): the date format for this column (see below for the format specification).
  • display (scalar Boolean): indicates whether the column will be displayed in the dashboard. The default value is true. Not displaying a column can be of interest if the intent is only to export the column to a file.
  • export (scalar Boolean): indicates whether the column will be exported to a file. The default value is true. Not exporting a column can be of interest if the intent is only to display the column in the dashboard.
  • numbers (scalar text): the number format for a numeric column (see below for the format specification).
  • precision (scalar number): define how many numbers are displayed after the decimal point for the coluumn.
  • quotes (scalar Boolean): when true, forces quotes around the column data in generated CSV or TSV files. The default value is false.
  • unit (scalar text): the unit used when displaying numerical values for the column.

Date format strings

The format string for dates is a mini-syntax that let 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:

  • d: day of the month from 1 through 31
  • dd: same as d but 0 prefixed
  • ddd: abbreviated day of the week (ex: Mon, Tue...)
  • dddd: Full day of the week (Monday...)
  • MM: month number from 1 through 12.
  • MMM: abbreviated name of the month (ex: Jan, Feb, ...)
  • MMMM: Full name of the month (June)
  • yy: Year number from 00 to 99, ignore the hundreds and thousands
  • yyyy: year with four digits.

Any other characters are used as-in in the output string.

Number format strings

The format string for numbers is a mini-syntax that let you 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:
  • The character after the initial 1 is the thousand separator. It can be can be omitted.
  • The character before the last zeroes is the decimal separator. It can be omitted.

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 intended to better grasps 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.