Repository: zeppelin Updated Branches: refs/heads/master ac01fea46 -> 7dc4dbea5
ZEPPELIN-3340 Streaming support in builtin visualizations ### What is this PR for? Support for streaming visualizations. This PR is an addition to [ZEPPELIN-3249](https://issues.apache.org/jira/browse/ZEPPELIN-3249) Limitations: 1) Initial chart selection and setup is required _(see the testing steps below)_, 2) Switching of visualization during progress is not possible ### What type of PR is it? Improvement ### Todos * [ ] - Task ### What is the Jira issue? [ZEPPELIN-3340](https://issues.apache.org/jira/browse/ZEPPELIN-3340) ### How should this be tested? 1) Run a paragraph which outputs table 2) Select a visualization 3) Set necessary keys/groups/values and other visualization settings 4) Replace the paragraph code with streaming content and run again ### Screenshots (if appropriate) ![mar-15-2018 18-25-11](https://user-images.githubusercontent.com/2031306/37464667-0e2a5824-287f-11e8-833c-34429567b06c.gif) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? Yes Author: Renjith Kamath <renjith.kam...@gmail.com> Closes #2873 from r-kamath/streamingViz and squashes the following commits: e313df7f9 [Renjith Kamath] ZEPPELIN-3340 Streaming support in builtin visualizations Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7dc4dbea Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7dc4dbea Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7dc4dbea Branch: refs/heads/master Commit: 7dc4dbea5a9b49d66113275ad1ffd31abe1d1d4d Parents: ac01fea Author: Renjith Kamath <renjith.kam...@gmail.com> Authored: Thu Mar 15 18:14:55 2018 +0530 Committer: r-kamath <rkam...@apache.org> Committed: Mon Mar 19 17:43:33 2018 +0530 ---------------------------------------------------------------------- .../paragraph/result/result.controller.js | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7dc4dbea/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 75a80b2..98940ab 100644 --- a/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/result/result.controller.js @@ -552,18 +552,7 @@ function ResultCtrl($scope, $rootScope, $route, $window, $routeParams, $location if (!$scope.$parent.result.data[data.index]) { $scope.$parent.result.data[data.index] = ''; } - if (!tableData) { - $scope.$parent.result.data[data.index] = $scope.$parent.result.data[data.index].concat( - data.data); - $rootScope.$broadcast( - 'updateResult', - {'data': $scope.$parent.result.data[data.index], 'type': 'TABLE'}, - undefined, - paragraph, - data.index); - let elemId = `p${$scope.id}_table`; - renderGraph(elemId, 'table', true); - } else { + if (tableData) { let textRows = data.data.split('\n'); for (let i = 0; i < textRows.length; i++) { if (textRows[i] !== '') { @@ -576,6 +565,19 @@ function ResultCtrl($scope, $rootScope, $route, $window, $routeParams, $location } } } + if (!tableData + || !builtInVisualizations[$scope.graphMode].instance.append) { + $scope.$parent.result.data[data.index] = $scope.$parent.result.data[data.index].concat( + data.data); + $rootScope.$broadcast( + 'updateResult', + {'data': $scope.$parent.result.data[data.index], 'type': 'TABLE'}, + $scope.config, + paragraph, + data.index); + let elemId = `p${$scope.id}_` + $scope.graphMode; + renderGraph(elemId, $scope.graphMode, true); + } } }