annotation

Name Default
--warp-view-chart-label-color #8e8e8e
--warp-view-chart-grid-color #8e8e8e
Name Type Description
data GTS, GTS[] Data to display, non-numeric GTS only
globalParams Option Global options (see above) concerning this tile
params Option[] List of options (see above) concerning each displayed dataset depending of the index of this array
events Events[] List of events to emit (see below)

Dedicated options:

  • expandAnnotation: boolean
  • displayExpander: boolean

Supported options per series are:

  • datasetColor: Hex CSS color of the series. ie: '#fff00f'
  • key: Name the series

Samples

Simple annotation

0 5 <% 'j' STORE NEWGTS 'serie' $j TOSTRING + RENAME 'gts' STORE 0 30 <% 'ts' STORE $gts $ts RAND + STU * NOW + NaN NaN NaN true ADDVALUE DROP %> FOR $gts %> FOR
{
  'type' 'annotation'
  'macro' <% 
    0 5 <%
      'j' STORE
      NEWGTS 'serie' $j TOSTRING + RENAME 'gts' STORE
      0 30 <%
        'ts' STORE $gts $ts RAND + STU * NOW + NaN NaN NaN true ADDVALUE DROP
      %> FOR
      $gts
    %> FOR
  %>
}
<discovery-tile url="https://sandbox.senx.io/api/v0/exec" type="annotation">
0 5 <%
  'j' STORE
  NEWGTS 'serie' $j TOSTRING + RENAME 'gts' STORE
  0 30 <%
    'ts' STORE $gts $ts RAND + STU * NOW + NaN NaN NaN true ADDVALUE DROP
  %> FOR
  $gts
%> FOR
</discovery-tile>

With Boolean Values

NEWGTS 'boolannotation, not ordered' RENAME 3 NaN NaN NaN T ADDVALUE 4 NaN NaN NaN T ADDVALUE 2 NaN NaN NaN T ADDVALUE 10 NaN NaN NaN T ADDVALUE 1 NaN NaN NaN T ADDVALUE 'g' STORE $g CLONE 'boolannotation, sorted' RENAME SORT 'data' STORE { 'data' [ $g $data ] 'params' [ $g $data ] <% 'g' STORE { 'key' $g NAME } %> F LMAP 'globalParams' { 'timeMode' 'timestamps' } }
{
  'type' 'annotation'
  'macro' <% 
    NEWGTS 'boolannotation, not ordered' RENAME
    3 NaN NaN NaN T ADDVALUE
    4 NaN NaN NaN T ADDVALUE
    2 NaN NaN NaN T ADDVALUE
    10 NaN NaN NaN T ADDVALUE
    1 NaN NaN NaN T ADDVALUE
    'g' STORE
    $g CLONE 'boolannotation, sorted' RENAME SORT 'data' STORE
    {   
      'data' [ $g $data ]
      'params' [ $g $data ] <% 'g' STORE { 'key' $g NAME } %> F LMAP
      'globalParams' { 'timeMode' 'timestamps' }
    }
  %>
}
<discovery-tile url="https://sandbox.senx.io/api/v0/exec" type="annotation">
NEWGTS 'boolannotation, not ordered' RENAME
3 NaN NaN NaN T ADDVALUE
4 NaN NaN NaN T ADDVALUE
2 NaN NaN NaN T ADDVALUE
10 NaN NaN NaN T ADDVALUE
1 NaN NaN NaN T ADDVALUE
'g' STORE
$g CLONE 'boolannotation, sorted' RENAME SORT 'data' STORE
{   
  'data' [ $g $data ]
  'params' [ $g $data ] <% 'g' STORE { 'key' $g NAME } %> F LMAP
  'globalParams' { 'timeMode' 'timestamps' }
}
</discovery-tile>

Point of Interest

A Point of Interest (POI) is a specific datapoint you decide to focus on by clicking on it. It emits an event which contains the list of POIs. By listening this kind of event, you can decide how to handle them.

