1.1.107 • Published 14 days ago

@senx/discovery-widgets v1.1.107

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
14 days ago

Discovery

Demos & Full documentation

Discovery is a dashboard as code tool. It includes dashboards generation (either through WarpScript or in an HTML page), single chart tiles and inputs as web components.

The global idea is to generate a structure which defines a dashboard and its tiles.

Tiles could depend on an execution result, so, your dashboard can change according to an alert for example.

A tile is an atomic dataviz component representing a line chart, a pie, a value, and so on. You can also define special tiles acting as inputs (ie: autocomplete, date-range, buttons, ...).

Usage

In a Web Environment

With NPM/Yarn

$ npm install @senx/discovery-widgets

With CDN

<script nomodule src="https://unpkg.com/@senx/discovery-widgets/dist/discovery/discovery.js"></script>
<script type="module" src="https://unpkg.com/@senx/discovery-widgets/dist/discovery/discovery.esm.js"></script>

Usage

<html lang="en">
<head>
  <title>Test</title>
</head>
<body>
<discovery-dashboard url="https://warp.senx.io/api/v0/exec" dashboard-title="Test">
{
  'title' 'Test'
  'description' 'Dashboard test'
  'tiles' [
    {
      'title' 'test'
      'options' { 'autoRefresh' 1 }
      'x' 0 'y' 0 'w' 12 'h' 4
      'type' 'area'
      'macro' <%
        1 4 <% 
            DROP NEWGTS 'g' STORE
            1 10 <% 
                'ts' STORE $g $ts RAND + STU * NOW + NaN NaN NaN RAND ADDVALUE DROP 
            %> FOR
            $g 
        %> FOR 
      %>
    }
  ]
}
</discovery-dashboard>
<script nomodule src="https://unpkg.com/@senx/discovery-widgets/dist/discovery/discovery.js"></script>
<script type="module" src="https://unpkg.com/@senx/discovery-widgets/dist/discovery/discovery.esm.js"></script>
</body>
</html>

Within Warp 10

Through a WarpScript:

{
    'title' 'Test'
    'description' 'Dashboard test'
    'tiles' [ 
        {
            'title' 'test'
            'options' { 'autoRefresh' 1 }
            'x' 0 'y' 0 'w' 12 'h' 4
            'type' 'area' 'macro' <%
                1 4 <% DROP NEWGTS 'g' STORE
                1 10 <% 'ts' STORE $g $ts RAND + STU * NOW + NaN NaN NaN RAND ADDVALUE DROP %> FOR
                $g %> FOR %> 
        }
    ] 
} { 'endpoint' 'https://sandbox.senx.io/api/v0/exec' } 
@senx/discovery2/render

Configuration

discovery-dashboard

This is the main Web Component.

Attributes

PropertyAttributeTypeDefaultDescription
autoRefreshauto-refreshnumber-1Reloads the dashboard each x seconds, -1 to disable it
cellHeightcell-heightnumber220If type = "scada", cell height in pixels
colscolsnumber12If type = "scada", number of columns of the grid
dashboardTitledashboard-titlestringundefinedTitle of the dashboard, not mandatory, could be overridden by the dashboard definition (see Dashboard Definition below).
debugdebugbooleanfalseEnable debug messages
optionsoptionsParam / stringnew Param()Serialized JSON options (see Params below)
typetype"dashboard" / "scada"'dashboard'Dashboard means a grid of cols columns, each tile is places in a cell with x and y. Scada means a free placement of tiles in pixels with x, y and z
urlurlstringundefinedexec url of your Warp 10 endpoint

Payload

Insert directly your dashboard definition as a WarpScript inside the HTML tag:

