Blame view

controllets/data-sevc-controllet/data-sevc-controllet.html 5.79 KB
0f6424fe   root   update new data-s...
1
2
  <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>

  <link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">

eae8bcd8   Renato De Donato   localization
3
  

052ca020   Andrea Petta   controllet langua...
4
  <script src="../../locales/controllet_ln.js"></script>

6d2a2a1e   Andrea Petta   language handling
5
  

938d1928   Luigi Serra   Update documentat...
6
  <link rel="import" href="../../bower_components/polymer/polymer.html">

938d1928   Luigi Serra   Update documentat...
7
  

0f6424fe   root   update new data-s...
8
  <link rel="import" href="../page-slider-controllet/page-slider-controllet.html">

a53fbbed   Renato De Donato   select-dataset ne...
9
  

a53fbbed   Renato De Donato   select-dataset ne...
10
  <link rel="import" href="../select-dataset-controllet/select-dataset-controllet.html">

7a8b7446   Renato De Donato   filters data-sevc
11
  <link rel="import" href="../select-data-controllet/select-data-controllet.html" />

fb05b400   Renato De Donato   controllet 2.0, n...
12
  <link rel="import" href="../select-visualization-controllet/select-visualization-controllet.html" />

a53fbbed   Renato De Donato   select-dataset ne...
13
  

938d1928   Luigi Serra   Update documentat...
14
  <dom-module id="data-sevc-controllet">

73bcce88   luigser   COMPONENTS
15
  

0f6424fe   root   update new data-s...
16
      <template>

74249687   Luigi Serra   Cross browser con...
17
  

0f6424fe   root   update new data-s...
18
          <page-slider-controllet id="slider">

486a1c48   Luigi Serra   selection control...
19
  

0f6424fe   root   update new data-s...
20
              <neon-animatable>

0e9aeacd   root   localization l20n
21
  

89558a41   Renato De Donato   datatype, provide...
22
                  <select-dataset-controllet id="select_dataset" datasets={{datasets}} suggested-datasets={{suggestedDatasets}}></select-dataset-controllet>

0e9aeacd   root   localization l20n
23
  

0f6424fe   root   update new data-s...
24
              </neon-animatable>

24be6abb   Luigi Serra   selection control...
25
  

0f6424fe   root   update new data-s...
26
              <neon-animatable>

a31f0660   root   sevc-controllet i...
27
  

89558a41   Renato De Donato   datatype, provide...
28
                  <select-data-controllet id="select_data"></select-data-controllet>

a31f0660   root   sevc-controllet i...
29
  

0f6424fe   root   update new data-s...
30
              </neon-animatable>

73bcce88   luigser   COMPONENTS
31
  

0f6424fe   root   update new data-s...
32
              <neon-animatable>

73bcce88   luigser   COMPONENTS
33
  

89558a41   Renato De Donato   datatype, provide...
34
                  <select-visualization-controllet id="select_visualization" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}}></select-visualization-controllet>

73bcce88   luigser   COMPONENTS
35
  

0f6424fe   root   update new data-s...
36
              </neon-animatable>

73bcce88   luigser   COMPONENTS
37
  

0f6424fe   root   update new data-s...
38
          </page-slider-controllet>

c011cd54   Luigi Serra   selection control...
39
  

73bcce88   luigser   COMPONENTS
40
      </template>

74249687   Luigi Serra   Cross browser con...
41
  

73bcce88   luigser   COMPONENTS
42
43
      <script>

  