{ 'cellHeight' 90 'vars' { 'myPOIs' [] // The dedicated var that contains POIs } 'tiles' [ { // annotation with POI support 'type' 'annotation' 'x' 0 'y' 0 'w' 12 'h' 2 'options' { 'timeMode' 'timestamp' 'eventHandler' 'type=variable,tag=markers' 'poi' T 'poiColor' 'blue' 'poiLine' 'dotted' } 'macro' <% [ 1 4 <% 'i' STORE NEWGTS 'data-' $i TOSTRING + RENAME 'g' STORE 1 10 <% 'ts' STORE $g $ts NaN NaN NaN T ADDVALUE DROP %> FOR $g %> FOR ] 'data' STORE { 'data' $data 'events' [ { 'tags' [ 'pois' ] 'type' 'poi' 'selector' 'myPOIs' } ] } %> } { // Display selected POIs 'title' 'POI' 'type' 'tabular' 'x' 0 'y' 2 'w' 12 'h' 3 'options' { 'eventHandler' 'type=poi,tag=pois' } 'macro' <% { 'data' { 'columns' [ 'date' 'name' 'value' ] 'rows' $myPOIs <% 'date' GET %> SORTBY <% 'p' STORE [ $p 'date' GET $p 'name' GET $p 'value' GET ] %> F LMAP } 'globalParams' { 'tabular' { 'fixedWidth' true } } } %> } ] }
{
  'cellHeight' 90
  'vars' {  
     'myPOIs' [] // The dedicated var that contains POIs
  }
  'tiles' [
    { // annotation with POI support
      'type' 'annotation' 'x' 0 'y' 0 'w' 12 'h' 2
      'options' { 
        'timeMode' 'timestamp' 
        'eventHandler' 'type=variable,tag=markers' 
        'poi' T
        'poiColor' 'blue'
        'poiLine' 'dotted'
       }
      'macro' <%
        [ 
          1 4 <% 
            'i' STORE NEWGTS 'data-' $i TOSTRING + RENAME 'g' STORE
            1 10 <% 'ts' STORE $g $ts NaN NaN NaN T ADDVALUE DROP %> FOR
            $g
          %> FOR
        ] 'data' STORE
        { 
          'data' $data
          'events' [
            { 'tags' [ 'pois' ] 'type' 'poi' 'selector' 'myPOIs' }
          ]
        }
      %>
    }
    { // Display selected POIs
      'title' 'POI'
      'type' 'tabular' 'x' 0 'y' 2 'w' 12 'h' 3
      'options' { 'eventHandler' 'type=poi,tag=pois' }
      'macro' <%
        {
          'data' {
            'columns'  [ 'date' 'name' 'value' ]
            'rows' $myPOIs <% 'date' GET %> SORTBY <% 
              'p' STORE
              [ $p 'date' GET $p 'name' GET $p 'value' GET ] 
            %> F LMAP
          }
          'globalParams' {
            'tabular' { 'fixedWidth' true }
          }
        }
      %>
    }      
  ]
}
<discovery-dashboard  url="https://sandbox.senx.io/api/v0/exec">
{
  'cellHeight' 90
  'vars' {  
     'myPOIs' [] // The dedicated var that contains POIs
  }
  'tiles' [
    { // annotation with POI support
      'type' 'annotation' 'x' 0 'y' 0 'w' 12 'h' 2
      'options' { 
        'timeMode' 'timestamp' 
        'eventHandler' 'type=variable,tag=markers' 
        'poi' T
        'poiColor' 'blue'
        'poiLine' 'dotted'
       }
      'macro' <%
        [ 
          1 4 <% 
            'i' STORE NEWGTS 'data-' $i TOSTRING + RENAME 'g' STORE
            1 10 <% 'ts' STORE $g $ts NaN NaN NaN T ADDVALUE DROP %> FOR
            $g
          %> FOR
        ] 'data' STORE
        { 
          'data' $data
          'events' [
            { 'tags' [ 'pois' ] 'type' 'poi' 'selector' 'myPOIs' }
          ]
        }
      %>
    }
    { // Display selected POIs
      'title' 'POI'
      'type' 'tabular' 'x' 0 'y' 2 'w' 12 'h' 3
      'options' { 'eventHandler' 'type=poi,tag=pois' }
      'macro' <%
        {
          'data' {
            'columns'  [ 'date' 'name' 'value' ]
            'rows' $myPOIs <% 'date' GET %> SORTBY <% 
              'p' STORE
              [ $p 'date' GET $p 'name' GET $p 'value' GET ] 
            %> F LMAP
          }
          'globalParams' {
            'tabular' { 'fixedWidth' true }
          }
        }
      %>
    }      
  ]
}
        </discovery-dashboard>

Found an issue on this page or something missing?

Tell us onSlack iconThe Lounge, the Warp 10 Community Slack.