<discovery-dashboard url="https://warp.senx.io/api/v0/exec" dashboard-title="Test">
  {
  'title' 'Test'
  'description' 'Dashboard test'
  'tiles' [
  {
  'title' 'test'
  'options' { 'autoRefresh' 1 }
  'x' 0 'y' 0 'w' 12 'h' 4
  'type' 'area' 'macro' <%
  1 4 <% DROP NEWGTS 'g' STORE
  1 10 <% 'ts' STORE $g $ts RAND + STU * NOW + NaN NaN NaN RAND ADDVALUE DROP %> FOR
  $g %> FOR %>
  }
  ]
  }
</discovery-dashboard>

discovery-tile

This Web component displays a Tile based upon a WarpScript (or FLoWS). The WarpScript is executed when the tile renders.

PropertyAttributeTypeDefaultDescription
autoRefreshauto-refreshnumber-1Reloads the tile and execute again the script each x seconds, -1 to disable it
chartTitlechart-titlestringundefinedTitle of the Tile, not mandatory, could be overridden by the dashboard definition (see Dashboard Definition below).
debugdebugbooleanfalseEnable debug messages
optionsoptionsParam / stringnew Param()Serialized JSON options (see Params below)
typetypeline, area, scatter, step-area, spline-area, spline, step, step-after, step-before, annotation, bar, display, image, map, gauge, linear-gauge, circle, pie, plot, doughnut, rose, tabular, svg, input:text, input:list, input:secret, input:autocomplete, input:slider, input:date, input:date-range, button, hidden, calendar, heatmapChart type
urlurlstringundefinedexec url of your Warp 10 endpoint or Mobius WebSocket endpoint
langlangwarpscript, flowswarpscriptLanguage used
<discovery-tile url="warp 10 url"
                unit="°C"
                type="text"
                chart-title="Text">
  { 'data' 42 'globalParams' { 'bgColor' 'darkblue' 'fontColor' 'cyan' } }
</discovery-tile>

discovery-tile-result

This Web component displays a Tile based upon a WarpScript (or FLoWS) execution result (DataModel).

PropertyAttributeTypeDefaultDescription
chartTitlechart-titlestringundefinedTitle of the Tile, not mandatory, could be overridden by the dashboard definition (see Dashboard Definition below).
debugdebugbooleanfalseEnable debug messages
optionsoptionsParam / stringnew Param()Serialized JSON options (see Params below)
typetypeline, area, scatter, step-area, spline-area, spline, step, step-after, step-before, annotation, bar, display, image, map, gauge, linear-gauge, circle, pie, plot, doughnut, rose, tabular, svg, calendar, heatmap, input:text, input:list, input:secret, input:autocomplete, input:slider, input:date, input:date-range, buttonChart type
urlurlstringundefinedexec url of your Warp 10 endpoint
heightheightnumberFixed height of the tile
widthwidthnumberFixed width of the tile
resultresultDataModel / stringExecution result
<discovery-tile-result url="warp 10 url"
                       unit="°C"
                       type="text"
                       chart-title="Text">
  { 'data' 42 'globalParams' { 'bgColor' 'darkblue' 'fontColor' 'cyan' } }
</discovery-tile-result>

Params / Options

Options inherit from higher level. You can use options as an attribute in <discovery-dashboard />, as a field in the dashboard definition, as a field in a tile definition and as a field in execution result.

options

