Skip to content

Commit dc297ca

Browse files
committed
put ref of hasPlotType method on Plots:
- to more easily mock _has in test layouts
1 parent a141d78 commit dc297ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plots/plots.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ plots.supplyDefaults = function(gd) {
485485
Lib.fillUnique(modules, _module);
486486
Lib.fillUnique(basePlotModules, fullTrace._module.basePlotModule);
487487
}
488-
// attach helper method
489-
newFullLayout._has = hasPlotType.bind(newFullLayout);
490488

489+
// attach helper method to check whether a plot type is present on graph
490+
newFullLayout._has = plots._hasPlotType.bind(newFullLayout);
491491
// temporary block (before replace all _has??? with _hasPlotType() ?
492492
newFullLayout._hasCartesian = newFullLayout._has('cartesian');
493493
newFullLayout._hasGeo = newFullLayout._has('geo');
@@ -539,7 +539,7 @@ plots.supplyDefaults = function(gd) {
539539

540540
// helper function to be bound to fullLayout to check
541541
// whether a certain plot type is present on plot
542-
function hasPlotType(category) {
542+
plots._hasPlotType = function(category) {
543543
var basePlotModules = this._basePlotModules || [];
544544

545545
for(var i = 0; i < basePlotModules.length; i++) {
@@ -549,6 +549,7 @@ function hasPlotType(category) {
549549
}
550550

551551
return false;
552+
};
552553

553554
plots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {
554555
var i, j;

0 commit comments

Comments
 (0)