lib/html/build/javascripts/plot.js in flammarion-0.1.13 vs lib/html/build/javascripts/plot.js in flammarion-0.1.14
- old
+ new
@@ -55,9 +55,26 @@
Plotly.redraw(plotDiv[0]);
if (data.layout) {
return Plotly.relayout(plotDiv[0], data);
}
}
+ },
+ savePlot: function(data) {
+ var plotDiv, target;
+ target = this.__parent.check_target(data);
+ this.__plots || (this.__plots = {});
+ plotDiv = target.find("#plot-" + data.id)[0];
+ return Plotly.toImage(plotDiv, data.format).then((function(_this) {
+ return function(imgData) {
+ return _this.__parent.send({
+ id: data.callback_id,
+ action: 'callback',
+ source: 'plot',
+ data: imgData,
+ original_msg: data
+ });
+ };
+ })(this));
}
});
}).call(this);