NameTypeDefaultDescription
typestringChart type (line, area, scatter, step-area, spline-area, spline, step, step-after, step-before, annotation, bar, display, image, map, gauge, linear-gauge, circle, pie, plot, doughnut, rose, tabular, svg, input:text, input:list, input:secret, input:autocomplete, input:slider, input:date, input:date-range, button)
timeModestring'date'date, timestamp or custom
timeZonestring'UTC'Timezone
timeUnitstring'us'Warp 10 time unit (us, ms, ns)
schemestring'WARP10'Color scheme (COHESIVE, COHESIVE_2, BELIZE, VIRIDIS, MAGMA, INFERNO, PLASMA, YL_OR_RD, YL_GN_BU, BU_GN, WARP10, NINETEEN_EIGHTY_FOUR, ATLANTIS, DO_ANDROIDS_DREAM, DELOREAN, CTHULHU, ECTOPLASM, T_MAX_400_FILM )
showLegendbooleanfalseDisplay the chart legend
fullDateDisplaybooleanfalseDisplay full date on the XAxis
unitstringUnit to be displayed
bgColorstringBackground color of tiles
datasetColorstringOnly for the param field in execution result. Color of the trace
fontColorstringFont color in tiles
borderColorstringBorder color in tiles
showLegendbooleanfalseDisplay chart legend
responsivebooleantrueResponsive charts
showRangeSelectorbooleanfalseDisplay the skyline below line or area charts
autoRefreshnumber-1if positive value, will refresh with a request each autoRefresh second for http requests, milliseconds for WebSocket
showErrorsbooleantrueDisplay errors if any
showStatusbooleantrueDisplay the Warp 10 execution status
expandAnnotationbooleanfalseExpand annotations
schemestring'WARP10'Color scheme ( COHESIVE, COHESIVE_2, BELIZE, VIRIDIS, MAGMA, INFERNO, PLASMA, YL_OR_RD, YL_GN_BU, BU_GN, WARP10, NINETEEN_EIGHTY_FOUR, ATLANTIS, DO_ANDROIDS_DREAM, DELOREAN, CTHULHU, ECTOPLASM, T_MAX_400_FILM, MATRIX, CHARTANA)
eventHandlerstring'type=Regexp,tag=Regexp'Only applies on Tiles and Dashboard. See the events chapter below

Dashboard definition

NameTypeDefaultDescription
titlestringDashboard title
descriptionstringDashboard sub-title
tilesTile[]Array of tiles

Tile definition

  • If the dashboard type is 'dashboard', x, y, h and w are expressed in cells. x and y begin at 0, the top left corner, w and h begin at 1.
  • If the dashboard type is 'scada', x, y, h and w are expressed in pixels. x and y begin at 0, the top left corner. z represents the z-index.

Data are displayed either with data or with macro. Auto-refresh for tiles only applies for macro.

