false 'debug' STORE // add a debug panel to understand events
true 'showLine' STORE
true 'showTabular' STORE
[ 'monnerville' 'la_decouverte' ] 'labelSelection' STORE // input list lycee
$labelSelection 0 GET 'labelName' STORE // variable default value (Lycee Monnerville)
NOW 86400000000 / 86400000000 * 'endDate' STORE
$endDate 24 h + 'endDate' STORE
$endDate 24 h - 'startDate' STORE // variable default value
[] 'class' STORE
{
'title' 'Data Explorer CMQE IF'
//'description' 'test'
'type' 'flex' // flex : no need to specify each tile x y position
'cols' 5 // 4 columns
'cellHeight' 240
'vars' { // list of dashboard variables (can be set via dashboard url too)
'labelName' $labelName // default value
'class' $class
'endDate' $endDate
'startDate' $startDate
'range' 0
'_bucketizer' 'bucketizer.mean'
'gts' [ ]
}
'options' { 'showLoader' true 'showErrors' true 'scheme' 'INFERNO' }
'tiles' [
// debug area
$debug
<%
{ // this display will help you to debug your event source
'type' 'display' 'w' 6 'h' 1
'title' 'debug panel'
'options' { 'eventHandler' 'type=variable,tag=input' } // suscribe to input
'macro' <%
$labelName
%>
}
%> IFT
// List lycée
{
'type' 'input:list' 'w' 1 'h' 1
'title' 'Sélection lycée'
'macro' <% {
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' 'labelName' } ]
'globalParams' { 'input' { 'value' $labelName } } // default value
'data' !$labelSelection
} %>
}
{
'type' 'input:multi-cb' 'w' 2 'h' 1
'options' { 'eventHandler' 'type=variable,tag=input' }
'macro' <%
[ @pia/tokenR '~.*' { 'lycee' $labelName } ] FINDSETS 3 ROLL 'class' STORE
{
'data' $class
'events' [ { 'type' 'variable' 'tags' [ 'input' ] 'selector' 'class' } ]
}
%>
}
{
'type' 'input:date' 'w' 1 'h' 1
'title' 'Date de début'
'macro' <% {
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' 'startDate' } ]
'data' $startDate
} %>
}
{
'type' 'input:date' 'w' 1 'h' 1
'title' 'Date de fin'
'macro' <% {
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' 'endDate' } ]
'data' $endDate
} %>
}
{
'type' 'button:radio' 'w' 2
'macro' <% {
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' 'range' } ]
'data' [
{ 'label' 'None' 'value' 0 'active' true }
{ 'label' '1s' 'value' 1 }
{ 'label' '1min' 'value' 60 }
{ 'label' '1h' 'value' 3600 }
{ 'label' '24h' 'value' 86400 }
]
} %>
}
{
'type' 'button:radio' 'w' 3
'macro' <% {
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' '_bucketizer' } ]
'data' [
{ 'label' 'first' 'value' 'first' }
{ 'label' 'last' 'value' 'last' }
{ 'label' 'mean' 'value' 'mean' 'active' true }
{ 'label' 'min' 'value' 'min' }
{ 'label' 'max' 'value' 'max' }
]
} %>
}
$showLine
<%
{
'type' 'line' 'w' 3 'h' 1
'options' { 'eventHandler' 'type=variable,tag=input' 'showLegend' true 'showControls' true }
'macro' <%
'events' [ { 'tags' 'input' 'type' 'variable' 'selector' 'gts' } ]
$class SIZE
<% 0 > %>
<%
$class
<%
'nclass' STORE
[ @pia/tokenR $nclass { 'lycee' $labelName } $startDate ISO8601 $endDate ISO8601 ] FETCH
$range
<% 0 > %>
<%
<% $_bucketizer 'mean' == %> <% [ SWAP bucketizer.mean 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'last' == %> <% [ SWAP bucketizer.last 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'first' == %> <% [ SWAP bucketizer.first 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'max' == %> <% [ SWAP bucketizer.max 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'min' == %> <% [ SWAP bucketizer.min 0 $range s 0 ] BUCKETIZE %>
<% [ SWAP bucketizer.mean 0 $range s 0 ] BUCKETIZE %>
5 SWITCH
%> IFT
%> FOREACH APPEND
%> IFT
%>
}
%>
IFT
$showTabular
<%
{
'type' 'tabular' 'w' 2 'h' 1
'options' { 'eventHandler' 'type=variable,tag=input' 'showControls' true }
'macro' <%
$class SIZE
<% 0 > %>
<%
$class
<%
'nclass' STORE
[ @pia/tokenR $nclass { 'lycee' $labelName } $startDate ISO8601 $endDate ISO8601 ] FETCH
$range
<% 0 > %>
<%
<% $_bucketizer 'mean' == %> <% [ SWAP bucketizer.mean 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'last' == %> <% [ SWAP bucketizer.last 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'first' == %> <% [ SWAP bucketizer.first 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'max' == %> <% [ SWAP bucketizer.max 0 $range s 0 ] BUCKETIZE %>
<% $_bucketizer 'min' == %> <% [ SWAP bucketizer.min 0 $range s 0 ] BUCKETIZE %>
<% [ SWAP bucketizer.mean 0 $range s 0 ] BUCKETIZE %>
5 SWITCH
%> IFT
%> FOREACH
%> IFT
%>
}
%>
IFT
]
}