zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabhjyotsi...@apache.org
Subject zeppelin git commit: [ZEPPELIN-1674] save barchart, areachart option
Date Tue, 06 Dec 2016 04:38:45 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master fa31bd31c -> 0e4d96168


[ZEPPELIN-1674] save barchart, areachart option

### What is this PR for?
Persist
 - bar graph options (grouped, stacked)
 - area graph option: (stacked, stream, expanded)

### What type of PR is it?
Improvement

### Todos
* [x] - Task

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1674

### How should this be tested?
Change graph option and refresh the page and see if change is restored

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <moon@apache.org>

Closes #1724 from Leemoonsoo/zeppelin-1674-rebased and squashes the following commits:

d040e4e [Lee moon soo] save barchart, areachart type


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/0e4d9616
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/0e4d9616
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/0e4d9616

Branch: refs/heads/master
Commit: 0e4d9616833dd583f2162797c5bc647315743ea9
Parents: fa31bd3
Author: Lee moon soo <moon@apache.org>
Authored: Fri Dec 2 16:13:07 2016 -0800
Committer: Prabhjyot Singh <prabhjyotsingh@gmail.org>
Committed: Tue Dec 6 10:08:26 2016 +0530

----------------------------------------------------------------------
 zeppelin-web/src/app/tabledata/transformation.js        |  1 -
 .../visualization/builtins/visualization-areachart.js   | 12 ++++++++++++
 .../visualization/builtins/visualization-barchart.js    | 12 ++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0e4d9616/zeppelin-web/src/app/tabledata/transformation.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/tabledata/transformation.js b/zeppelin-web/src/app/tabledata/transformation.js
index 6950bd5..5dd9986 100644
--- a/zeppelin-web/src/app/tabledata/transformation.js
+++ b/zeppelin-web/src/app/tabledata/transformation.js
@@ -53,7 +53,6 @@ zeppelin.Transformation.prototype.renderSetting = function(targetEl) {
   // already readered
   if (this._scope) {
     var self = this;
-    console.log('%o %o', self._scope, setting.scope);
     this._scope.$apply(function() {
       for (var k in setting.scope) {
         self._scope[k] = setting.scope[k];

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0e4d9616/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js b/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js
index 3a73b53..74660e9 100644
--- a/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js
+++ b/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js
@@ -64,4 +64,16 @@ zeppelin.AreachartVisualization.prototype.configureChart = function(chart)
{
   chart.yAxisTickFormat(function(d) {return self.yAxisTickFormat(d);});
   chart.yAxis.axisLabelDistance(50);
   chart.useInteractiveGuideline(true); // for better UX and performance issue. (https://github.com/novus/nvd3/issues/691)
+
+  this.chart.style(this.config.style || 'stack');
+
+  var self = this;
+  this.chart.dispatch.on('stateChange', function(s) {
+    self.config.style = s.style;
+
+    // give some time to animation finish
+    setTimeout(function() {
+      self.emitConfig(self.config);
+    }, 500);
+  });
 };

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0e4d9616/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js b/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js
index 3475cdd..809176d 100644
--- a/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js
+++ b/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js
@@ -60,4 +60,16 @@ zeppelin.BarchartVisualization.prototype.configureChart = function(chart)
{
   var self = this;
   chart.yAxis.axisLabelDistance(50);
   chart.yAxis.tickFormat(function(d) {return self.yAxisTickFormat(d);});
+
+  this.chart.stacked(this.config.stacked);
+
+  var self = this;
+  this.chart.dispatch.on('stateChange', function(s) {
+    self.config.stacked = s.stacked;
+
+    // give some time to animation finish
+    setTimeout(function() {
+      self.emitConfig(self.config);
+    }, 500);
+  });
 };


Mime
View raw message