Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion zeppelin-web/app/scripts/controllers/paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ angular.module('zeppelinWebApp')
$rootScope.$emit('sendNewEvent', data);
};

$scope.downloadParagraph = function(){

var element = document.createElement('a');
element.setAttribute('href', 'data:text/text;charset=utf-8,' + encodeURI($scope.paragraph.result.msg.replace(/\t/g,",")));
element.setAttribute('download', "data.csv");
element.click();
}
$scope.runParagraph = function(data) {
var parapgraphData = {op: 'RUN_PARAGRAPH',
data: {
Expand Down Expand Up @@ -909,7 +915,6 @@ angular.module('zeppelinWebApp')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part was actually from a new commit, and should not be removed, my guess is that your branch is not up to date with master.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will pull from master and update the branch

} catch(ignoreErr) {
}

var chartEl = d3.select('#p'+$scope.paragraph.id+'_'+type+' svg')
.attr('height', $scope.paragraph.config.graph.height)
.style('height', height + 'px')
Expand Down
4 changes: 3 additions & 1 deletion zeppelin-web/app/views/paragraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@
ng-click="toggleEditor()"></span>
<span class="{{paragraph.config.tableHide ? 'icon-notebook' : 'icon-book-open'}}" style="cursor:pointer;" tooltip-placement="top" tooltip="{{(paragraph.config.tableHide ? 'Show' : 'Hide') + ' output'}}"
ng-click="toggleOutput()"></span>

<span class="icon-cloud-download" style="cursor:pointer;color:#3071A9" tooltip-placement="top" tooltip="Download data"
ng-click="downloadParagraph(getEditorValue())"
ng-show="paragraph.status=='FINISHED'"></span>
<span class="dropdown navbar-right">
<span class="icon-settings" style="cursor:pointer"
data-toggle="dropdown"
Expand Down