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.

132 lines
4.1 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. xCenter : { string },
  43. yCenter : { string },
  44. dataColor : colorOptions,
  45. dotSizeMinFraction: { number },
  46. dotSizeMaxFraction: { number },
  47. dotSizeRatio : { number },
  48. filterLabel : { string },
  49. gridColor : { string },
  50. onclick : { 'function': 'function' },
  51. keepAspectRatio : { boolean: bool },
  52. xLabel : { string },
  53. yLabel : { string },
  54. zLabel : { string },
  55. legendLabel : { string },
  56. xMin : { number, 'undefined': 'undefined' },
  57. yMin : { number, 'undefined': 'undefined' },
  58. zMin : { number, 'undefined': 'undefined' },
  59. xMax : { number, 'undefined': 'undefined' },
  60. yMax : { number, 'undefined': 'undefined' },
  61. zMax : { number, 'undefined': 'undefined' },
  62. showAnimationControls: { boolean: bool, 'undefined': 'undefined' },
  63. showGrid : { boolean: bool },
  64. showLegend : { boolean: bool, 'undefined': 'undefined' },
  65. showPerspective : { boolean: bool },
  66. showShadow : { boolean: bool },
  67. showXAxis : { boolean: bool },
  68. showYAxis : { boolean: bool },
  69. showZAxis : { boolean: bool },
  70. xStep : { number, 'undefined': 'undefined' },
  71. yStep : { number, 'undefined': 'undefined' },
  72. zStep : { number, 'undefined': 'undefined' },
  73. style: {
  74. number, // TODO: either Graph3d.DEFAULT has string, or number allowed in documentation
  75. string: [
  76. 'bar',
  77. 'bar-color',
  78. 'bar-size',
  79. 'dot',
  80. 'dot-line',
  81. 'dot-color',
  82. 'dot-size',
  83. 'line',
  84. 'grid',
  85. 'surface'
  86. ]
  87. },
  88. tooltip : { boolean: bool, 'function': 'function' },
  89. tooltipStyle : {
  90. content: {
  91. color : { string },
  92. background : { string },
  93. border : { string },
  94. borderRadius: { string },
  95. boxShadow : { string },
  96. padding : { string },
  97. __type__ : { object }
  98. },
  99. line: {
  100. borderLeft: { string },
  101. height : { string },
  102. width : { string },
  103. __type__ : { object }
  104. },
  105. dot: {
  106. border : { string },
  107. borderRadius: { string },
  108. height : { string },
  109. width : { string },
  110. __type__ : { object},
  111. },
  112. __type__: { object}
  113. },
  114. xValueLabel : { 'function': 'function' },
  115. yValueLabel : { 'function': 'function' },
  116. zValueLabel : { 'function': 'function' },
  117. valueMax : { number, 'undefined': 'undefined' },
  118. valueMin : { number, 'undefined': 'undefined' },
  119. verticalRatio : { number },
  120. //globals :
  121. height: { string },
  122. width: { string },
  123. __type__: { object }
  124. };
  125. export {allOptions};