Skip to content

Commit 0f8520e

Browse files
committed
turn log level 1 on by default and move zsmooth messages to logs
1 parent 04ed6f0 commit 0f8520e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/plot_api/plot_config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ module.exports = {
122122

123123
// Turn all console logging on or off (errors will be thrown)
124124
// This should ONLY be set via Plotly.setPlotConfig
125-
logging: false,
125+
// 0: no logs
126+
// 1: warnings and errors, but not informational messages
127+
// 2: verbose logs
128+
logging: 1,
126129

127130
// Set global transform to be applied to all traces with no
128131
// specification needed

src/plots/cartesian/set_convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ module.exports = function setConvert(ax, fullLayout) {
382382

383383
if(!isFinite(ax._m) || !isFinite(ax._b)) {
384384
fullLayout._replotting = false;
385-
throw new Error('axis scaling');
385+
throw new Error('Something went wrong with axis scaling');
386386
}
387387
};
388388

src/traces/heatmap/calc.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
var Registry = require('../../registry');
1313
var Lib = require('../../lib');
14-
var _ = Lib._;
1514
var Axes = require('../../plots/cartesian/axes');
1615

1716
var histogram2dCalc = require('../histogram2d/calc');
@@ -83,21 +82,21 @@ module.exports = function calc(gd, trace) {
8382

8483
function noZsmooth(msg) {
8584
zsmooth = trace._input.zsmooth = trace.zsmooth = false;
86-
Lib.notifier(_(gd, 'cannot use zsmooth: "fast"') + '<br>' + msg);
85+
Lib.warn('cannot use zsmooth: "fast": ' + msg);
8786
}
8887

8988
// check whether we really can smooth (ie all boxes are about the same size)
9089
if(zsmooth === 'fast') {
9190
if(xa.type === 'log' || ya.type === 'log') {
92-
noZsmooth(_(gd, 'log axis found'));
91+
noZsmooth('log axis found');
9392
}
9493
else if(!isHist) {
9594
if(x.length) {
9695
var avgdx = (x[x.length - 1] - x[0]) / (x.length - 1),
9796
maxErrX = Math.abs(avgdx / 100);
9897
for(i = 0; i < x.length - 1; i++) {
9998
if(Math.abs(x[i + 1] - x[i] - avgdx) > maxErrX) {
100-
noZsmooth(_(gd, 'x scale is not linear'));
99+
noZsmooth('x scale is not linear');
101100
break;
102101
}
103102
}
@@ -107,7 +106,7 @@ module.exports = function calc(gd, trace) {
107106
maxErrY = Math.abs(avgdy / 100);
108107
for(i = 0; i < y.length - 1; i++) {
109108
if(Math.abs(y[i + 1] - y[i] - avgdy) > maxErrY) {
110-
noZsmooth(_(gd, 'y scale is not linear'));
109+
noZsmooth('y scale is not linear');
111110
break;
112111
}
113112
}

0 commit comments

Comments
 (0)