forked from jacomyal/sigma.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsigma.settings.js
222 lines (196 loc) · 7.42 KB
/
sigma.settings.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
;(function(undefined) {
'use strict';
if (typeof sigma === 'undefined')
throw 'sigma is not declared';
// Packages initialization:
sigma.utils.pkg('sigma.settings');
var settings = {
/**
* GRAPH SETTINGS:
* ***************
*/
// {boolean} Indicates if the data have to be cloned in methods to add
// nodes or edges.
clone: true,
// {boolean} Indicates if nodes "id" values and edges "id", "source" and
// "target" values must be set as immutable.
immutable: true,
// {boolean} Indicates if sigma can log its errors and warnings.
verbose: false,
/**
* RENDERERS SETTINGS:
* *******************
*/
// {string}
defaultLabelColor: '#000',
// {string}
defaultEdgeColor: '#000',
// {string}
defaultNodeColor: '#000',
// {string}
defaultLabelSize: 14,
// {string} Indicates how to choose the edges color. Available values:
// "source", "target", "default"
edgeColor: 'source',
// {string}
font: 'arial',
// {string} Example: 'bold'
fontStyle: '',
// {string} Indicates how to choose the labels color. Available values:
// "node", "default"
labelColor: 'default',
// {string} Indicates how to choose the labels size. Available values:
// "fixed", "proportional"
labelSize: 'fixed',
// {string} The ratio between the font size of the label and the node size.
labelSizeRatio: 1,
// {number} The minimum size a node must have to see its label displayed.
labelThreshold: 8,
// {number} The oversampling factor used in WebGL renderer.
webglOversamplingRatio: 2,
// {number} The size of the border of hovered nodes.
borderSize: 0,
// {number} The default hovered node border's color.
defaultNodeBorderColor: '#000',
// {number} The hovered node's label font. If not specified, will heritate
// the "font" value.
hoverFont: '',
// {string} Example: 'bold'
hoverFontStyle: '',
// {string} Indicates how to choose the hovered nodes shadow color.
// Available values: "node", "default"
labelHoverShadow: 'default',
// {string}
labelHoverShadowColor: '#000',
// {string} Indicates how to choose the hovered nodes color.
// Available values: "node", "default"
nodeHoverColor: 'node',
// {string}
defaultNodeHoverColor: '#000',
// {string} Indicates how to choose the hovered nodes background color.
// Available values: "node", "default"
labelHoverBGColor: 'default',
// {string}
defaultHoverLabelBGColor: '#fff',
// {string} Indicates how to choose the hovered labels color.
// Available values: "node", "default"
labelHoverColor: 'default',
// {string}
defaultLabelHoverColor: '#000',
// {booleans} The different drawing modes:
// false: Layered not displayed.
// true: Layered displayed.
drawLabels: true,
drawEdges: true,
drawNodes: true,
// {boolean} Indicates if the edges must be drawn in several frames or in
// one frame, as the nodes and labels are drawn.
batchEdgesDrawing: false,
// {boolean} Indicates if the edges must be hidden during dragging and
// animations.
hideEdgesOnMove: false,
// {numbers} The different batch sizes, when elements are displayed in
// several frames.
canvasEdgesBatchSize: 500,
webglEdgesBatchSize: 1000,
/**
* RESCALE SETTINGS:
* *****************
*/
// {string} Indicates of to scale the graph relatively to its container.
// Available values: "inside", "outside"
scalingMode: 'inside',
// {number} The margin to keep around the graph.
sideMargin: 0,
// {number} Determine the size of the smallest and the biggest node / edges
// on the screen. This mapping makes easier to display the graph,
// avoiding too big nodes that take half of the screen, or too
// small ones that are not readable. If the two parameters are
// equals, then the minimal display size will be 0. And if they
// are both equal to 0, then there is no mapping, and the radius
// of the nodes will be their size.
minEdgeSize: 0.5,
maxEdgeSize: 1,
minNodeSize: 1,
maxNodeSize: 8,
/**
* CAPTORS SETTINGS:
* *****************
*/
// {boolean}
touchEnabled: true,
// {boolean}
mouseEnabled: true,
// {boolean} Defined whether the custom events such as "clickNode" can be
// used.
eventsEnabled: true,
// {number} Defines by how much multiplicating the zooming level when the
// user zooms with the mouse-wheel.
zoomingRatio: 1.7,
// {number} Defines by how much multiplicating the zooming level when the
// user zooms by double clicking.
doubleClickZoomingRatio: 2.2,
// {number} The minimum zooming level.
zoomMin: 0.0625,
// {number} The maximum zooming level.
zoomMax: 2,
// {number} The duration of animations following a mouse scrolling.
mouseZoomDuration: 200,
// {number} The duration of animations following a mouse double click.
doubleClickZoomDuration: 200,
// {number} The duration of animations following a mouse dropping.
mouseInertiaDuration: 200,
// {number} The inertia power (mouse captor).
mouseInertiaRatio: 3,
// {number} The duration of animations following a touch dropping.
touchInertiaDuration: 200,
// {number} The inertia power (touch captor).
touchInertiaRatio: 3,
// {number} The maximum time between two clicks to make it a double click.
doubleClickTimeout: 300,
// {number} The maximum time between two taps to make it a double tap.
doubleTapTimeout: 300,
// {number} The maximum time of dragging to trigger intertia.
dragTimeout: 200,
/**
* GLOBAL SETTINGS:
* ****************
*/
// {boolean} Determines whether the instance has to refresh itself
// automatically when a "resize" event is dispatched from the
// window object.
autoResize: true,
// {boolean} Determines whether the "rescale" middleware has to be called
// automatically for each camera on refresh.
autoRescale: true,
// {boolean} If set to false, the camera method "goTo" will basically do
// nothing.
enableCamera: true,
// {boolean} If set to false, the nodes cannot be hovered.
enableHovering: true,
// {boolean} If set to true, the rescale middleware will ignore node sizes
// to determine the graphs boundings.
rescaleIgnoreSize: false,
// {boolean} Determines if the core has to try to catch errors on
// rendering.
skipErrors: false,
/**
* CAMERA SETTINGS:
* ****************
*/
// {number} The power degrees applied to the nodes/edges size relatively to
// the zooming level. Basically:
// > onScreenR = Math.pow(zoom, nodesPowRatio) * R
// > onScreenT = Math.pow(zoom, edgesPowRatio) * T
nodesPowRatio: 0.5,
edgesPowRatio: 0.5,
/**
* ANIMATIONS SETTINGS:
* ********************
*/
// {number} The default animation time.
animationsTime: 200
};
// Export the previously designed settings:
sigma.settings = sigma.utils.extend(sigma.settings || {}, settings);
}).call(this);