Skip to content

Commit 2a3c354

Browse files
committed
drop funnelnorm
1 parent 6c8a661 commit 2a3c354

File tree

3 files changed

+2
-139
lines changed

3 files changed

+2
-139
lines changed

src/traces/funnel/layout_attributes.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@ module.exports = {
2525
'you might need to an *opacity* to see multiple bars.'
2626
].join(' ')
2727
},
28-
funnelnorm: {
29-
valType: 'enumerated',
30-
values: ['', 'fraction', 'percent'],
31-
dflt: '',
32-
role: 'info',
33-
editType: 'calc',
34-
description: [
35-
'Sets the normalization for bar traces on the graph.',
36-
'With *fraction*, the value of each bar is divided by the sum of all',
37-
'values at that location coordinate.',
38-
'*percent* is the same but multiplied by 100 to show percentages.'
39-
].join(' ')
40-
},
4128
funnelgap: {
4229
valType: 'number',
4330
min: 0,

src/traces/funnel/layout_defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = function(layoutIn, layoutOut, fullData) {
2929

3030
if(hasTraceType) {
3131
coerce('funnelmode');
32-
coerce('funnelnorm');
3332
coerce('funnelgap', 0.2);
3433
coerce('funnelgroupgap');
3534
}

test/jasmine/tests/funnel_test.js

Lines changed: 2 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,7 @@ describe('Funnel.crossTraceCalc', function() {
506506
y: [10, 20, 30]
507507
}], {
508508
funnelgap: 0,
509-
funnelmode: 'overlay',
510-
funnelnorm: false
509+
funnelmode: 'overlay'
511510
});
512511

513512
var cd = gd.calcdata;
@@ -517,90 +516,6 @@ describe('Funnel.crossTraceCalc', function() {
517516
assertPointField(cd, 'y', [[0.5, 1, 1.5], [5, 10, 15]]);
518517
});
519518

520-
it('should honor funnelnorm for traces that cannot be grouped', function() {
521-
var gd = mockFunnelPlot([{
522-
offset: 0,
523-
y: [3, 2, 1]
524-
}, {
525-
offset: 0,
526-
y: [2, 1, 0]
527-
}], {
528-
funnelgap: 0,
529-
funnelmode: 'group',
530-
funnelnorm: 'percent'
531-
});
532-
533-
expect(gd._fullLayout.funnelnorm).toBe('percent');
534-
535-
var cd = gd.calcdata;
536-
assertPointField(cd, 'b', [[-100, -100, -100], [-100, -100, NaN]]);
537-
assertPointField(cd, 's', [[200, 200, 200], [200, 200, NaN]]);
538-
assertPointField(cd, 'x', [[0.5, 1.5, 2.5], [0.5, 1.5, 2.5]]);
539-
assertPointField(cd, 'y', [[100, 100, 100], [100, 100, NaN]]);
540-
});
541-
542-
it('should honor funnelnorm for traces that cannot be stacked', function() {
543-
var gd = mockFunnelPlot([{
544-
offset: 0,
545-
y: [3, 2, 1]
546-
}, {
547-
offset: 0,
548-
y: [2, 1, 0]
549-
}], {
550-
funnelgap: 0,
551-
funnelmode: 'stack',
552-
funnelnorm: 'percent'
553-
});
554-
555-
expect(gd._fullLayout.funnelnorm).toBe('percent');
556-
557-
var cd = gd.calcdata;
558-
assertPointField(cd, 'b', [[-100, -100, -100], [20, 33.333, 100]]);
559-
assertPointField(cd, 's', [[120, 133.333, 200], [80, 66.666, 0]]);
560-
assertPointField(cd, 'x', [[0.5, 1.5, 2.5], [0.5, 1.5, 2.5]]);
561-
assertPointField(cd, 'y', [[20, 33.333, 100], [100, 100, 100]]);
562-
});
563-
564-
it('should honor funnelnorm (group case)', function() {
565-
var gd = mockFunnelPlot([{
566-
y: [3, 2, 1]
567-
}, {
568-
y: [2, 1, 0]
569-
}], {
570-
funnelgap: 0,
571-
funnelmode: 'group',
572-
funnelnorm: 'fraction'
573-
});
574-
575-
expect(gd._fullLayout.funnelnorm).toBe('fraction');
576-
577-
var cd = gd.calcdata;
578-
assertPointField(cd, 'b', [[-0.6, -0.666, -1], [-0.4, -0.333, 0]]);
579-
assertPointField(cd, 's', [[1.2, 1.333, 2], [0.8, 0.666, 0]]);
580-
assertPointField(cd, 'x', [[-0.25, 0.75, 1.75], [0.25, 1.25, 2.25]]);
581-
assertPointField(cd, 'y', [[0.6, 0.666, 1], [0.4, 0.333, 0]]);
582-
});
583-
584-
it('should honor funnelnorm (stack case)', function() {
585-
var gd = mockFunnelPlot([{
586-
y: [3, 2, 1]
587-
}, {
588-
y: [2, 1, 0]
589-
}], {
590-
funnelgap: 0,
591-
funnelmode: 'stack',
592-
funnelnorm: 'fraction'
593-
});
594-
595-
expect(gd._fullLayout.funnelnorm).toBe('fraction');
596-
597-
var cd = gd.calcdata;
598-
assertPointField(cd, 'b', [[-1, -1, -1], [0.2, 0.333, 1]]);
599-
assertPointField(cd, 's', [[1.2, 1.333, 2], [0.8, 0.666, 0]]);
600-
assertPointField(cd, 'x', [[0, 1, 2], [0, 1, 2]]);
601-
assertPointField(cd, 'y', [[0.2, 0.333, 1], [1, 1, 1]]);
602-
});
603-
604519
it('should expand position axis', function() {
605520
var gd = mockFunnelPlot([{
606521
offset: 10,
@@ -628,8 +543,7 @@ describe('Funnel.crossTraceCalc', function() {
628543
y: [6, 7, 8]
629544
}], {
630545
funnelgap: 0,
631-
funnelmode: 'overlay',
632-
funnelnorm: false
546+
funnelmode: 'overlay'
633547
});
634548

635549
expect(gd._fullLayout.barnorm).toBeUndefined();
@@ -640,28 +554,6 @@ describe('Funnel.crossTraceCalc', function() {
640554
expect(Axes.getAutoRange(gd, ya)).toBeCloseToArray([-11.11, 11.11], undefined, '(ya.range)');
641555
});
642556

643-
it('should expand size axis (funnelnorm case)', function() {
644-
var gd = mockFunnelPlot([{
645-
y: [3, 2, 1]
646-
}, {
647-
y: [2, 1, 0]
648-
}, {
649-
y: [4, 3, 2, 1]
650-
}, {
651-
y: [3, 2, 1, 0]
652-
}], {
653-
funnelgap: 0,
654-
funnelnorm: 'fraction'
655-
});
656-
657-
expect(gd._fullLayout.funnelnorm).toBe('fraction');
658-
659-
var xa = gd._fullLayout.xaxis;
660-
var ya = gd._fullLayout.yaxis;
661-
expect(Axes.getAutoRange(gd, xa)).toBeCloseToArray([-0.5, 3.5], undefined, '(xa.range)');
662-
expect(Axes.getAutoRange(gd, ya)).toBeCloseToArray([-1.11, 1.11], undefined, '(ya.range)');
663-
});
664-
665557
it('works with log axes (grouped funnels)', function() {
666558
var gd = mockFunnelPlot([
667559
{y: [1, 10, 1e10]},
@@ -687,21 +579,6 @@ describe('Funnel.crossTraceCalc', function() {
687579
var ya = gd._fullLayout.yaxis;
688580
expect(Axes.getAutoRange(gd, ya)).toBeCloseToArray([-0.37946429649987423, 10.731646814611235], undefined, '(ya.range)');
689581
});
690-
691-
it('works with log axes (normalized funnels)', function() {
692-
// strange case... but it should work!
693-
var gd = mockFunnelPlot([
694-
{y: [1, 10, 1e10]},
695-
{y: [2, 20, 2e10]}
696-
], {
697-
yaxis: {type: 'log'},
698-
funnelmode: 'stack',
699-
funnelnorm: 'percent'
700-
});
701-
702-
var ya = gd._fullLayout.yaxis;
703-
expect(Axes.getAutoRange(gd, ya)).toBeCloseToArray([1, 3], undefined, '(ya.range)');
704-
});
705582
});
706583

707584
describe('A funnel plot', function() {

0 commit comments

Comments
 (0)