Blame view

controllets/data-sevc-controllet/data-sevc-controllet.html 4.83 KB
0f6424fe   root   update new data-s...
1
2
3
4
5
6
  /********************************************************************************************************************************

  <!--<script src="../shared_js/jquery-1.11.2.min.js"></script>-->

  <!--<script src="../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>-->

  <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">

  /********************************************************************************************************************************

ae17a8dc   Luigi Serra   Controllet and da...
7
  

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

938d1928   Luigi Serra   Update documentat...
9
  

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

  <link rel="import" href="../dataset-selection-controllet/dataset-selection-controllet.html">

  <link rel="import" href="../tree-view-multi-table-controllet/tree-view-multi-table-controllet.html" />

  <link rel="import" href="../datalet-selection-controllet/datalet-selection-controllet.html">

938d1928   Luigi Serra   Update documentat...
14
15
  

  <dom-module id="data-sevc-controllet">

73bcce88   luigser   COMPONENTS
16
  

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

74249687   Luigi Serra   Cross browser con...
18
  

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

486a1c48   Luigi Serra   selection control...
20
  

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

486a1c48   Luigi Serra   selection control...
22
  

0f6424fe   root   update new data-s...
23
                  <dataset-selection-controllet id="dataset_selection" datasets={{datasets}}></dataset-selection-controllet>

24be6abb   Luigi Serra   selection control...
24
  

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

24be6abb   Luigi Serra   selection control...
26
  

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

a31f0660   root   sevc-controllet i...
28
  

0f6424fe   root   update new data-s...
29
                  <tree-view-multi-table-controllet id="tree_view_multi_table" root-name="data" opened-path="result,records" data-url={{dataUrl}}></tree-view-multi-table-controllet>

a31f0660   root   sevc-controllet i...
30
  

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

73bcce88   luigser   COMPONENTS
32
  

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

73bcce88   luigser   COMPONENTS
34
  

0f6424fe   root   update new data-s...
35
                  <datalet-selection-controllet id="datalet_selection" deep-url={{deepUrl}} datalets-list-url={{dataletsListUrl}} data-url={{dataUrl}} fields={{fields}}></datalet-selection-controllet>

73bcce88   luigser   COMPONENTS
36
  

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

73bcce88   luigser   COMPONENTS
38
  

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

c011cd54   Luigi Serra   selection control...
40
  

73bcce88   luigser   COMPONENTS
41
      </template>

74249687   Luigi Serra   Cross browser con...
42
  

73bcce88   luigser   COMPONENTS
43
44
      <script>

  

73bcce88   luigser   COMPONENTS
45
46
47
48
          Polymer({

  

              is : 'data-sevc-controllet',

  

73bcce88   luigser   COMPONENTS
49
              listeners : {

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

                  'dataset-selection-controllet_data-url' : '_updateDataUrl'

73bcce88   luigser   COMPONENTS
52
53
54
55
              },

  

              properties : {

  

73bcce88   luigser   COMPONENTS
56
57
                  deepUrl : {

                      type : String,

24be6abb   Luigi Serra   selection control...
58
                      value : undefined

73bcce88   luigser   COMPONENTS
59
                  },

0f6424fe   root   update new data-s...
60
61
62
  

                  dataletsListUrl : {

                      type : String ,

24be6abb   Luigi Serra   selection control...
63
                      value : undefined

73bcce88   luigser   COMPONENTS
64
                  },

0f6424fe   root   update new data-s...
65
66
  

                  datasets : {

73bcce88   luigser   COMPONENTS
67
                      type : Array,

24be6abb   Luigi Serra   selection control...
68
69
                      value : undefined

                  },

a31f0660   root   sevc-controllet i...
70
  

0f6424fe   root   update new data-s...
71
72
73
74
                  dataUrl : {

                      type  : String,

                      value : undefined

                  },

a31f0660   root   sevc-controllet i...
75
  

0f6424fe   root   update new data-s...
76
77
78
                  jsonData : {

                      type  : Object,

                      value : undefined

a31f0660   root   sevc-controllet i...
79
80
                  }

  

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

035bbee3   Luigi Serra   Datalets and cont...
82
  

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

73bcce88   luigser   COMPONENTS
84
              },

74249687   Luigi Serra   Cross browser con...
85
  

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

                  switch (e.detail.selected) {

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

0f6424fe   root   update new data-s...
89
90
91
92
93
94
                          slider.setTitle("SELECT DATASET", "Search or copy and paste the url of dataset.");

                          slider.chevronLeft(false);

                          slider.chevronRight(false);

                          this.$.dataset_selection._fireDataUrl();

  //                        http://designpieces.com/palette/google-new-logo-2015-color-palette-hex-and-rgb/

                                  break;

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

0f6424fe   root   update new data-s...
96
97
98
99
                          slider.setTitle("SELECT FIELDS", "Select the fields from tree-view. The multi-table will show the values related to the selected fields.");

  //                        slider.chevronRight(false);

                          this.$.tree_view_multi_table.ready();

                          break;

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

0f6424fe   root   update new data-s...
101
102
103
104
                          slider.setTitle("SELECT DATALET", "Select a visualization, fill out inputs and labels (optional).");

                          slider.chevronRight(false);

                          this.$.datalet_selection.setFields(tree_view_multi_table.getFlatFields());//???

                          this.$.datalet_selection.ready();//???

74249687   Luigi Serra   Cross browser con...
105
                  }

c011cd54   Luigi Serra   selection control...
106
              },

2b235978   Luigi Serra   Controllet cross ...
107
  

0f6424fe   root   update new data-s...
108
109
              _updateDataUrl : function(e){

                  this.dataUrl = e.detail.url;

c011cd54   Luigi Serra   selection control...
110
  

0f6424fe   root   update new data-s...
111
112
113
114
115
116
117
                  $.ajax({

                      url: e.detail.url,

                      dataType: "json",

                      success: function(data){

  //                        this.dataUrl = e.detail.url

  //                        this.jsonData = JSON.stringify(data);

                          slider.chevronRight(true);

a31f0660   root   sevc-controllet i...
118
                      },

0f6424fe   root   update new data-s...
119
120
121
122
123
124
                      error: function(){

  //                        this.jsonData = undefined;

                          slider.chevronRight(false);

                      }

                  });

              }

73bcce88   luigser   COMPONENTS
125
126
127
128
129
130
  

          });

  

      </script>

  

  </dom-module>