--
events: true
Dynamic dashboards
A random value affect the visibility of tiles.
{
'title' 'My Polymorphic Dashboard'
'cellHeight' 90
'vars' { 'rand' 100 }
'tiles' [
{
'title' 'Random value'
'type' 'display' 'x' 0 'y' 0 'w' 2 'h' 2 'unit' '%25'
'options' { 'autoRefresh' 3 }
'macro' <%
RAND 100 * ROUND 'v' STORE
{
'data' $v
'events' [
{ 'tags' 'rand' 'type' 'variable' 'selector' 'rand' 'value' { 'rand' $v } }
]
'globalParams' {
'bgColor' <% $v 33 < %> <% '#77BE69' %> <% $v 66 < %> <% '#FF9830' %> <% '#F24865' %> 2 SWITCH
'timeMode' 'custom'
'fontColor' 'white'
}
}
%>
}
{
'type' 'area' 'x' 2 'y' 0 'w' 10 'h' 4
'options' {
'scheme' 'CHARTANA'
'eventHandler' 'type=variable,tag=rand'
}
'macro' <%
{
'data' NEWGTS 'data' RENAME 0.0 'v' STORE 1 30 <% 1 s * NOW SWAP - NaN NaN NaN $v RAND 0.5 - + DUP 'v' STORE ADDVALUE %> FOR
'globalParams' {
'type' <% $rand 50 < %> <% 'area' %> <% 'hidden' %> IFTE
}
}
%>
}
{
'type' 'map' 'x' 2 'y' 0 'w' 10 'h' 4
'options' {
'eventHandler' 'type=variable,tag=rand'
}
'macro' <%
NEWGTS 'g' STORE
0 100 <% 'ts' STORE $g NOW $ts 10000 - * RAND 20 * RAND 20 * NaN RAND 100.0 * ROUND ADDVALUE DROP %> FOR
{
'data' [ $g ]
'params' [ { 'map' { 'heatmap' true } } ]
'globalParams' {
'map' { 'heatRadius' 25 'heatOpacity' 0.5 }
'type' <% $rand 50 >= %> <% 'map' %> <% 'hidden' %> IFTE
}
}
%>
}
]
}
Found an issue on this page or something missing?
Tell us onThe Lounge, the Warp 10 Community Slack.