Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 bbb47c8d2 -> 5ee1f7981


[ZEPPELIN-3177]Resize charts on paragaph resize

### What is this PR for?
Resize charts on paragraph resize

* Broadcast chart resize on para. resize with a timeout
* Add warning on refresh missing

### What type of PR is it?
[Bug Fix | Improvement]

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

### How should this be tested?

Open a paragraph with charts and resize paragraph width(see the gif)
ps- helium charts should be updated accordingly

### Screenshots (if appropriate)
Before:
![zeppelin3](https://user-images.githubusercontent.com/11382805/35181438-ec771338-fe04-11e7-8803-a6b3aa15b149.gif)
After:
![zeppelin3](https://user-images.githubusercontent.com/11382805/35181425-9623d962-fe04-11e7-8660-8dc82c54cd0e.gif)

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

Author: sravan <sravans2...@gmail.com>

Closes #2735 from sravan-s/fix/resize-chart and squashes the following commits:

2f2deecff [sravan] Activate app after refresh
9bf989496 [sravan] Resize charts on paragraph resize

(cherry picked from commit f6ef64f8470e30f2e166ee31d468174f0df0178a)
Signed-off-by: Lee moon soo <m...@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 5ee1f7981c99a1616948d839fb0bcdf6563add86
Parents: bbb47c8
Author: sravan <sravans2...@gmail.com>
Authored: Mon Jan 22 12:27:41 2018 +0900
Committer: Lee moon soo <m...@apache.org>
Committed: Thu Feb 22 12:02:24 2018 -0800

----------------------------------------------------------------------
 zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js   | 1 +
 .../src/app/notebook/paragraph/result/result.controller.js        | 3 ++-
 zeppelin-web/src/app/visualization/visualization.js               | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5ee1f798/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 75a0fec..07ebf89 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -673,6 +673,7 @@ function ParagraphCtrl ($scope, $rootScope, $route, 
$window, $routeParams, $loca
   $scope.changeColWidth = function (paragraph, width) {
     angular.element('.navbar-right.open').removeClass('open')
     paragraph.config.colWidth = width
+    $scope.$broadcast('paragraphResized', $scope.paragraph.id)
     commitParagraph(paragraph)
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5ee1f798/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
----------------------------------------------------------------------
diff --git 
a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
index ec4eeda..5dfe314 100644
--- a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
@@ -634,6 +634,7 @@ function ResultCtrl ($scope, $rootScope, $route, $window, 
$routeParams, $locatio
         builtInViz.instance.setConfig(config)
         builtInViz.instance.render(transformed)
         builtInViz.instance.renderSetting(visualizationSettingTargetEl)
+        builtInViz.instance.activate()
       }
     } else {
       afterLoaded = function (loadedElem) {
@@ -755,7 +756,7 @@ function ResultCtrl ($scope, $rootScope, $route, $window, 
$routeParams, $locatio
     if (paragraphId === paragraph.id) {
       let builtInViz = builtInVisualizations[$scope.graphMode]
       if (builtInViz && builtInViz.instance) {
-        builtInViz.instance.resize()
+        $timeout(_ => builtInViz.instance.resize(), 200)
       }
     }
   })

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5ee1f798/zeppelin-web/src/app/visualization/visualization.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/visualization/visualization.js 
b/zeppelin-web/src/app/visualization/visualization.js
index 82704e3..6b6e36a 100644
--- a/zeppelin-web/src/app/visualization/visualization.js
+++ b/zeppelin-web/src/app/visualization/visualization.js
@@ -48,6 +48,7 @@ export default class Visualization {
    */
   refresh () {
     // override this
+    console.warn('A chart is missing refresh function, it might not work 
preperly')
   }
 
   /**

Reply via email to