NameTypeDefaultDescription
typestringChart type (line, area, scatter, step-area, spline-area, spline, step, step-after, step-before, annotation, bar, display, image, map, gauge, linear-gauge, circle, pie, plot, doughnut, rose, tabular, svg, input:text, input:list, input:secret, input:autocomplete, input:slider, input:date, input:date-range, button
endpointstringexec url of your Warp 10 endpoint or Mobius WebSocket endpoint
titlestringTile title
unitstringUnit to be displayed
xnumberX position of the Tile.
ynumberY position of the Tile.
wnumberWidth the Tile.
hnumberHeight the Tile.
znumberZ index the Tile.
data[]Array of static data computed when the dashboard is rendered. See Execution Result below.
macro<% macro %>A macro executed when the tile loads in the display. See Execution Result below.
optionsOptionOptions (see above) concerning this tile

Execution result (DataModel)

You could either return a single value ( GTS, number or string depending on the chart type), or a complex data structure:

NameTypeDescription
dataGTS, GTS[], string, numberData to display depending on the chart type
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed data depending of the index of this array
eventsEvents[]List of events to emit (see below)

Common CSS vars

NameDefault
--gts-classname-font-color#004eff
--gts-labelname-font-color#19A979
--gts-attrname-font-color#ED4A7B
--gts-separator-font-color#a0a0a0
--gts-labelvalue-font-color#000000
--gts-attrvalue-font-color#000000
--warp-view-font-color#000000
--warp-view-bg-colortransparent

Specific charts configuration and CSS styles

EventDescriptionType
drawCustomEvent<void>

line, area, scatter, spline-area, step-area, spline, step, step-after, step-before

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[], custom dataData to display, numeric GTS only
globalParamsOptionGlobal options (see above) concerning this tile, including chat type
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

Supported option per series are:

  • datasetColor: Hex CSS color of the series. ie: '#fff00f'
  • type: Chart type (line, area, scatter, step-area, spline-area, spline, step, step-after, step-before)
  • xAxis: In case of multi-X axis support, represents the index of related axis.
  • yAxis: In case of multi-Y axis support, represents the index of related axis.
1 4 <% 
  DROP NEWGTS 'g' STORE
  1 30 <% 
    'ts' STORE 
    $g $ts RAND + STU * NOW + NaN NaN NaN RAND ADDVALUE DROP 
  %> FOR
$g %> FOR STACKTOLIST 'data' STORE
{ 
  'data' $data 
  'params' [ 
    { 'datasetColor' '#dc3545' 'xAxis' 0 }
    { 'datasetColor' '#ff9900' 'xAxis' 0 }
    { 'type' 'area' 'datasetColor' '#90d743' 'xAxis' 1 }
    { 'datasetColor' 'white' 'xAxis' 0 }
  ]
}  

Custom data for line and scatter only:

<% [ 0 10 <% DROP [ RAND 10 * 5 -   RAND 10 * 5 - ] %> FOR ] %> 'rand' STORE
  {
    'title' 'Test'
    'globalParams' { }
    'data' [
      { 'label' 'A' 'values' @rand }
      { 'label' 'B' 'values' @rand }
    ]
  }

annotation

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[]Data to display, non-numeric GTS only
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

Supported option per series are:

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

bar

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

Supported option per series are:

  • datasetColor: Hex CSS color of the series. ie: '#fff00f'
  • bar
    • horizontal: Bar chart orientation
    • stacked
Custom data:
{
  "title": "Test",
  "columns": [
    "A",
    "B",
    "C",
    "D"
  ],
  "rows": [
    [
      "label X",
      15,
      56,
      44,
      22
    ],
    [
      "label Y",
      1,
      5,
      4,
      2
    ],
    [
      "label Z",
      14,
      45,
      78,
      12
    ]
  ]
}

display

NameTypeDescription
datanumber, string, custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]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.
Custom Data Samples:
{ 'data' 42 'globalParams' { 'timeMode' 'custom' } }
{ 'data' NOW 'globalParams' { 'timeMode' 'date' } }
{ 'data' NOW 5 s - 'globalParams' { 'timeMode' 'duration' } }
{
  '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' }
}

image

NameTypeDescription
datastring, string[], custom dataBase64 images to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

map

NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
Custom data:
  • string[]: considered as GEOJson
  • GTS[]: considered as Path
Options
NameTypeDescription
tilesstring[]List of custom tile layers
mapTypestringBase tile layer (NONE, DEFAULT, HOT, TOPO, TOPO2, STADIA, STADIA_DARK, TONER, TONER_LITE, TERRAIN, ESRI, SATELLITE, OCEANS, GRAY, GRAYSCALE, WATERCOLOR, CARTODB, CARTODB_DARK)
startLatnumberInitial latitude position
startLongnumberInitial longitude position
startZoomnumberInitial zoom level
maxNativeZoomnumberMaximum zoom number the tile source has available. If it is specified, the tiles on all zoom levels higher than maxNativeZoom will be loaded from maxNativeZoom level and auto-scaled.
maxZoomnumberThe maximum zoom level up to which this layer will be displayed (inclusive).
Params:

Render dots without lines:

{
  'key' 'bases'
  'render' 'dots'
  "color" "#f44336"
  "line" false
}

Render weighted dots:

{
  'key' 'sightings'
  'render' 'weightedDots'
  "color" "#31C0F6cc"
  "borderColor" "#31C0F6"
  "maxValue" 100
  "minValue" 0
}

gauge, circle

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
Params
NameTypeDescription
maxValuenumberMax value for gauge

linear-gauge

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
Options
NameTypeDescription
gauge.horizontalbooleanGauge orientation
Params
NameTypeDescription
maxValuenumberMax value for gauge

pie, doughnut, rose

NameDefault
--warp-view-chart-label-color#8e8e8e
--warp-view-chart-grid-color#8e8e8e
NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
Custom data:

