Skip to content

Commit fd1f6ca

Browse files
committed
improve funnel orientation description and do base waterfall and funnel textinfo attr on pie
1 parent 0eb3917 commit fd1f6ca

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

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

+21-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
'use strict';
1010

11-
var pieAtts = require('../pie/attributes');
1211
var barAttrs = require('../bar/attributes');
1312
var lineAttrs = require('../scatter/attributes').line;
1413
var extendFlat = require('../../lib/extend').extendFlat;
@@ -25,14 +24,19 @@ module.exports = {
2524
hovertext: barAttrs.hovertext,
2625
hovertemplate: barAttrs.hovertemplate,
2726

28-
textinfo: extendFlat({}, pieAtts.textinfo, {
29-
editType: 'plot',
27+
textinfo: {
28+
valType: 'flaglist',
3029
flags: ['label', 'text', 'percent initial', 'percent previous', 'percent total', 'value'],
30+
extras: ['none'],
31+
role: 'info',
32+
editType: 'plot',
3133
arrayOk: false,
3234
description: [
33-
'Determines which trace information appear on the graph.'
35+
'Determines which trace information appear on the graph.',
36+
'In the case of having multiple funnels, percentages & totals',
37+
'are computed separately (per trace).'
3438
].join(' ')
35-
}),
39+
},
3640

3741
text: barAttrs.text,
3842
textposition: extendFlat({}, barAttrs.textposition, {dflt: 'auto'}),
@@ -42,9 +46,19 @@ module.exports = {
4246
insidetextfont: barAttrs.insidetextfont,
4347
outsidetextfont: barAttrs.outsidetextfont,
4448
constraintext: barAttrs.constraintext,
45-
4649
cliponaxis: barAttrs.cliponaxis,
47-
orientation: barAttrs.orientation,
50+
51+
orientation: extendFlat({}, barAttrs.orientation, {
52+
description: [
53+
'Sets the orientation of the funnels.',
54+
'With *v* (*h*), the value of the each bar spans',
55+
'along the vertical (horizontal).',
56+
'By default funnels are tend to be oriented horizontally;',
57+
'unless only *y* array is presented or orientation is set to *v*.',
58+
'Also regarding graphs including only \'horizontal\' funnels,',
59+
'*autorange* on the *y-axis* are set to *reversed*.'
60+
].join(' ')
61+
}),
4862

4963
offset: extendFlat({}, barAttrs.offset, {arrayOk: false}),
5064
width: extendFlat({}, barAttrs.width, {arrayOk: false}),

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
'use strict';
1010

11-
var pieAtts = require('../pie/attributes');
1211
var barAttrs = require('../bar/attributes');
1312
var lineAttrs = require('../scatter/attributes').line;
1413
var extendFlat = require('../../lib/extend').extendFlat;
@@ -77,14 +76,19 @@ module.exports = {
7776
hovertext: barAttrs.hovertext,
7877
hovertemplate: barAttrs.hovertemplate,
7978

80-
textinfo: extendFlat({}, pieAtts.textinfo, {
81-
editType: 'plot',
79+
textinfo: {
80+
valType: 'flaglist',
8281
flags: ['label', 'text', 'initial', 'delta', 'final'],
82+
extras: ['none'],
83+
role: 'info',
84+
editType: 'plot',
8385
arrayOk: false,
8486
description: [
85-
'Determines which trace information appear on the graph.'
87+
'Determines which trace information appear on the graph.',
88+
'In the case of having multiple waterfalls, totals',
89+
'are computed separately (per trace).'
8690
].join(' ')
87-
}),
91+
},
8892

8993
text: barAttrs.text,
9094
textposition: barAttrs.textposition,

0 commit comments

Comments
 (0)