Commit f974e82498c904188b0f3fc3f15be1987f4718a1

Authored by Luigi Serra
1 parent 8bada91f

Bugs fix

controllets/data-sevc-controllet/data-sevc-controllet.html
@@ -325,7 +325,7 @@ @@ -325,7 +325,7 @@
325 325
326 <div class="fancy area_container"> 326 <div class="fancy area_container">
327 <paper-tabs selected="{{DatasourceTabSelected}}"> 327 <paper-tabs selected="{{DatasourceTabSelected}}">
328 - <paper-tab>Select data suorce</paper-tab> 328 + <paper-tab>Select data source</paper-tab>
329 <paper-tab>Most popular</paper-tab> 329 <paper-tab>Most popular</paper-tab>
330 <paper-tab>Search</paper-tab> 330 <paper-tab>Search</paper-tab>
331 </paper-tabs> 331 </paper-tabs>
controllets/draggable-element-controllet/draggable-element-controllet.html
@@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
116 </template> 116 </template>
117 117
118 <template is="dom-if" if="{{!isTarget}}"> 118 <template is="dom-if" if="{{!isTarget}}">
119 - <div class="drag-content-source" draggable="true" on-track="_handleTrack" on-drag="_handleStartDrag"> 119 + <div class="drag-content-source" draggable="true" on-track="_handleTrack" on-drag="_handleOnDrag" on-dragstart="_handleStartDrag">
120 <div id="{{identifier}}" class='draggable-card unselectable'>{{label}}</div> 120 <div id="{{identifier}}" class='draggable-card unselectable'>{{label}}</div>
121 </div> 121 </div>
122 </template> 122 </template>
@@ -171,6 +171,11 @@ @@ -171,6 +171,11 @@
171 }, 171 },
172 172
173 _handleStartDrag : function(e){ 173 _handleStartDrag : function(e){
  174 + /*var target = EventUtil.getCurrentTarget(e);
  175 + target.style.cursor = 'move';*/
  176 + },
  177 +
  178 + _handleOnDrag : function(e){
174 this.targets = document.querySelectorAll('draggable-element-controllet[is-target=true]'); 179 this.targets = document.querySelectorAll('draggable-element-controllet[is-target=true]');
175 for (var i = 0; i < this.targets.length; i++) { 180 for (var i = 0; i < this.targets.length; i++) {
176 this.targets[i].children[0].children[1].className = "onTrackOnTarget dd-content-target unselectable style-scope draggable-element-controllet"; 181 this.targets[i].children[0].children[1].className = "onTrackOnTarget dd-content-target unselectable style-scope draggable-element-controllet";
datalets/treemap-datalet/treemap-datalet.html
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 #treemap_placeholder { 12 #treemap_placeholder {
13 width: 100%; 13 width: 100%;
14 height: 70%; 14 height: 70%;
  15 + min-height: 500px;
15 background: #ddd; 16 background: #ddd;
16 } 17 }
17 18
@@ -56,7 +57,7 @@ @@ -56,7 +57,7 @@
56 } 57 }
57 </style> 58 </style>
58 <div id="treemap_placeholder"></div> 59 <div id="treemap_placeholder"></div>
59 - <base-datalet data-url="{{dataUrl}}" query="{{query}}" fields-order="{{fieldsOrder}}"></base-datalet> 60 + <base-datalet data-url="{{dataUrl}}" query="{{query}}"></base-datalet>
60 </template> 61 </template>
61 62
62 <script src="../shared_js/d3.js"></script> 63 <script src="../shared_js/d3.js"></script>
@@ -88,16 +89,8 @@ @@ -88,16 +89,8 @@
88 89
89 this.map.children = []; 90 this.map.children = [];
90 91
91 - //var curr_fields_order = this._component.fieldsOrder.split(',');  
92 - //var curr_fields_order = new Array();  
93 - var curr_fields_order = "0,1,2".split(',');  
94 - for(var i = 0; i < queries.length; i++) curr_fields_order.push(i);  
95 -  
96 - var value_index = curr_fields_order[curr_fields_order.length -1];  
97 - curr_fields_order.pop();  
98 -  
99 for(var i = 0; i < this.properties.data.value.length; i++){ 92 for(var i = 0; i < this.properties.data.value.length; i++){
100 - this.checkAggragationField(this.properties.data.value[i], curr_fields_order , value_index); 93 + this.checkAggragationField(this.properties.data.value[i], queries.length - 1 , queries.length - 1);
101 } 94 }
102 //var json = JSON.stringify(this.map); 95 //var json = JSON.stringify(this.map);
103 }, 96 },
@@ -111,12 +104,12 @@ @@ -111,12 +104,12 @@
111 children.push(nchild); 104 children.push(nchild);
112 return nchild; 105 return nchild;
113 }, 106 },
114 - checkAggragationField: function(object, cat_index, value_index){ 107 + checkAggragationField: function(object, levels, value_index){
115 var curchild = this.map; 108 var curchild = this.map;
116 var keys = Object.keys(object); 109 var keys = Object.keys(object);
117 - for(var level= 0; level < cat_index.length; level++){ 110 + for(var level= 0; level < levels; level++){
118 111
119 - var child = this.findChild(curchild, object[keys[cat_index[level]]]); 112 + var child = this.findChild(curchild, object[keys[level]]);
120 curchild = child; 113 curchild = child;
121 } 114 }
122 115