diff --git a/controllets/select-visualization-controllet/select-datalet-inputs.html b/controllets/select-visualization-controllet/select-datalet-inputs.html index ada8b53..e40afe1 100644 --- a/controllets/select-visualization-controllet/select-datalet-inputs.html +++ b/controllets/select-visualization-controllet/select-datalet-inputs.html @@ -223,9 +223,19 @@ description = inputs[2].description; selection = inputs[2].selection; temp = [inputs[0], inputs[1]]; - for (var i = 3; i < this.fields.length; i++) - temp.push({name: name + " " + (i-2), description: description, selection: selection}); + temp.push({name: name + " 1", description: description, selection: selection}); + for (var i = 4; i < this.fields.length; i++) + temp.push({name: name + " " +(i-2), description: description, selection: selection}); } +// else if (inputs.length > 4 && inputs[4].selection == "+") {//bubble --> multiple bubble content +// name = inputs[4].name; +// description = inputs[4].description; +// selection = inputs[4].selection; +// temp = [inputs[0], inputs[1], inputs[2], inputs[3]]; +// temp.push({name: name + " 1", description: description, selection: selection}); +// for (var i = 6; i < this.fields.length; i++) +// temp.push({name: name + " " + (i-4), description: description, selection: selection}); +// } this.inputs = this._copy(temp); @@ -234,21 +244,23 @@ fireReady : function() { if(this._isReady()) - this.fire('select_visualization_inputs_ready'); + this.fire('select_visualization_inputs_ready', {isReady: true}); + else + this.fire('select_visualization_inputs_ready', {isReady: false}); }, _isReady : function() { var fire = true; for (var i = 0; i < this.selectedFields.length; i++) { - if (!this.selectedFields[i] && this.inputs[i].selection != "*") + if (!this.selectedFields[i] && this.inputs[i].selection != "+" && this.inputs[i].selection != "*" && this.inputs[i].selection != "?") return false; - if(this.inputs[i].selection == "*") + if(this.inputs[i].selection == "+") fire = false; } if(!fire) { for (var i = 0; i < this.selectedFields.length; i++) { - if (this.selectedFields[i] && this.inputs[i].selection == "*") { + if (this.selectedFields[i] && this.inputs[i].selection == "+") { fire = true; break; } @@ -430,9 +442,15 @@ if(key.indexOf("Column") > -1) { return ln["Column" + "_" +ln["localization"]] + key.slice(-2); } + if(key.indexOf("Level") > -1) { + return ln["Level" + "_" +ln["localization"]] + key.slice(-2); + } if(key.indexOf("BalloonContent") > -1) { return ln["BalloonContent" + "_" +ln["localization"]] + key.slice(-2); } +// if(key.indexOf("BubbleContent") > -1) { +// return ln["BubbleContent" + "_" +ln["localization"]] + key.slice(-2); +// } return ln[key + "_" +ln["localization"]]; }, diff --git a/controllets/select-visualization-controllet/select-datalet-inputs_series.html b/controllets/select-visualization-controllet/select-datalet-inputs_series.html index b6f1581..691e884 100644 --- a/controllets/select-visualization-controllet/select-datalet-inputs_series.html +++ b/controllets/select-visualization-controllet/select-datalet-inputs_series.html @@ -221,7 +221,9 @@ fireReady : function() { if(this.selectedFields[0] != "" && this.selectedFields[1] != "") - this.fire('select_visualization_inputs_ready'); + this.fire('select_visualization_inputs_ready', {isReady: true}); + else + this.fire('select_visualization_inputs_ready', {isReady: false}); }, _reset : function() { @@ -310,7 +312,7 @@ this._setAggregators(); }, - _setAggregatorsFields : function(e){ + _setAggregatorsFields : function(){ this.async(function() { var c_menu = $("#calculate_0").find("paper-menu")[0]; var selected = c_menu.selected > 0 ? c_menu.selected : 0; diff --git a/controllets/select-visualization-controllet/select-datalet-options.html b/controllets/select-visualization-controllet/select-datalet-options.html index 0962adf..f9a03f8 100644 --- a/controllets/select-visualization-controllet/select-datalet-options.html +++ b/controllets/select-visualization-controllet/select-datalet-options.html @@ -126,7 +126,7 @@
- +
diff --git a/controllets/select-visualization-controllet/select-visualization-controllet.html b/controllets/select-visualization-controllet/select-visualization-controllet.html index e66ebd2..b5568d0 100755 --- a/controllets/select-visualization-controllet/select-visualization-controllet.html +++ b/controllets/select-visualization-controllet/select-visualization-controllet.html @@ -312,7 +312,12 @@ inputs.fireReady(); }, - _loadDatalet : function(){ + _loadDatalet : function(e){ + if(!e.detail.isReady) { + this.$.datalet_selection_datalet_placeholder.innerHTML = ""; + return; + } + var inputs = this._getInputs(); this.selectedFields = inputs.getSelectedFields(); diff --git a/datalets/bubblechart-datalet/bubblechart-datalet.html b/datalets/bubblechart-datalet/bubblechart-datalet.html index 2245434..471af32 100755 --- a/datalets/bubblechart-datalet/bubblechart-datalet.html +++ b/datalets/bubblechart-datalet/bubblechart-datalet.html @@ -30,7 +30,7 @@ --> - + - + @@ -69,128 +69,91 @@ Examples: * @method presentData */ presentData: function() { - var categoryName = []; - var color = {}; - var bubblechartSeriesData = {}; - var bcserie = []; + if(this.data.length == 5) {// multiseries + var x = this.data[4]["data"]; - BubblechartArr = []; - var dataTmp = []; - - //Example 1: No Series name is specified in the query - if(this.data.length == 3){ - for (var i = 0; i < this.data[0].data.length; i++) { - BubblechartArr = [this.data[0].data[i], parseFloat(this.data[1].data[i]), parseFloat(this.data[2].data[i])]; - dataTmp.push(BubblechartArr) - } - color = { - fillColor: { - radialGradient: {cx: 0.4, cy: 0.3, r: 0.7}, - stops: [ - [0, 'rgba(255,255,255,0.5)'] - ] - } - } - //add data to the series - bubblechartSeriesData = { - name: "Series", - data: dataTmp, - marker: color - } - bcserie.push(bubblechartSeriesData); - } - //Example 2: A multi-series bubbles chart - else{ - var categoryNameDuplicateValue = []; - for (i = 0; i < this.data[0].data.length; i++) { - categoryNameDuplicateValue.push(this.data[3].data[i]); - } - categoryName = categoryNameDuplicateValue.filter(function (itm, i, categoryNameDuplicateValue) { - return i == categoryNameDuplicateValue.indexOf(itm); + var categories = x.filter(function (item, pos) { + return x.indexOf(item) == pos; }); - for (var index = 0; index < categoryName.length; index++) { - for (var i = 0; i < this.data[0].data.length; i++) { - if (this.data[3].data[i] == categoryName[index]) { - BubblechartArr = [this.data[0].data[i], this.data[1].data[i], parseFloat(this.data[2].data[i])]; - dataTmp.push(BubblechartArr); - //A different color for each series -/* blocco usato per 3d - color = { - fillColor: { - radialGradient: {cx: 0.4, cy: 0.3, r: 0.7}, - stops: [ - [0, 'rgba(255,255,255,0.5)'], - [1, Highcharts.Color(Highcharts.getOptions().colors[index]).setOpacity(0.5).get('rgba')] - ] - } - } -*/ + + var bubbleSeries = []; + var series = []; + var point = []; + + for (var i = 0; i < categories.length; i++) { + for (var j = 0; j < x.length; j++) { + if (this.data[4].data[j] == categories[i]) { + point = {x: this.data[0].data[j], y: this.data[1].data[j], z: this.data[2].data[j], content: this.data[3].data[j]}; + series.push(point); } } - //add data to the series - bubblechartSeriesData = { - name: "Series: " + categoryName[index], - data: dataTmp, - marker: color - } - bcserie.push(bubblechartSeriesData); - dataTmp = []; + bubbleSeries.push({name: categories[i], data: series}); + series = []; + } + + this.properties.series = bubbleSeries; + this._component.legend = true; + } + else {// == 4 + var bubbleSeries = []; + var series = []; + var point = []; + + for (var j = 0; j < this.data[0]["data"].length; j++) { + point = {x: this.data[0].data[j], y: this.data[1].data[j], z: this.data[2].data[j], content: this.data[3].data[j]}; + series.push(point); } + + bubbleSeries.push({data: series}); + + this.properties.series = bubbleSeries; + this._component.legend = false; } - $(this._component.$.charts.$.container).highcharts({ + + options = { chart: { type: 'bubble', - plotBorderWidth: 1, - zoomType: 'xy' + zoomType: 'xy', + plotBorderWidth: 1 }, - legend: { - enabled: true + title: { + text: this._component.title + }, + subtitle: { + text: this._component.description }, xAxis: { - categories: this.properties.categories.value, title: { text: this._component.xAxisLabel } }, yAxis: { - categories: this.properties.categories.value, title: { - text: this._component.yAxisLabel + text: this._component.yAxisLabel, } }, - title: { - text: this._component.Title - }, - subtitle: { - text: this._component.SubTitle - }, - //A custom tooltip - tooltip: { - shared: true, - useHTML: true, - headerFormat: - '' + - '', - pointFormat: - '', - footerFormat: '
{series.name}
{point.key} , {point.y}
{point.z}
', - followPointer: true + legend: { + enabled: this._component.legend, }, plotOptions: { series: { dataLabels: { - enabled: false, //enable for label for each bubble - format: '{point.z}' + enabled: true, + format: '{point.content}' } } }, - //hide link HighChart credits: { enabled: false }, - series: bcserie - }); + series: this.properties.series + }; + + if(this._component.theme != "themeBase" && this._component.theme != "") + jQuery.extend(true, options, Highcharts[this._component.theme]); + + $(this._component.$.charts.$.container).highcharts(options); } }; /** @@ -199,50 +162,18 @@ Examples: BubblechartDatalet = Polymer({ is: 'bubblechart-datalet', properties: { - /** - * It's the label for X axis - * - * @attribute xAxisLabel - * @type String - * @default '' - */ xAxisLabel: { type: String, value: "" }, - /** - * It's the label for Y axis - * - * @attribute yAxisLabel - * @type String - * @default '' - */ yAxisLabel: { type: String, value: "" }, - /** - * It's the title of the chart - * - * @attribute title - * @type Strig - * @default '' - */ - Title: { - type: String, - value: "" - }, - SubTitle: { - type: String, - value: "" + theme : { + type : String, + value : "" }, - /** - * It's the component behavior - * - * @attribute behavior - * @type Object - * @default {} - */ behavior : { type : Object, value : {} @@ -256,7 +187,7 @@ Examples: */ ready: function(){ this.behavior = $.extend(true, {}, HighchartsComponentBehavior, BubblechartBehavior); - this.async(function(){this.behavior.init(this)},1); + this.async(function(){this.behavior.init(this)},0); } }); diff --git a/datalets/bubblechart-datalet/bubblechart-datalet.png b/datalets/bubblechart-datalet/bubblechart-datalet.png index 6dc4f77..4db3281 100644 --- a/datalets/bubblechart-datalet/bubblechart-datalet.png +++ b/datalets/bubblechart-datalet/bubblechart-datalet.png diff --git a/datalets/datatable-datalet/js/DataTables/datatables.css b/datalets/datatable-datalet/js/DataTables/datatables.css index 5017beb..5607510 100755 --- a/datalets/datatable-datalet/js/DataTables/datatables.css +++ b/datalets/datatable-datalet/js/DataTables/datatables.css @@ -18,6 +18,22 @@ /* Layout helpers ----------------------------------*/ +/*spod theme conflict*/ +datatable-datalet input[type=search] { + border: 2px inset; + /*height: 15px;*/ + /*width: 175px;*/ + height: auto; + width: auto; +} + +datatable-datalet input[type=search]:focus:not([readonly]) { + border: 2px inset; + box-shadow: none; +} +/*input[type=search]:disabled, input[type=search][readonly="readonly"] {}*/ +/*spod theme conflict*/ + .ui-helper-hidden { display: none; } diff --git a/datalets/highcharts-datalet/highcharts-datalet.html b/datalets/highcharts-datalet/highcharts-datalet.html index 9ee18d3..ee9531e 100755 --- a/datalets/highcharts-datalet/highcharts-datalet.html +++ b/datalets/highcharts-datalet/highcharts-datalet.html @@ -62,6 +62,7 @@ Example : +