Skip to content

Commit a851aa5

Browse files
committed
no need for Registry in plot_api/to_image
... and 'enforce' Registry in components/modebar/ (like for all components really).
1 parent 705aed6 commit a851aa5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/components/modebar/buttons.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var Registry = require('../../registry');
1313
var Plots = require('../../plots/plots');
1414
var axisIds = require('../../plots/cartesian/axis_ids');
1515
var Lib = require('../../lib');
16-
var downloadImage = require('../../snapshot/download');
1716
var Icons = require('../../../build/ploticon');
1817

1918
var _ = Lib._;
@@ -60,7 +59,7 @@ modeBarButtons.toImage = {
6059
format = 'svg';
6160
}
6261

63-
downloadImage(gd, {'format': format})
62+
Registry.call('downloadImage', gd, {'format': format})
6463
.then(function(filename) {
6564
Lib.notifier(_(gd, 'Snapshot succeeded') + ' - ' + filename, 'long');
6665
})

src/plot_api/to_image.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
'use strict';
1010

11-
var Registry = require('../registry');
11+
var plotApi = require('./plot_api');
1212
var Lib = require('../lib');
1313

1414
var helpers = require('../snapshot/helpers');
@@ -155,7 +155,7 @@ function toImage(gd, opts) {
155155
var width = clonedGd._fullLayout.width;
156156
var height = clonedGd._fullLayout.height;
157157

158-
Registry.call('purge', [clonedGd]);
158+
plotApi.purge(clonedGd);
159159
document.body.removeChild(clonedGd);
160160

161161
if(format === 'svg') {
@@ -196,7 +196,7 @@ function toImage(gd, opts) {
196196
}
197197

198198
return new Promise(function(resolve, reject) {
199-
Registry.call('plot', [clonedGd, data, layoutImage, configImage])
199+
plotApi.plot(clonedGd, data, layoutImage, configImage)
200200
.then(redrawFunc)
201201
.then(wait)
202202
.then(convert)

0 commit comments

Comments
 (0)