-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
120 lines (115 loc) · 3.8 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
112
113
114
115
116
117
118
119
120
/**
* Copyright 2012-2020, 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 dash = require('../../drawing/attributes').dash;
var extendFlat = require('../../../lib/extend').extendFlat;
module.exports = {
newshape: {
line: {
color: {
valType: 'color',
editType: 'none',
role: 'info',
description: [
'Sets the line color.',
'By default uses either dark grey or white',
'to increase contrast with background color.'
].join(' ')
},
width: {
valType: 'number',
min: 0,
dflt: 4,
role: 'info',
editType: 'none',
description: 'Sets the line width (in px).'
},
dash: extendFlat({}, dash, {
dflt: 'solid',
editType: 'none'
}),
role: 'info',
editType: 'none'
},
fillcolor: {
valType: 'color',
dflt: 'rgba(0,0,0,0)',
role: 'info',
editType: 'none',
description: [
'Sets the color filling new shapes\' interior.',
'Please note that if using a fillcolor with alpha greater than half,',
'drag inside the active shape starts moving the shape underneath,',
'otherwise a new shape could be started over.'
].join(' ')
},
fillrule: {
valType: 'enumerated',
values: ['evenodd', 'nonzero'],
dflt: 'evenodd',
role: 'info',
editType: 'none',
description: [
'Determines the path\'s interior.',
'For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule'
].join(' ')
},
opacity: {
valType: 'number',
min: 0,
max: 1,
dflt: 1,
role: 'info',
editType: 'none',
description: 'Sets the opacity of new shapes.'
},
layer: {
valType: 'enumerated',
values: ['below', 'above'],
dflt: 'above',
role: 'info',
editType: 'none',
description: 'Specifies whether new shapes are drawn below or above traces.'
},
drawdirection: {
valType: 'enumerated',
role: 'info',
values: ['ortho', 'horizontal', 'vertical', 'diagonal'],
dflt: 'diagonal',
editType: 'none',
description: [
'When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*',
'this limits the drag to be horizontal, vertical or diagonal.',
'Using *diagonal* there is no limit e.g. in drawing lines in any direction.',
'*ortho* limits the draw to be either horizontal or vertical.',
'*horizontal* allows horizontal extend.',
'*vertical* allows vertical extend.'
].join(' ')
},
editType: 'none'
},
activeshape: {
fillcolor: {
valType: 'color',
dflt: 'rgb(255,0,255)',
role: 'style',
editType: 'none',
description: 'Sets the color filling the active shape\' interior.'
},
opacity: {
valType: 'number',
min: 0,
max: 1,
dflt: 0.5,
role: 'info',
editType: 'none',
description: 'Sets the opacity of the active shape.'
},
editType: 'none'
}
};