{ 'key':string 'value':number }[]

tabular

NameDefault
--warp-view-datagrid-cell-padding5px
--warp-view-datagrid-odd-bg-color#ffffff
--warp-view-datagrid-odd-color#404040
--warp-view-datagrid-even-bg-color#c0c0c0
--warp-view-datagrid-even-color#000000
--warp-view-pagination-border-color#c0c0c0
--warp-view-pagination-bg-color#ffffff
--warp-view-pagination-active-bg-color#4CAF50
--warp-view-pagination-active-color#ffffff
--warp-view-pagination-active-border-color#4CAF50
--warp-view-pagination-hover-bg-color#c0c0c0
--warp-view-pagination-hover-color#000000
--warp-view-pagination-hover-border-color#c0c0c0
--warp-view-pagination-disabled-color#c0c0c0
NameTypeDescription
dataGTS, GTS[], custom dataData to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
Custom data:
{ 
  'title':string'
  'columns':string[]
  'rows' <string|number>[]
}[]

Sample:

{ 'data' {
  'title' 'Test'
  'columns'  [ 'Name' 'A' 'B' 'C' 'Link' ]
  'rows' [
    [ 'label X' 15 56 44 '<' 'a href="https://warp10.io/">Warp 10</' + 'a>' + ]
    [ 'label Y' 1 5 4 '<' 'a href="https://senx.io/">SenX</' + 'a>' + ]
    [ 'label Z' 14 45 78 '<' 'img src="https://warp10.io/assets/img/header-w-white.png" />' + ]
  ]
  } 
}

svg

NameTypeDescription
datastring[]SVG to display
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

input:text, input:secret

When used by the event mechanism, emits the value of the input.

NameDefault
--warp-view-input-font-size1rem
--warp-view-input-border-radius0.25rem
--warp-view-input-border-color#c0c0c0
--warp-view-input-label-color#404040
--warp-view-input-bg-color#ffffff
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datastring, numberInitial value of the input
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

input:list, input:autocomplete

When used by the event mechanism, emits the selected value of the input.

NameDefault
--warp-view-input-font-size1rem
--warp-view-input-border-radius0.25rem
--warp-view-input-border-color#c0c0c0
--warp-view-input-label-color#404040
--warp-view-input-bg-color#ffffff
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datastring[], number[]Content of the list
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
  • Options.input.value: Initial value

input:slider

When used by the event mechanism, emits the value of the slider.

NameDefault
--warp-view-input-font-size1rem
--warp-view-input-border-radius0.25rem
--warp-view-input-border-color#c0c0c0
--warp-view-input-label-color#404040
--warp-view-input-bg-color#ffffff
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datanumberInitial value of the input
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)
  • Options.input.min: Minimum value
  • Options.input.max: Maximum value

input:date

When used by the event mechanism, emits the timestamp in time unit of the input.

NameDefault
--warp-view-input-font-size1rem
--warp-view-input-border-radius0.25rem
--warp-view-input-border-color#c0c0c0
--warp-view-input-label-color#404040
--warp-view-input-bg-color#ffffff
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datanumberInitial timestamp of the input in time unit
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

input:date-range

When used by the event mechanism, emits the timestamps (start and end) in time unit of the input.

NameDefault
--warp-view-input-font-size1rem
--warp-view-input-border-radius0.25rem
--warp-view-input-border-color#c0c0c0
--warp-view-input-label-color#404040
--warp-view-input-bg-color#ffffff
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datanumber[]Initial timestamps of the input in time unit, start and end of the range
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

button

NameDefault
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
NameTypeDescription
datamacroMacro to exec against The Warp 10 instance when button is clicked.
globalParamsOptionGlobal options (see above) concerning this tile
paramsOption[]List of options (see above) concerning each displayed dataset depending of the index of this array
eventsEvents[]List of events to emit (see below)

Events

Tiles emit events, they also trap events. A Dashboard also traps particular events.

Events are defined in the exec result of a tile, events are emitted when parsing done.

