Skip to content

Commit 4f754aa

Browse files
committed
lib: add Lib.noop method
1 parent 68268e3 commit 4f754aa

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/lib/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ lib.bBoxIntersect = function(a, b, pad) {
121121
// minor convenience/performance booster for d3...
122122
lib.identity = function(d) { return d; };
123123

124+
// minor convenience helper
125+
lib.noop = function() {};
126+
124127
// random string generator
125128
lib.randstr = function randstr(existing, bits, base) {
126129
/*

src/plots/gl3d/layout/axis_defaults.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var layoutAttributes = require('./axis_attributes');
1717
var handleAxisDefaults = require('../../cartesian/axis_defaults');
1818

1919
var axesNames = ['xaxis', 'yaxis', 'zaxis'];
20-
var noop = function() {};
2120

2221
// TODO: hard-coded lightness fraction based on gridline default colors
2322
// that differ from other subplot types.
@@ -53,7 +52,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
5352
coerce('gridcolor', colorMix(containerOut.color, options.bgColor, gridLightness).toRgbString());
5453
coerce('title', axName[0]); // shouldn't this be on-par with 2D?
5554

56-
containerOut.setScale = noop;
55+
containerOut.setScale = Lib.noop;
5756

5857
if(coerce('showspikes')) {
5958
coerce('spikesides');

src/plots/gl3d/set_convert.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
'use strict';
1111

12+
var Lib = require('../../lib');
1213
var Axes = require('../cartesian/axes');
1314

14-
var noop = function() {};
15-
1615

1716
module.exports = function setConvert(containerOut) {
1817
Axes.setConvert(containerOut);
19-
containerOut.setScale = noop;
18+
containerOut.setScale = Lib.noop;
2019
};

0 commit comments

Comments
 (0)