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.

97 lines
3.1 KiB

  1. // NOTE: When a typedef is isolated in a separate comment block, an actual description is generated for it,
  2. // using the rest of the commenting in the code block. Usage of typedef in other comments then
  3. // link to there. TIL.
  4. //
  5. // Also noteworthy, all typedef's set up in this manner are collected in a single, global page 'global.html'.
  6. // In other words, it doesn't matter *where* the typedef's are defined in the code.
  7. //
  8. //
  9. // TODO: add descriptive commenting to given typedef's
  10. /**
  11. * @typedef {{type:string, point:Point, angle:number, length:number}} ArrowData
  12. *
  13. * Object containing instantiation data for a given endpoint.
  14. */
  15. /**
  16. * @typedef {{x:number, y:number}} Point
  17. *
  18. * A point in view-coordinates.
  19. */
  20. /**
  21. * @typedef {{toArrow: boolean, toArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), toArrowType: *, middleArrow: boolean, middleArrowScale: (number|allOptions.edges.arrows.middle.scaleFactor|{number}|Array), middleArrowType: (allOptions.edges.arrows.middle.type|{string}|string|*), fromArrow: boolean, fromArrowScale: (allOptions.edges.arrows.to.scaleFactor|{number}|allOptions.edges.arrows.middle.scaleFactor|allOptions.edges.arrows.from.scaleFactor|Array|number), fromArrowType: *, arrowStrikethrough: (*|boolean|allOptions.edges.arrowStrikethrough|{boolean}), color: undefined, inheritsColor: (string|string|string|allOptions.edges.color.inherit|{string, boolean}|Array|*), opacity: *, hidden: *, length: *, shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *, dashes: (*|boolean|Array|allOptions.edges.dashes|{boolean, array}), width: *}} ArrowOptions
  22. */
  23. /**
  24. * @typedef {string|number} Id
  25. */
  26. /**
  27. * @typedef {Id} NodeId
  28. */
  29. /**
  30. * @typedef {Id} EdgeId
  31. */
  32. /**
  33. * @typedef {Id} LabelId
  34. */
  35. /**
  36. * @typedef {{x: number, y: number}} point
  37. */
  38. /**
  39. * @typedef {{left: number, top: number, width: number, height: number}} rect
  40. */
  41. /**
  42. * @typedef {{x: number, y:number, angle: number}} rotationPoint
  43. *
  44. * point to rotate around and the angle in radians to rotate. angle == 0 means no rotation
  45. */
  46. /**
  47. * @typedef {{nodeId:NodeId}} nodeClickItem
  48. */
  49. /**
  50. * @typedef {{nodeId:NodeId, labelId:LabelId}} nodeLabelClickItem
  51. */
  52. /**
  53. * @typedef {{edgeId:EdgeId}} edgeClickItem
  54. */
  55. /**
  56. * @typedef {{edgeId:EdgeId, labelId:LabelId}} edgeLabelClickItem
  57. */
  58. /**
  59. * @typedef {'bold'|'ital'|'boldital'|'mono'|'normal'} MultiFontStyle
  60. *
  61. * The allowed specifiers of multi-fonts.
  62. */
  63. /**
  64. * @typedef {{color:string, size:number, face:string, mod:string, vadjust:number}} MultiFontOptions
  65. *
  66. * The full set of options of a given multi-font.
  67. */
  68. /**
  69. * @typedef {Array.<object>} Pile
  70. *
  71. * Sequence of option objects, the order is significant.
  72. * The sequence is used to determine the value of a given option.
  73. *
  74. * Usage principles:
  75. *
  76. * - All search is done in the sequence of the pile.
  77. * - As soon as a value is found, the searching stops.
  78. * - prototypes are totally ignored. The idea is to add option objects used as prototypes
  79. * to the pile, in the correct order.
  80. */