Tiles register handlers on particular tags and event's type. You can use regular expression.

Sample:

Events

{
    'title' 'My Dashboard With events'
    'tiles' [
      {
        'type' 'display'
        'title' 'Tile A'
        'w' 1 'h' 1 'x' 0 'y' 0
        'data' ''
        'options' { 'eventHandler' 'type=(data|style),tag=tes.*' } // Events handler
      }
      {
         'type' 'button'
         'title' 'Tile B'
         'options' { 'button' { 'label' 'Click me' } }
         'w' 1 'h' 1 'x' 1 'y' 0
         'macro' <% { 'data' <%
            RAND 100 * ROUND 'v' STORE // compute a random value
            { 
              'data' ''
              'events' [
                { 'tags' [ 'test' ] 'type' 'data' 'value' $v } } // Event emitter
               ]
             }
          %> } %>
       }
    ]
}

Event's types

data
NameTypeDescription
typedata
tagsstring[]Targets
valueGTS, GTS[], string, number, custom dataThe event emitter send data to the receiver, could be any kind of data including single value, GTS list or complex data. The receiver treat this event as an execution result.

Sample:

{ 'tags' [ 'random' ] 'type' 'data' 'value' 42 } }
style
NameTypeDescription
typestyle
tagsstring[]Targets
value{key:sting, value:string}Send CSS style to be applied by the receiver with a CSS selector as key

Sample:

{ 
  'tags' [ 'foo' ] 
  'type' 'style' 
  'value' {
    '.discovery-tile' 'background-color: red !important;'
    '.value' 'color: #ffffff;' 
  }
}
zoom

Only relevant for line, area, step, annotation and bar charts.

NameTypeDescription
typezoom
tagsstring[]Targets

Sample:

{ 'tags' [ 'chart2' ] 'type' 'zoom' }
xpath

Only relevant for SVG targets.

NameTypeDescription
typexpath
tagsstring[]Targets
value{key:sting, value:string}, stringAttributes map or XML string for node replacement
selectorstringXPath selector starting at SVG (ie: /svg/g/g[2]/ellipse[3] )

If value is a string, the node targeted by the XPath selector is replaced by the XML provided in value.

If value is a map, the attributes of the node targeted by the XPath selector will be overridden with the values provided in the map. The key of the map must correspond to an attribute's name.

Sample:

{  // Node replacement
  'tags' [ 'svg' ] 
  'type' 'xpath'
  'value' '<' 'ellipse rx="15" ry="18" style="stroke:none;fill: red;" cx="50" cy="200"' + '/>' + 
  'selector' '/svg/g/g[2]/ellipse[1]'
}
{ // Attributes replacement
  'tags' [ 'svg' ]
  'type' 'xpath'
  'value' { 'rx' $v 'ry' $v }
  'selector' '/svg/g/g[2]/ellipse[3]'
}
popup

The only target is the Dashboard itself, you must declare handlers at the dashboard level.

Dashboard Event handler declaration:

{
    'title' 'My Dashboard With events'
    'options' { 'eventHandler' 'type=popup,tag=foo' }
    'tiles' [ ... ]
}

When event is trapped, a popup opens with a content.

NameTypeDescription
typepopup
tagsstring[]Targets
valueTile, DashboardOpen a Tile or a complete dashboard in a popup.

Sample:

{ 
  'tags' [ 'foo' ] 
  'type' 'popup'
  'value' { // a Tile
     'type' 'area'
     'data' [
       NEWGTS 'data' RENAME 0.0 'v' STORE
       1 500 <% 1 s * NOW SWAP - NaN NaN NaN $v RAND 0.5 - + DUP 'v' STORE ADDVALUE %> FOR
     ]
  }
}
variable

You can inject variables into macro defined in Tiles and modify value with an event. But variables must be declared at the Dashboard level with an initial value.

NameTypeDescription

| type

1.1.107

14 days ago

1.1.106

24 days ago

