Blame view

controllets/data-sevc-controllet/data-sevc-controllet.html 5.49 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',

707a1508   root   update data-table...
50
                  'dataset-selection-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
53
                  'filters-controllet_filters': '_allowThirdStep',

                  'data-ready': '_dataReady'

73bcce88   luigser   COMPONENTS
54
55
56
57
              },

  

              properties : {

  

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

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

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

                  },

a31f0660   root   sevc-controllet i...
62
  

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

                      type : Array,

                      value : undefined

                  },

  

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

                      type : String,

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

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

  

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

                      type : String ,

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

                  },

  

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

                      type : String,

                      value : "en"

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

  

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

035bbee3   Luigi Serra   Datalets and cont...
84
  

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

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

73bcce88   luigser   COMPONENTS
87
              },

74249687   Luigi Serra   Cross browser con...
88
  

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

                  switch (e.detail.selected) {

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

89558a41   Renato De Donato   datatype, provide...
92
93
94
95
96
97
98
                          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...
99
                          break;

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

89558a41   Renato De Donato   datatype, provide...
101
102
103
104
105
106
107
                          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...
108
                          break;

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

89558a41   Renato De Donato   datatype, provide...
110
111
112
113
                          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...
114
                  }

c011cd54   Luigi Serra   selection control...
115
              },

2b235978   Luigi Serra   Controllet cross ...
116
  

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

a1dedcfa   Renato De Donato   worning x gg
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                  this.$.slider.chevronRight(false);

  //

                  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...
133
                      this.$.select_dataset.$.selected_url.invalid = false;

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

a1dedcfa   Renato De Donato   worning x gg
135
136
                  else

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

707a1508   root   update data-table...
137
138
              },

  

89558a41   Renato De Donato   datatype, provide...
139
140
141
142
143
144
145
146
147
148
149
150
              _allowThirdStep : function(){

                  this.$.slider.chevronRight(false);

                  var fields = this.$.select_data.getSelectedFields();

                  var filters = this.$.select_data.getFilters();

                  var data = this.$.select_data.getData();

                  if(fields.length > 0) {

                      this.$.select_visualization.init();

                      this.$.select_visualization.setFields(fields);

                      this.$.select_visualization.setFilters(filters);

                      this.$.select_visualization.setData(data);

                      this.$.slider.chevronRight(true);

                  }

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

73bcce88   luigser   COMPONENTS
152
153
154
155
156
157
  

          });

  

      </script>

  

  </dom-module>