display

<discovery-tile url="https://sandbox.senx.io/api/v0/exec" type="display">
  ...
</discovery-tile>
{
  'type' 'display'
  ...
  'macro' <% %>
}
Name Default
--warp-view-font-color #404040
--warp-view-font-size 1rem
Name Type Description
data number, string, 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)
  • Option.timeMode:
    • date: convert the value into an ISO date.
    • duration: convert the value to a human-readable duration.
    • custom: display value as is, including HTML.

Samples

Single value with unit

{ 
  'data' 42 
  'globalParams' { 
    'timeMode' 'custom' 
    'unit' 'mph' 
  }
}
{ 'data' 42 'globalParams' { 'timeMode' 'custom' 'unit' 'mph' } }

Fixed font size

{ 
  'data' 42 
  'globalParams' { 
    'responsive' false 
    'unit' 'mph' 
    'customStyles' {
      '*' '--warp-view-font-size: 75px;'
    }
  }
}
{ 'data' 42 'globalParams' { 'responsive' false 'unit' 'mph' 'customStyles' { '*' '--warp-view-font-size: 75px;' } } }

Date

{ 
  'data' NOW 
  'globalParams' { 
    'timeMode' 'date'
  }
}
{ 'data' NOW 'globalParams' { 'timeMode' 'date' } }

Duration

{ 
  'data' NOW 5 s - 
  'globalParams' { 
    'timeMode' 'duration' 
  }
}
{ 'data' NOW 5 s - 'globalParams' { 'timeMode' 'duration' } }

HTML

{
  'data' '<' 'a href="https://warp10.io/" target="_blank"' + '>Warp 10<' + '/a>' +
  'globalParams' { 
    'bgColor' '#f57f17' 
    'fontColor' '#bc5100' 
    'timeMode' 'custom'
  }
}
{ 'data' '<' 'a href="https://warp10.io/" target="_blank"' + '>Warp 10<' + '/a>' + 'globalParams' { 'bgColor' '#f57f17' 'fontColor' '#bc5100' 'timeMode' 'custom' } }
{
  'data' { 
    'text' 'SenX.io' 
    'url' 'https://senx.io'
  }
  'globalParams' { 
    'bgColor' '#f57f17' 
    'fontColor' '#bc5100'
  }
}
{ 'data' { 'text' 'SenX.io' 'url' 'https://senx.io' } 'globalParams' { 'bgColor' '#f57f17' 'fontColor' '#bc5100' } }

With curve

{
  'data' [ [ 100 @senx/rand/RANDOMWALK NORMALIZE ] 100.0 mapper.mul 0 0 0 ] MAP
  'globalParams' { 
    'display' {
      'labelPosition' 'se'
      'chartType' 'area'
      'showChart' true
      'decimals' 2
    }
    'bgColor' 'DodgerBlue'
    'fontColor' '#ffffff'
    'responsive' false
    'unit' '%25'
  }
}
{ 'data' [ [ 100 @senx/rand/RANDOMWALK NORMALIZE ] 100.0 mapper.mul 0 0 0 ] MAP 'globalParams' { 'display' { 'labelPosition' 'se' 'chartType' 'area' 'showChart' true 'decimals' 2 } 'bgColor' 'DodgerBlue' 'fontColor' '#ffffff' 'responsive' false 'unit' '%25' } }

Found an issue on this page or something missing?

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