-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
111 lines (94 loc) · 3.14 KB
/
attributes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var pieAttrs = require('../pie/attributes');
var plotAttrs = require('../../plots/attributes');
var domainAttrs = require('../../plots/domain').attributes;
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
var texttemplateAttrs = require('../../components/fx/texttemplate_attributes');
var extendFlat = require('../../lib/extend').extendFlat;
module.exports = {
labels: pieAttrs.labels,
// equivalent of x0 and dx, if label is missing
label0: pieAttrs.label0,
dlabel: pieAttrs.dlabel,
values: pieAttrs.values,
marker: {
colors: pieAttrs.marker.colors,
line: {
color: extendFlat({}, pieAttrs.marker.line.color, {
dflt: null,
description: [
'Sets the color of the line enclosing each sector.',
'Defaults to the `paper_bgcolor` value.'
].join(' ')
}),
width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}),
editType: 'calc'
},
editType: 'calc'
},
text: pieAttrs.text,
hovertext: pieAttrs.hovertext,
scalegroup: extendFlat({}, pieAttrs.scalegroup, {
description: [
'If there are multiple funnelareas that should be sized according to',
'their totals, link them by providing a non-empty group id here',
'shared by every trace in the same group.'
].join(' ')
}),
textinfo: extendFlat({}, pieAttrs.textinfo, {
flags: ['label', 'text', 'value', 'percent']
}),
texttemplate: texttemplateAttrs({editType: 'plot'}, {
keys: ['label', 'color', 'value', 'percent', 'text']
}),
hoverinfo: extendFlat({}, plotAttrs.hoverinfo, {
flags: ['label', 'text', 'value', 'percent', 'name']
}),
hovertemplate: hovertemplateAttrs({}, {
keys: ['label', 'color', 'value', 'percent', 'text']
}),
textposition: extendFlat({}, pieAttrs.textposition, {
values: ['inside', 'none'],
dflt: 'inside'
}),
textfont: pieAttrs.textfont,
insidetextfont: pieAttrs.insidetextfont,
title: {
text: pieAttrs.title.text,
font: pieAttrs.title.font,
position: extendFlat({}, pieAttrs.title.position, {
values: ['top left', 'top center', 'top right'],
dflt: 'top center'
}),
editType: 'plot'
},
domain: domainAttrs({name: 'funnelarea', trace: true, editType: 'calc'}),
aspectratio: {
valType: 'number',
role: 'info',
min: 0,
dflt: 1,
editType: 'plot',
description: [
'Sets the ratio between height and width'
].join(' ')
},
baseratio: {
valType: 'number',
role: 'info',
min: 0,
max: 1,
dflt: 0.333,
editType: 'plot',
description: [
'Sets the ratio between bottom length and maximum top length.'
].join(' ')
}
};