Skip to content

Commit 154e81e

Browse files
committed
fixup after merge of funnel
1 parent 79d6ef1 commit 154e81e

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

Diff for: src/traces/bar/plot.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ function calcTextinfo(calcTrace, index, xa, ya) {
516516

517517
function formatLabel(u) {
518518
var pAxis = isHorizontal ? ya : xa;
519-
return tickText(pAxis, u, true).text; // TODO: may pass false here to drop the parent category?
519+
return tickText(pAxis, u, true).text;
520520
}
521521

522522
function formatNumber(v) {
@@ -538,8 +538,7 @@ function calcTextinfo(calcTrace, index, xa, ya) {
538538
}
539539

540540
if(hasFlag('text')) {
541-
tx = Lib.castOption(trace, cdi.i, 'text');
542-
if(tx) text.push(tx);
541+
text.push(Lib.castOption(trace, cdi.i, 'text'));
543542
}
544543

545544
if(trace.type === 'waterfall') {

Diff for: src/traces/funnel/defaults.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
3838

3939
handleText(traceIn, traceOut, layout, coerce, false);
4040

41-
// TODO: move this block to bar handleText if/when textinfo implimented for bars/histograms
4241
if(traceOut.textposition !== 'none') {
43-
var defaultTextinfo =
44-
Lib.isArrayOrTypedArray(text) ? 'text+value' : 'value';
45-
coerce('textinfo', defaultTextinfo);
42+
coerce('textinfo', Array.isArray(text) ? 'text+value' : 'value');
4643
}
4744

4845
var markerColor = coerce('marker.color', defaultColor);

Diff for: src/traces/waterfall/defaults.js

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
5151

5252
handleText(traceIn, traceOut, layout, coerce, false);
5353

54-
// TODO: move this block to bar handleText if/when textinfo implimented for bars/histograms
5554
if(traceOut.textposition !== 'none') {
5655
coerce('textinfo');
5756
}

Diff for: test/image/baselines/funnel_attrs.png

181 Bytes
Loading

Diff for: test/jasmine/tests/funnel_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ describe('A funnel plot', function() {
11481148
x: ['Product A', 'Product B', 'Product C'],
11491149
y: [20, 14, 23],
11501150
text: [20, 14, 23],
1151-
textinfo: 'none'
1151+
textinfo: 'text'
11521152
}])
11531153
.then(function() {
11541154
_assertNumberOfFunnelTextNodes(3);

0 commit comments

Comments
 (0)