-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathplot_config.js
83 lines (60 loc) · 2.19 KB
/
plot_config.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
/**
* Copyright 2012-2015, 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';
/**
* This will be transfered over to gd and overridden by
* config args to Plotly.plot.
*
* The defaults are the appropriate settings for plotly.js,
* so we get the right experience without any config argument.
*/
module.exports = {
// no interactivity, for export or image generation
staticPlot: false,
// we can edit titles, move annotations, etc
editable: false,
// plot will respect layout.autosize=true and infer its container size
autosizable: false,
// if we DO autosize, do we fill the container or the screen?
fillFrame: false,
// if we DO autosize, set the frame margins in percents of plot size
frameMargins: 0,
// mousewheel or two-finger scroll zooms the plot
scrollZoom: false,
// double click interaction (false, 'reset', 'autosize' or 'reset+autosize')
doubleClick: 'reset+autosize',
// new users see some hints about interactivity
showTips: true,
// link to open this plot in plotly
showLink: false,
// if we show a link, does it contain data or just link to a plotly file?
sendData: true,
// text appearing in the sendData link
linkText: 'Edit chart',
// false or function adding source(s) to linkText <text>
showSources: false,
// display the modebar (true, false, or 'hover')
displayModeBar: 'hover',
// add the plotly logo on the end of the modebar
displaylogo: true,
// increase the pixel ratio for Gl plot images
plotGlPixelRatio: 2,
// function to add the background color to a different container
// or 'opaque' to ensure there's white behind it
setBackground: defaultSetBackground,
// URL to topojson files used in geo charts
topojsonURL: 'https://cdn.plot.ly/'
};
// where and how the background gets set can be overridden by context
// so we define the default (plotlyjs) behavior here
function defaultSetBackground(gd, bgColor) {
try {
gd._fullLayout._paper.style('background', bgColor);
}
catch(e) { console.log(e); }
}