vis.js is a dynamic, browser-based visualization library
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.

136 lines
4.2 KiB

  1. /**
  2. * This object contains all possible options. It will check if the types are correct, if required if the option is one
  3. * of the allowed values.
  4. *
  5. * __any__ means that the name of the property does not matter.
  6. * __type__ is a required field for all objects and contains the allowed types of all objects
  7. */
  8. let string = 'string';
  9. let bool = 'boolean';
  10. let number = 'number';
  11. let object = 'object'; // should only be in a __type__ property
  12. // Following not used here, but useful for reference
  13. //let array = 'array';
  14. //let dom = 'dom';
  15. //let any = 'any';
  16. let colorOptions = {
  17. fill : { string },
  18. stroke : { string },
  19. strokeWidth: { number },
  20. __type__ : { string, object, 'undefined': 'undefined' }
  21. };
  22. /**
  23. * Order attempted to be alphabetical.
  24. * - x/y/z-prefixes ignored in sorting
  25. * - __type__ always at end
  26. * - globals at end
  27. */
  28. let allOptions = {
  29. animationAutoStart: { boolean: bool, 'undefined': 'undefined' },
  30. animationInterval : { number },
  31. animationPreload : { boolean: bool },
  32. axisColor : { string },
  33. backgroundColor : colorOptions,
  34. xBarWidth : { number, 'undefined': 'undefined' },
  35. yBarWidth : { number, 'undefined': 'undefined' },
  36. cameraPosition : {
  37. distance : { number },
  38. horizontal: { number },
  39. vertical : { number },
  40. __type__ : { object }
  41. },
  42. zoomable : { boolean: bool },
  43. ctrlToZoom : { boolean: bool },
  44. xCenter : { string },
  45. yCenter : { string },
  46. dataColor : colorOptions,
  47. dotSizeMinFraction: { number },
  48. dotSizeMaxFraction: { number },
  49. dotSizeRatio : { number },
  50. filterLabel : { string },
  51. gridColor : { string },
  52. onclick : { 'function': 'function' },
  53. keepAspectRatio : { boolean: bool },
  54. xLabel : { string },
  55. yLabel : { string },
  56. zLabel : { string },
  57. legendLabel : { string },
  58. xMin : { number, 'undefined': 'undefined' },
  59. yMin : { number, 'undefined': 'undefined' },
  60. zMin : { number, 'undefined': 'undefined' },
  61. xMax : { number, 'undefined': 'undefined' },
  62. yMax : { number, 'undefined': 'undefined' },
  63. zMax : { number, 'undefined': 'undefined' },
  64. showAnimationControls: { boolean: bool, 'undefined': 'undefined' },
  65. showGrid : { boolean: bool },
  66. showLegend : { boolean: bool, 'undefined': 'undefined' },
  67. showPerspective : { boolean: bool },
  68. showShadow : { boolean: bool },
  69. showXAxis : { boolean: bool },
  70. showYAxis : { boolean: bool },
  71. showZAxis : { boolean: bool },
  72. xStep : { number, 'undefined': 'undefined' },
  73. yStep : { number, 'undefined': 'undefined' },
  74. zStep : { number, 'undefined': 'undefined' },
  75. style: {
  76. number, // TODO: either Graph3d.DEFAULT has string, or number allowed in documentation
  77. string: [
  78. 'bar',
  79. 'bar-color',
  80. 'bar-size',
  81. 'dot',
  82. 'dot-line',
  83. 'dot-color',
  84. 'dot-size',
  85. 'line',
  86. 'grid',
  87. 'surface'
  88. ]
  89. },
  90. tooltip : { boolean: bool, 'function': 'function' },
  91. tooltipStyle : {
  92. content: {
  93. color : { string },
  94. background : { string },
  95. border : { string },
  96. borderRadius: { string },
  97. boxShadow : { string },
  98. padding : { string },
  99. __type__ : { object }
  100. },
  101. line: {
  102. borderLeft : { string },
  103. height : { string },
  104. width : { string },
  105. pointerEvents: { string },
  106. __type__ : { object }
  107. },
  108. dot: {
  109. border : { string },
  110. borderRadius : { string },
  111. height : { string },
  112. width : { string },
  113. pointerEvents: { string },
  114. __type__ : { object}
  115. },
  116. __type__: { object}
  117. },
  118. xValueLabel : { 'function': 'function' },
  119. yValueLabel : { 'function': 'function' },
  120. zValueLabel : { 'function': 'function' },
  121. valueMax : { number, 'undefined': 'undefined' },
  122. valueMin : { number, 'undefined': 'undefined' },
  123. verticalRatio : { number },
  124. //globals :
  125. height: { string },
  126. width: { string },
  127. __type__: { object }
  128. };
  129. export {allOptions};