Skip to content

Commit 07df870

Browse files
author
Martin Hansen
committed
Build for custom png export
1 parent ae76afe commit 07df870

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

dist/vue-plotly.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ exports = module.exports = __webpack_require__(26)(false);
651651

652652

653653
// module
654-
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
654+
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
655655

656656
// exports
657657

@@ -1072,7 +1072,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
10721072

10731073

10741074

1075-
var events = ['click', 'hover', 'unhover', 'selecting', 'selected', 'restyle', 'relayout', 'autosize', 'deselect', 'doubleclick', 'redraw', 'animated'];
1075+
var events = ['click', 'hover', 'unhover', 'selecting', 'selected', 'restyle', 'relayout', 'autosize', 'deselect', 'doubleclick', 'redraw', 'animated', 'afterplot'];
10761076

10771077
var functions = ['restyle', 'relayout', 'update', 'addTraces', 'deleteTraces', 'moveTraces', 'extendTraces', 'prependTraces', 'purge'];
10781078

@@ -1184,6 +1184,13 @@ var methods = functions.reduce(function (all, funcName) {
11841184
return __WEBPACK_IMPORTED_MODULE_1_plotly_js___default.a.plot(this.$refs.container, this.data, this.internalLayout, this.options);
11851185
},
11861186
newPlot: function newPlot() {
1187+
var el = this.$refs.container;
1188+
1189+
//if width/height is not specified for toImageButton, default to el.clientWidth/clientHeight
1190+
if (!this.options) this.options = {};
1191+
if (!this.options.toImageButtonOptions) this.options.toImageButtonOptions = {};
1192+
if (!this.options.toImageButtonOptions.width) this.options.toImageButtonOptions.width = el.clientWidth;
1193+
if (!this.options.toImageButtonOptions.height) this.options.toImageButtonOptions.height = el.clientHeight;
11871194
return __WEBPACK_IMPORTED_MODULE_1_plotly_js___default.a.newPlot(this.$refs.container, this.data, this.internalLayout, this.options);
11881195
},
11891196
react: function react() {

0 commit comments

Comments
 (0)