Blocks visualization
Blocks visualizations map your column data to individual blocks, creating an intuitive tile-based view of your information.
Mapping state
The real power of the blocks visualization is unlocked when you have access to a State column in your data.
By mapping a state values to a block, the visualization automatically changes color to reflect the health or status at a glance. Even better, changes to the health state are then rolled up through your workspace.
This makes it easy to spot issues, track trends, and understand overall system health in seconds.
Creating custom state columns
You'll often that your data streams don't have any state columns built-in, meaning that your blocks won't have any way to map their state out of the box.
In these situations, you can simply leverage the power of custom columns or SQL Analytics to define your own state columns from the other data returned by the data stream.
Expressions
- Follow the tile editor workflow as normal, selecting the Data Stream and Objects you want to visualize, and configuring any necessary Parameters,Shaping etc.
- Click Add on the Columns tab then select Custom.
- Do the following in the Configure column: New column window:
- Name:
Enter a name for the state column. - Type:
Select State. - Value Expression:
Enter a value expression which returns a state value. For example:{{ $['value'] > 5000 ? 'success' : 'error' }}Or{{ $['value'] === 'OK' ? 'success' : 'error' }}See Expressions for more info. - Click Save. The new state column to the list on the Columns tab.
- Name:
- Do the following on the Visualization tab of the right-hand pane:
- Select the Blocks visualization.
- Select the State column you created from the Mapping section of the Visualization tab. The blocks are updated to reflect the conditions you defined in the custom column's value expression.
- Click Save to save the tile.
SQL Analytics
- Follow the tile editor workflow as normal, selecting the Data Stream and Objects you want to visualize, and configuring any necessary Parameters,Shaping etc.
- Toggle Enable SQL Analytics on the toolbar and select Continue.
- Do the following in SQL analytics mode:
- On the Query tab under SQL, enter a query that uses a
CASEstatement to return a state value ofWarning,SuccessorError. TheASvalue for which you return this case is used as the State for the visualization settings.
For example, in the following query aWarningstate is returned for articles which haven't been updated in over 100 days, else the state is returned asSuccess:Query using a CASE statement to return a health state SELECT title, _updatedAt, CASE WHEN DATEDIFF(day, _updatedAt, GETDATE()) BETWEEN 90 AND 127 THEN 'Warning' WHEN DATEDIFF(day, _updatedAt, GETDATE()) > 128 THEN 'Error' ELSE 'Success' END AS State FROM dataset1 ORDER BY _updatedAt DESC; - Click Execute to run the query.
- On the Query tab under SQL, enter a query that uses a
- Do the following on the Visualization tab of the right-hand pane:
- Select the Blocks visualization.
- Select the State column you created from the Mapping section of the Visualization tab. The blocks are updated to reflect the conditions you defined in the query.
- Click Save to save the tile.