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

  1. Follow the tile editor workflow as normal, selecting the Data Stream and Objects you want to visualize, and configuring any necessary Parameters,Shaping etc.
  2. Click Add
    on the Columns tab then select Custom.
  3. Do the following in the Configure column: New column window:
    1. Name:
      Enter a name for the state column.
    2. Type:
      Select State.
    3. 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.
    4. Click Save. The new state column to the list on the Columns tab.
  4. Do the following on the Visualization tab of the right-hand pane:
    1. Select the Blocks visualization.
    2. 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.
  5. Click Save to save the tile.

SQL Analytics

  1. Follow the tile editor workflow as normal, selecting the Data Stream and Objects you want to visualize, and configuring any necessary Parameters,Shaping etc.
  2. Toggle Enable SQL Analytics on the toolbar and select Continue.
  3. Do the following in SQL analytics mode:
    1. On the Query tab under SQL, enter a query that uses a CASE statement to return a state value of Warning, Success or Error. The AS value for which you return this case is used as the State for the visualization settings.

      For example, in the following query a Warning state is returned for articles which haven't been updated in over 100 days, else the state is returned as Success:
      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;
    2. Click Execute to run the query.
  4. Do the following on the Visualization tab of the right-hand pane:
    1. Select the Blocks visualization.
    2. 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.
  5. Click Save to save the tile.

Blocks settings

Mapping

Setting
Description
State
Select the column that you want to use for the state color of each block. Available options will vary depending on the data stream that you have selected. By default, the State column is automatically selected.
Label
Choose the label for the block.
Sublabel
Choose the sublabel to be shown beneath the main block label.
Link
Select the column that you want to use for the link of each block. Available options will vary depending on the data stream that you have selected.

Layout

Setting
Description
Max columns
Set the number of columns the blocks are displayed in.
Manual height
Select this to be able to resize the blocks, larger or smaller.

Options

Setting
Description
Wrap text
Select to wrap the block text onto a new line if it overflows the container.

Was this article helpful?


Have more questions or facing an issue?