1.1.105

2 months ago

1.1.104

2 months ago

1.1.103

2 months ago

1.1.102

3 months ago

1.1.100

5 months ago

1.1.101

5 months ago

1.1.99

5 months ago

1.1.92

8 months ago

1.1.91

8 months ago

1.1.90

8 months ago

1.1.96

7 months ago

1.1.95

8 months ago

1.1.94

8 months ago

1.1.93

8 months ago

1.1.98

5 months ago

1.1.97

6 months ago

1.1.85

9 months ago

1.1.89

8 months ago

1.1.88

9 months ago

1.1.87

9 months ago

1.1.86

9 months ago

1.1.78

11 months ago

1.1.77

11 months ago

1.1.76

11 months ago

1.1.79

11 months ago

1.1.81

11 months ago

1.1.80

11 months ago

1.1.84

10 months ago

1.1.83

11 months ago

1.1.82

11 months ago

1.1.74

1 year ago

1.1.73

1 year ago

1.1.75

1 year ago

1.1.70

1 year ago

1.1.72

1 year ago

1.1.71

1 year ago

1.1.69

1 year ago

1.1.56

1 year ago

1.1.55

1 year ago

1.1.54

1 year ago

1.1.53

1 year ago

1.1.59

1 year ago

1.1.58

1 year ago

1.1.57

1 year ago

1.1.63

1 year ago

1.1.62

1 year ago

1.1.61

1 year ago

1.1.60

1 year ago

1.1.67

1 year ago

1.1.66

1 year ago

1.1.65

1 year ago

1.1.64

1 year ago

1.1.68

1 year ago

1.1.39

2 years ago

1.1.41

2 years ago

1.1.40

2 years ago

1.1.45

1 year ago

1.22.20

1 year ago

1.1.44

1 year ago

1.1.43

2 years ago

1.1.42

2 years ago

1.1.49

1 year ago

1.1.48

1 year ago

1.1.47

1 year ago

1.1.46

1 year ago

1.1.52

1 year ago

1.1.51

1 year ago

1.1.50

1 year ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.29

2 years ago

1.1.28

2 years ago

1.1.30

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.31

2 years ago

1.1.36

2 years ago

1.1.35

2 years ago

1.1.19

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.129

2 years ago

1.0.128

2 years ago

1.0.125

2 years ago

1.0.127

2 years ago

1.0.126

2 years ago

1.0.123

2 years ago

1.0.124

2 years ago

1.0.121

2 years ago

1.0.120

2 years ago

1.0.122

2 years ago

1.0.118

2 years ago

1.0.117

2 years ago

1.0.119

2 years ago

1.0.116

2 years ago

1.0.109

2 years ago

1.0.110

2 years ago

1.0.112

2 years ago

1.0.111

2 years ago

1.0.114

2 years ago

1.0.113

2 years ago

1.0.115

2 years ago

0.0.101

2 years ago

0.0.100

2 years ago

1.0.107

2 years ago

1.0.106

2 years ago

1.0.108

2 years ago

1.0.103

2 years ago

1.0.102

2 years ago

1.0.105

2 years ago

1.0.104

2 years ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.93

2 years ago

0.0.94

2 years ago

0.0.84

2 years ago

0.0.85

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.70

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.67

2 years ago

0.0.68

2 years ago

0.0.69

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.62

3 years ago

0.0.60

3 years ago

0.0.61

3 years ago

0.0.59

3 years ago

0.0.56

3 years ago

0.0.57

3 years ago

0.0.58

3 years ago

0.0.52

3 years ago

0.0.53

3 years ago

0.0.54

3 years ago

0.0.55

3 years ago

0.0.51

3 years ago

0.0.50

3 years ago

0.0.49

3 years ago

0.0.47

3 years ago

0.0.48

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.44

3 years ago

0.0.45

3 years ago

0.0.46

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.37

3 years ago

0.0.36

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.26

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.19

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.16

3 years ago

0.0.14

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago