Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
8.4 KiB

  1. ;(function(undefined) {
  2. 'use strict';
  3. if (typeof sigma === 'undefined')
  4. throw 'sigma is not declared';
  5. // Packages initialization:
  6. sigma.utils.pkg('sigma.settings');
  7. var settings = {
  8. /**
  9. * GRAPH SETTINGS:
  10. * ***************
  11. */
  12. // {boolean} Indicates if the data have to be cloned in methods to add
  13. // nodes or edges.
  14. clone: true,
  15. // {boolean} Indicates if nodes "id" values and edges "id", "source" and
  16. // "target" values must be set as immutable.
  17. immutable: true,
  18. // {boolean} Indicates if sigma can log its errors and warnings.
  19. verbose: false,
  20. /**
  21. * RENDERERS SETTINGS:
  22. * *******************
  23. */
  24. // {string}
  25. classPrefix: 'sigma',
  26. // {string}
  27. defaultNodeType: 'def',
  28. // {string}
  29. defaultEdgeType: 'def',
  30. // {string}
  31. defaultLabelColor: '#000',
  32. // {string}
  33. defaultEdgeColor: '#000',
  34. // {string}
  35. defaultNodeColor: '#000',
  36. // {string}
  37. defaultLabelSize: 14,
  38. // {string} Indicates how to choose the edges color. Available values:
  39. // "source", "target", "default"
  40. edgeColor: 'source',
  41. // {number} Defines the minimal edge's arrow display size.
  42. minArrowSize: 0,
  43. // {string}
  44. font: 'arial',
  45. // {string} Example: 'bold'
  46. fontStyle: '',
  47. // {string} Indicates how to choose the labels color. Available values:
  48. // "node", "default"
  49. labelColor: 'default',
  50. // {string} Indicates how to choose the labels size. Available values:
  51. // "fixed", "proportional"
  52. labelSize: 'fixed',
  53. // {string} The ratio between the font size of the label and the node size.
  54. labelSizeRatio: 1,
  55. // {number} The minimum size a node must have to see its label displayed.
  56. labelThreshold: 8,
  57. // {number} The oversampling factor used in WebGL renderer.
  58. webglOversamplingRatio: 2,
  59. // {number} The size of the border of hovered nodes.
  60. borderSize: 0,
  61. // {number} The default hovered node border's color.
  62. defaultNodeBorderColor: '#000',
  63. // {number} The hovered node's label font. If not specified, will heritate
  64. // the "font" value.
  65. hoverFont: '',
  66. // {boolean} If true, then only one node can be hovered at a time.
  67. singleHover: true,
  68. // {string} Example: 'bold'
  69. hoverFontStyle: '',
  70. // {string} Indicates how to choose the hovered nodes shadow color.
  71. // Available values: "node", "default"
  72. labelHoverShadow: 'default',
  73. // {string}
  74. labelHoverShadowColor: '#000',
  75. // {string} Indicates how to choose the hovered nodes color.
  76. // Available values: "node", "default"
  77. nodeHoverColor: 'node',
  78. // {string}
  79. defaultNodeHoverColor: '#000',
  80. // {string} Indicates how to choose the hovered nodes background color.
  81. // Available values: "node", "default"
  82. labelHoverBGColor: 'default',
  83. // {string}
  84. defaultHoverLabelBGColor: '#fff',
  85. // {string} Indicates how to choose the hovered labels color.
  86. // Available values: "node", "default"
  87. labelHoverColor: 'default',
  88. // {string}
  89. defaultLabelHoverColor: '#000',
  90. // {string} Indicates how to choose the edges hover color. Available values:
  91. // "edge", "default"
  92. edgeHoverColor: 'edge',
  93. // {number} The size multiplicator of hovered edges.
  94. edgeHoverSizeRatio: 1,
  95. // {string}
  96. defaultEdgeHoverColor: '#000',
  97. // {boolean} Indicates if the edge extremities must be hovered when the
  98. // edge is hovered.
  99. edgeHoverExtremities: false,
  100. // {booleans} The different drawing modes:
  101. // false: Layered not displayed.
  102. // true: Layered displayed.
  103. drawEdges: true,
  104. drawNodes: true,
  105. drawLabels: true,
  106. drawEdgeLabels: false,
  107. // {boolean} Indicates if the edges must be drawn in several frames or in
  108. // one frame, as the nodes and labels are drawn.
  109. batchEdgesDrawing: false,
  110. // {boolean} Indicates if the edges must be hidden during dragging and
  111. // animations.
  112. hideEdgesOnMove: false,
  113. // {numbers} The different batch sizes, when elements are displayed in
  114. // several frames.
  115. canvasEdgesBatchSize: 500,
  116. webglEdgesBatchSize: 1000,
  117. /**
  118. * RESCALE SETTINGS:
  119. * *****************
  120. */
  121. // {string} Indicates of to scale the graph relatively to its container.
  122. // Available values: "inside", "outside"
  123. scalingMode: 'inside',
  124. // {number} The margin to keep around the graph.
  125. sideMargin: 0,
  126. // {number} Determine the size of the smallest and the biggest node / edges
  127. // on the screen. This mapping makes easier to display the graph,
  128. // avoiding too big nodes that take half of the screen, or too
  129. // small ones that are not readable. If the two parameters are
  130. // equals, then the minimal display size will be 0. And if they
  131. // are both equal to 0, then there is no mapping, and the radius
  132. // of the nodes will be their size.
  133. minEdgeSize: 0.5,
  134. maxEdgeSize: 1,
  135. minNodeSize: 1,
  136. maxNodeSize: 8,
  137. /**
  138. * CAPTORS SETTINGS:
  139. * *****************
  140. */
  141. // {boolean}
  142. touchEnabled: true,
  143. // {boolean}
  144. mouseEnabled: true,
  145. // {boolean}
  146. mouseWheelEnabled: true,
  147. // {boolean}
  148. doubleClickEnabled: true,
  149. // {boolean} Defines whether the custom events such as "clickNode" can be
  150. // used.
  151. eventsEnabled: true,
  152. // {number} Defines by how much multiplicating the zooming level when the
  153. // user zooms with the mouse-wheel.
  154. zoomingRatio: 1.7,
  155. // {number} Defines by how much multiplicating the zooming level when the
  156. // user zooms by double clicking.
  157. doubleClickZoomingRatio: 2.2,
  158. // {number} The minimum zooming level.
  159. zoomMin: 0.0625,
  160. // {number} The maximum zooming level.
  161. zoomMax: 2,
  162. // {number} The duration of animations following a mouse scrolling.
  163. mouseZoomDuration: 200,
  164. // {number} The duration of animations following a mouse double click.
  165. doubleClickZoomDuration: 200,
  166. // {number} The duration of animations following a mouse dropping.
  167. mouseInertiaDuration: 200,
  168. // {number} The inertia power (mouse captor).
  169. mouseInertiaRatio: 3,
  170. // {number} The duration of animations following a touch dropping.
  171. touchInertiaDuration: 200,
  172. // {number} The inertia power (touch captor).
  173. touchInertiaRatio: 3,
  174. // {number} The maximum time between two clicks to make it a double click.
  175. doubleClickTimeout: 300,
  176. // {number} The maximum time between two taps to make it a double tap.
  177. doubleTapTimeout: 300,
  178. // {number} The maximum time of dragging to trigger intertia.
  179. dragTimeout: 200,
  180. /**
  181. * GLOBAL SETTINGS:
  182. * ****************
  183. */
  184. // {boolean} Determines whether the instance has to refresh itself
  185. // automatically when a "resize" event is dispatched from the
  186. // window object.
  187. autoResize: true,
  188. // {boolean} Determines whether the "rescale" middleware has to be called
  189. // automatically for each camera on refresh.
  190. autoRescale: true,
  191. // {boolean} If set to false, the camera method "goTo" will basically do
  192. // nothing.
  193. enableCamera: true,
  194. // {boolean} If set to false, the nodes cannot be hovered.
  195. enableHovering: true,
  196. // {boolean} If set to true, the edges can be hovered.
  197. enableEdgeHovering: false,
  198. // {number} The size of the area around the edges to activate hovering.
  199. edgeHoverPrecision: 5,
  200. // {boolean} If set to true, the rescale middleware will ignore node sizes
  201. // to determine the graphs boundings.
  202. rescaleIgnoreSize: false,
  203. // {boolean} Determines if the core has to try to catch errors on
  204. // rendering.
  205. skipErrors: false,
  206. /**
  207. * CAMERA SETTINGS:
  208. * ****************
  209. */
  210. // {number} The power degrees applied to the nodes/edges size relatively to
  211. // the zooming level. Basically:
  212. // > onScreenR = Math.pow(zoom, nodesPowRatio) * R
  213. // > onScreenT = Math.pow(zoom, edgesPowRatio) * T
  214. nodesPowRatio: 0.5,
  215. edgesPowRatio: 0.5,
  216. /**
  217. * ANIMATIONS SETTINGS:
  218. * ********************
  219. */
  220. // {number} The default animation time.
  221. animationsTime: 200
  222. };
  223. // Export the previously designed settings:
  224. sigma.settings = sigma.utils.extend(sigma.settings || {}, settings);
  225. }).call(this);