73bcce88   luigser   COMPONENTS
44
45
46
47
          Polymer({

  

              is : 'data-sevc-controllet',

  

73bcce88   luigser   COMPONENTS
48
              listeners : {

0f6424fe   root   update new data-s...
49
                  'page-slider-controllet_selected' : '_updateSlider',

34789a0e   Renato De Donato   jsdatachecker ln,...
50
                  'select-dataset-controllet_data-url' : '_allowSecondStep',

89558a41   Renato De Donato   datatype, provide...
51
                  'select-fields-controllet_selected-fields' : '_allowThirdStep',

a1dedcfa   Renato De Donato   worning x gg
52
                  'filters-controllet_filters': '_allowThirdStep',

256ece27   Renato De Donato   new controllet
53
                  'aggregators-controllet_aggregators': '_allowThirdStep',

a1dedcfa   Renato De Donato   worning x gg
54
                  'data-ready': '_dataReady'

73bcce88   luigser   COMPONENTS
55
56
57
58
              },

  

              properties : {

  

0f6424fe   root   update new data-s...
59
                  datasets : {

89558a41   Renato De Donato   datatype, provide...
60
                      type : Object,

24be6abb   Luigi Serra   selection control...
61
62
                      value : undefined

                  },

a31f0660   root   sevc-controllet i...
63
  

e0e4a976   Renato De Donato   data-sevc-control...
64
65
66
67
68
                  suggestedDatasets : {

                      type : Array,

                      value : undefined

                  },

  

89558a41   Renato De Donato   datatype, provide...
69
70
                  deepUrl : {

                      type : String,

0f6424fe   root   update new data-s...
71
                      value : undefined

e0e4a976   Renato De Donato   data-sevc-control...
72
73
                  },

  

89558a41   Renato De Donato   datatype, provide...
74
75
                  dataletsListUrl : {

                      type : String ,

e0e4a976   Renato De Donato   data-sevc-control...
76
77
78
                      value : undefined

                  },

  

6d2a2a1e   Andrea Petta   language handling
79
80
81
                  localization : {

                      type : String,

                      value : "en"

a31f0660   root   sevc-controllet i...
82
83
                  }

  

035bbee3   Luigi Serra   Datalets and cont...
84
              },

035bbee3   Luigi Serra   Datalets and cont...
85
  

0f6424fe   root   update new data-s...
86
              ready : function(){

6d2a2a1e   Andrea Petta   language handling
87
                  ln["localization"] = this.localization;

73bcce88   luigser   COMPONENTS
88
              },

74249687   Luigi Serra   Cross browser con...
89
  

0f6424fe   root   update new data-s...
90
91
              _updateSlider : function(e){

                  switch (e.detail.selected) {

74249687   Luigi Serra   Cross browser con...
92
                      case 0:

89558a41   Renato De Donato   datatype, provide...
93
94
95
96
97
98
99
                          this.$.slider.setTitle(ln["slide1Title_" + this.localization], ln["slide1Subtitle_" + this.localization]);

  

                          this.$.slider.chevronLeft("invisible");

                          this.$.slider.chevronRight(false);

  

                          if(this.$.slider.getPrevSelected() == 1)

                              this.$.slider.chevronRight(true);

e0e4a976   Renato De Donato   data-sevc-control...
100
                          break;

74249687   Luigi Serra   Cross browser con...
101
                      case 1:

89558a41   Renato De Donato   datatype, provide...
102
103
104
105
106
107
108
                          this.$.slider.setTitle(ln["slide2Title_" + this.localization], ln["slide2Subtitle_" + this.localization]);

  

                          this.$.slider.chevronLeft(true);

                          this.$.slider.chevronRight(false);

  

                          if(this.$.slider.getPrevSelected() == 2)

                              this.$.slider.chevronRight(true);

0f6424fe   root   update new data-s...
109
                          break;

74249687   Luigi Serra   Cross browser con...
110
                      case 2:

89558a41   Renato De Donato   datatype, provide...
111
112
113
114
                          this.$.slider.setTitle(ln["slide3Title_" + this.localization], ln["slide3Subtitle_" + this.localization]);

  

                          this.$.slider.chevronLeft(true);

                          this.$.slider.chevronRight("invisible");

74249687   Luigi Serra   Cross browser con...
115
                  }

c011cd54   Luigi Serra   selection control...
116
              },

2b235978   Luigi Serra   Controllet cross ...
117
  

707a1508   root   update data-table...
118
              _allowSecondStep : function(e){

a1dedcfa   Renato De Donato   worning x gg
119
                  this.$.slider.chevronRight(false);

34789a0e   Renato De Donato   jsdatachecker ln,...
120
  

a1dedcfa   Renato De Donato   worning x gg
121
122
123
124
125
126
127
128
129
130
131
132
133
                  var f = Object.create(providerFactory);

                  var provider = f.getProvider(e.detail.url);

                  var dataUrl = provider.addLimit(e.detail.url);

  

                  this.$.select_data.dataUrl = dataUrl;

                  this.$.select_data.init();

                  this.$.select_visualization.dataUrl = dataUrl;

                  this.$.select_visualization.init();

              },

  

              _dataReady : function(e){

                  if(e.detail.ready) {

                      this.$.slider.chevronRight(true);

89558a41   Renato De Donato   datatype, provide...
134
                      this.$.select_dataset.$.selected_url.invalid = false;

a53fbbed   Renato De Donato   select-dataset ne...
135
                  }

a1dedcfa   Renato De Donato   worning x gg
136
137
                  else

                      this.$.select_dataset.$.selected_url.invalid = true;

34789a0e   Renato De Donato   jsdatachecker ln,...
138
139
  

                  this.$.select_dataset.showDatasetInfo();

707a1508   root   update data-table...
140
141
              },

  

89558a41   Renato De Donato   datatype, provide...
142
143
              _allowThirdStep : function(){

                  this.$.slider.chevronRight(false);

256ece27   Renato De Donato   new controllet
144
                  var selectedFields = this.$.select_data.getSelectedFields();

89558a41   Renato De Donato   datatype, provide...
145
                  var filters = this.$.select_data.getFilters();

256ece27   Renato De Donato   new controllet
146
                  var aggregators = this.$.select_data.getAggregators();

89558a41   Renato De Donato   datatype, provide...
147
                  var data = this.$.select_data.getData();

256ece27   Renato De Donato   new controllet
148
                  if(selectedFields.length > 0) {

89558a41   Renato De Donato   datatype, provide...
149
                      this.$.select_visualization.init();

256ece27   Renato De Donato   new controllet
150
                      this.$.select_visualization.setSelectedFields(selectedFields);

89558a41   Renato De Donato   datatype, provide...
151
                      this.$.select_visualization.setFilters(filters);

256ece27   Renato De Donato   new controllet
152
                      this.$.select_visualization.setAggregators(aggregators);

89558a41   Renato De Donato   datatype, provide...
153
154
155
                      this.$.select_visualization.setData(data);

                      this.$.slider.chevronRight(true);

                  }

0f6424fe   root   update new data-s...
156
              }

73bcce88   luigser   COMPONENTS
157
158
159
160
161
162
  

          });

  

      </script>

  

  </dom-module>