Skip to content

Commit 9f4f248

Browse files
committed
where possible reuse treemap attributes in icicle
1 parent 46182ad commit 9f4f248

File tree

1 file changed

+6
-101
lines changed

1 file changed

+6
-101
lines changed

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

+6-101
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var colorScaleAttrs = require('../../components/colorscale/attributes');
77
var domainAttrs = require('../../plots/domain').attributes;
88
var pieAttrs = require('../pie/attributes');
99
var sunburstAttrs = require('../sunburst/attributes');
10+
var treemapAttrs = require('../treemap/attributes');
1011
var constants = require('./constants');
1112
var extendFlat = require('../../lib/extend').extendFlat;
1213

@@ -34,28 +35,9 @@ module.exports = {
3435
].join(' ')
3536
},
3637

37-
flip: {
38-
valType: 'flaglist',
39-
flags: [
40-
'x',
41-
'y'
42-
],
43-
dflt: '',
44-
editType: 'plot',
45-
description: [
46-
'Determines if the positions obtained from solver are flipped on each axis.'
47-
].join(' ')
48-
},
38+
flip: treemapAttrs.tiling.flip,
4939

50-
pad: {
51-
valType: 'number',
52-
min: 0,
53-
dflt: 3,
54-
editType: 'plot',
55-
description: [
56-
'Sets the inner padding (in px).'
57-
].join(' ')
58-
},
40+
pad: treemapAttrs.tiling.pad,
5941

6042
editType: 'calc',
6143
},
@@ -75,64 +57,7 @@ module.exports = {
7557

7658
leaf: sunburstAttrs.leaf,
7759

78-
pathbar: {
79-
visible: {
80-
valType: 'boolean',
81-
dflt: true,
82-
editType: 'plot',
83-
description: [
84-
'Determines if the path bar is drawn',
85-
'i.e. outside the trace `domain` and',
86-
'with one pixel gap.'
87-
].join(' ')
88-
},
89-
90-
side: {
91-
valType: 'enumerated',
92-
values: [
93-
'top',
94-
'bottom'
95-
],
96-
dflt: 'top',
97-
editType: 'plot',
98-
description: [
99-
'Determines on which side of the the icicle the',
100-
'`pathbar` should be presented.'
101-
].join(' ')
102-
},
103-
104-
edgeshape: {
105-
valType: 'enumerated',
106-
values: [
107-
'>',
108-
'<',
109-
'|',
110-
'/',
111-
'\\'
112-
],
113-
dflt: '>',
114-
editType: 'plot',
115-
description: [
116-
'Determines which shape is used for edges between `barpath` labels.'
117-
].join(' ')
118-
},
119-
120-
thickness: {
121-
valType: 'number',
122-
min: 12,
123-
editType: 'plot',
124-
description: [
125-
'Sets the thickness of `pathbar` (in px). If not specified the `pathbar.textfont.size` is used',
126-
'with 3 pixles extra padding on each side.'
127-
].join(' ')
128-
},
129-
130-
textfont: extendFlat({}, pieAttrs.textfont, {
131-
description: 'Sets the font used inside `pathbar`.'
132-
}),
133-
134-
editType: 'calc'
135-
},
60+
pathbar: treemapAttrs.pathbar,
13661

13762
text: pieAttrs.text,
13863
textinfo: sunburstAttrs.textinfo,
@@ -149,29 +74,9 @@ module.exports = {
14974

15075
textfont: pieAttrs.textfont,
15176
insidetextfont: pieAttrs.insidetextfont,
152-
outsidetextfont: extendFlat({}, pieAttrs.outsidetextfont, {
153-
description: [
154-
'Sets the font used for `textinfo` lying outside the sector.',
155-
'This option refers to the root of the hierarchy',
156-
'presented on top left corner of a icicle graph.',
157-
'Please note that if a hierarchy has multiple root nodes,',
158-
'this option won\'t have any effect and `insidetextfont` would be used.'
159-
].join(' ')
160-
}),
77+
outsidetextfont: treemapAttrs.outsidetextfont,
16178

162-
textposition: {
163-
valType: 'enumerated',
164-
values: [
165-
'top left', 'top center', 'top right',
166-
'middle left', 'middle center', 'middle right',
167-
'bottom left', 'bottom center', 'bottom right'
168-
],
169-
dflt: 'top left',
170-
editType: 'plot',
171-
description: [
172-
'Sets the positions of the `text` elements.'
173-
].join(' ')
174-
},
79+
textposition: treemapAttrs.textposition,
17580
sort: pieAttrs.sort,
17681
root: sunburstAttrs.root,
17782

0 commit comments

Comments
 (0)