gauge, circle, linear-gauge, compass

Type can be gauge, circle, linear-gauge, compass

<discovery-tile url="https://sandbox.senx.io/api/v0/exec" type="gauge">
  ...
</discovery-tile>
{
  'type' 'gauge'
  ...
  'macro' <% %>
}
Name Default
--warp-view-chart-label-color #8e8e8e
--warp-view-chart-grid-color #8e8e8e
Name Type Description
data GTS, GTS[], custom data Data to display
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)

Params

Name Type Description
maxValue number Max value for gauge

Half-circle gauge

Simple gauge

{ 
  'data' 42 
  'params' [ 
    { 'maxValue' 100 } 
  ]
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] }

Custom data format

0 3 <%
  'j' STORE
  NEWGTS 'serie' $j TOSTRING + RENAME NOW NaN NaN NaN RAND ADDVALUE
%> FOR 4 ->LIST
<%
  'gts' STORE
  {
    'key' $gts NAME
    'value' $gts VALUES 0 GET
  }
%> F LMAP 'data' STORE
{ 
  'data' $data 
  'params' [ 
    { 'maxValue' 5 } { 'maxValue' 2 } { 'maxValue' 1 } 
  ]
}
0 3 <% 'j' STORE NEWGTS 'serie' $j TOSTRING + RENAME NOW NaN NaN NaN RAND 100.0 * ROUND 100.0 / ADDVALUE %> FOR 4 ->LIST <% 'gts' STORE { 'key' $gts NAME 'value' $gts VALUES 0 GET } %> F LMAP 'data' STORE { 'data' $data 'params' [ { 'maxValue' 5 } { 'maxValue' 2 } { 'maxValue' 1 } ] }

Using color scheme as grade

{
    'data' 42 
    'params' [ { 'maxValue' 100 } ] 
    'globalParams' { 
        'scheme' 'INFERNO'
        'unit' '%25'
        'gauge' {
            'pointer' true
            'color' 'INFERNO'
        }
    } 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] 'globalParams' { 'unit' '%25' 'scheme' 'INFERNO' 'gauge' { 'pointer' true 'color' 'INFERNO' } } }

Using custom colors grade

{
    'data' 42 
    'params' [ { 'maxValue' 100 } ] 
    'globalParams' { 
        'unit' '%25'
        'gauge' {
            'pointer' true
            'color' [
                [ 0.25 '#FF6E76' ]
                [ 0.50 '#FDDD60' ]
                [ 0.75 '#58D9F9' ]
                [ 1 '#7CFFB2' ]
            ]
        }
    } 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] 'globalParams' { 'unit' '%25' 'gauge' { 'pointer' true 'color' [ [ 0.25 '#FF6E76' ] [ 0.50 '#FDDD60' ] [ 0.75 '#58D9F9' ] [ 1 '#7CFFB2' ] ] } } }

Circular gauge

{ 
  'data' 42 
  'params' [ { 'maxValue' 100 } ] 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] }

Circular gauge with auto-refresh and changing color

RAND 100 * ROUND 'v' STORE
{
  'data' $v
  'params' [
    { 
      'maxValue' 100
      'datasetColor'
        <% $v 33 < %> <% '#77BE69' %>
        <% $v 66 < %> <% '#FF9830' %>
        <% '#F24865' %> 2 SWITCH
    }
  ]
  'globalParams' {
    'unit' '°C'
  }
}
RAND 100 * ROUND 'v' STORE { 'data' $v 'params' [ { 'maxValue' 100 'datasetColor' <% $v 33 < %> <% '#77BE69' %> <% $v 66 < %> <% '#FF9830' %> <% '#F24865' %> 2 SWITCH } ] 'globalParams' { 'unit' '°C' } }

Using color scheme as grade

{
    'data' 42 
    'params' [ { 'maxValue' 100 } ] 
    'globalParams' { 
        'scheme' 'ECTOPLASM'
        'unit' '%25'
        'gauge' {
            'pointer' true
            'color' 'ECTOPLASM'
        }
    } 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] 'globalParams' { 'scheme' 'ECTOPLASM' 'unit' '%25' 'gauge' { 'pointer' true 'color' 'ECTOPLASM' } } }

Using custom colors grade

{
    'data' 42 
    'params' [ { 'maxValue' 100 } ] 
    'globalParams' { 
        'unit' '%25'
        'gauge' {
            'pointer' true
            'color' [
                [ 0.25 '#FF6E76' ]
                [ 0.50 '#FDDD60' ]
                [ 0.75 '#58D9F9' ]
                [ 1 '#7CFFB2' ]
            ]
        }
    } 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] 'globalParams' { 'unit' '%25' 'gauge' { 'pointer' true 'color' [ [ 0.25 '#FF6E76' ] [ 0.50 '#FDDD60' ] [ 0.75 '#58D9F9' ] [ 1 '#7CFFB2' ] ] } } }

compass

<div style="height: 250px">
  <discovery-tile url="https://sandbox.senx.io/api/v0/exec" type="compass" unit="°"
                  options='{ "autoRefresh": 5, "maxValue": 360 }'
  >
    { 'data' RAND 360 * ROUND 'params' [ { 'datasetColor' '#DC143C' } ] }
  </discovery-tile>
</div>
{ 'data' RAND 360 * ROUND 'params' [ { 'datasetColor' '#DC143C' } ] }

linear-gauge

Name Default
--warp-view-chart-label-color #8e8e8e
--warp-view-chart-grid-color #8e8e8e
Name Type Description
data GTS, GTS[], custom data Data to display
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)

Options

Name Type Description
gauge.horizontal boolean Gauge orientation

Params

Name Type Description
maxValue number Max value for gauge

Samples

Simple linear gauge

{ 
  'data' 42 
  'params' [ { 'maxValue' 100 } ] 
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] }

Horizontal linear gauge

{
  'data' 42
  'params' [ { 'maxValue' 100 } ]
  'globalParams' { 
   'unit' '°C'
   'gauge' { 'horizontal' true }
  }
}
{ 'data' 42 'params' [ { 'maxValue' 100 } ] 'globalParams' { 'gauge' { 'horizontal' true } 'unit' '°C' } }

Linear gauge with auto refresh

RAND 100 * ROUND 'v' STORE 
{ 
  'data' $v
  'params' [
    {
      'maxValue' 100
      'unit' '°C'
      'datasetColor'
        <% $v 33 < %> <% '#77BE69' %>
        <% $v 66 < %> <% '#FF9830' %>
        <% '#F24865' %> 2 SWITCH
    }
  ]
  'globalParams' { 'gauge' { 'horizontal' true } }
}
RAND 100 * ROUND 'v' STORE { 'data' $v 'params' [ { 'maxValue' 100 'unit' '°C' 'datasetColor' <% $v 33 < %> <% '#77BE69' %> <% $v 66 < %> <% '#FF9830' %> <% '#F24865' %> 2 SWITCH } ] 'globalParams' { 'gauge' { 'horizontal' true } } }

Found an issue on this page or something missing?

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