List of tiles
The tiles represent the building blocks of Envision’s dashboards. Below, we list all the tiles supported by Envision.
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
show assert "My flags" with count(Id) > 20 as "More than 20 items found" sum(Orders.1) > 20 as "More than 20 orders found"
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.
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
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:
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.
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"
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
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.
This tile is intended to display a company logo. The tile displays the image file
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"
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 """ ... """
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
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.
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 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.
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; the primary color and its darker shades are applied to the graph in barchart, piechart, linechart and plot tiles; it is applied to headings in table, markdown and summary tiles, and to the displayed value itself in the case of table tiles containing one single scalar.
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 able to write multiple
exportoptions; 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
unit(scalar text): the default unit used when displaying numerical values.
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 := isMonday ? "black" : "red" show label "Monday is Black" color: myColor
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): defines how many numbers are displayed after the decimal point for the column.
quotes(scalar Boolean): when
true, forces quotes around the column data in generated CSV or TSV files. The default value is
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 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:
d: day of the month from 1 through 31
dd: same as
dbut 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 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:
- 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
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)
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 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.