-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
88 lines (81 loc) · 2.76 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
/**
* Copyright 2012-2017, 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 scatterAttrs = require('../scatter/attributes');
var colorAttributes = require('../../components/colorscale/color_attributes');
var DASHES = require('../../constants/gl2d_dashes');
var MARKERS = require('../../constants/gl_markers');
var extendFlat = require('../../lib/extend').extendFlat;
var extendDeep = require('../../lib/extend').extendDeep;
var scatterLineAttrs = scatterAttrs.line,
scatterMarkerAttrs = scatterAttrs.marker,
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
module.exports = {
x: scatterAttrs.x,
x0: scatterAttrs.x0,
dx: scatterAttrs.dx,
y: scatterAttrs.y,
y0: scatterAttrs.y0,
dy: scatterAttrs.dy,
text: extendFlat({}, scatterAttrs.text, {
description: [
'Sets text elements associated with each (x,y) pair to appear on hover.',
'If a single string, the same string appears over',
'all the data points.',
'If an array of string, the items are mapped in order to the',
'this trace\'s (x,y) coordinates.'
].join(' ')
}),
mode: {
valType: 'flaglist',
flags: ['lines', 'markers'],
extras: ['none'],
role: 'info',
description: [
'Determines the drawing mode for this scatter trace.'
].join(' ')
},
line: {
color: scatterLineAttrs.color,
width: scatterLineAttrs.width,
dash: {
valType: 'enumerated',
values: Object.keys(DASHES),
dflt: 'solid',
role: 'style',
description: 'Sets the style of the lines.'
}
},
marker: extendDeep({}, colorAttributes('marker'), {
symbol: {
valType: 'enumerated',
values: Object.keys(MARKERS),
dflt: 'circle',
arrayOk: true,
role: 'style',
description: 'Sets the marker symbol type.'
},
size: scatterMarkerAttrs.size,
sizeref: scatterMarkerAttrs.sizeref,
sizemin: scatterMarkerAttrs.sizemin,
sizemode: scatterMarkerAttrs.sizemode,
opacity: scatterMarkerAttrs.opacity,
showscale: scatterMarkerAttrs.showscale,
colorbar: scatterMarkerAttrs.colorbar,
line: extendDeep({}, colorAttributes('marker.line'), {
width: scatterMarkerLineAttrs.width
})
}),
connectgaps: scatterAttrs.connectgaps,
fill: extendFlat({}, scatterAttrs.fill, {
values: ['none', 'tozeroy', 'tozerox']
}),
fillcolor: scatterAttrs.fillcolor,
error_y: scatterAttrs.error_y,
error_x: scatterAttrs.error_x
};