forked from plotly/plotly.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_types.js
More file actions
58 lines (54 loc) · 1.45 KB
/
edit_types.js
File metadata and controls
58 lines (54 loc) · 1.45 KB
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
/**
* 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';
module.exports = {
/*
* default (all false) edit flags for restyle (traces)
* creates a new object each call, so the caller can mutate freely
*/
traces: function() {
return {
docalc: false,
docalcAutorange: false,
doplot: false,
dostyle: false,
docolorbars: false,
autorangeOn: false,
clearCalc: false,
fullReplot: false
};
},
/*
* default (all false) edit flags for relayout
* creates a new object each call, so the caller can mutate freely
*/
layout: function() {
return {
dolegend: false,
doticks: false,
dolayoutstyle: false,
doplot: false,
docalc: false,
domodebar: false,
docamera: false,
layoutReplot: false
};
},
/*
* update `flags` with the `editType` values found in `attr`
*/
update: function(flags, attr) {
var editType = attr.editType;
if(editType) {
var editTypeParts = editType.split('+');
for(var i = 0; i < editTypeParts.length; i++) {
flags[editTypeParts[i]] = true;
}
}
}
};