graph.vwf.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ---
  2. extends: http://vwf.example.com/node3.vwf
  3. properties:
  4. graphScale: undefined
  5. gridInterval: undefined
  6. gridLineInterval: undefined
  7. gridLength: undefined
  8. xAxisVisible: undefined
  9. yAxisVisible: undefined
  10. zAxisVisible: undefined
  11. gridVisible: undefined
  12. axisOpacity: undefined
  13. gridOpacity: undefined
  14. renderTop: undefined
  15. graphIsVisible$: true
  16. methods:
  17. setGraphVisibility:
  18. parameters:
  19. - visible
  20. body: |
  21. this.graphIsVisible$ = visible;
  22. toggleGraphVisibility: |
  23. this.setGraphVisibility( !this.graphIsVisible$ );
  24. graphLine:
  25. parameters:
  26. - axis
  27. - startValue
  28. - endValue
  29. - color
  30. - opacity
  31. - lineThickness
  32. - renderTop
  33. - name
  34. - optionalProperties
  35. body: |
  36. var lineDef = {
  37. "extends": "http://vwf.example.com/graphtool/graphline.vwf",
  38. "properties": {
  39. "axis": axis,
  40. "startValue": startValue,
  41. "endValue": endValue,
  42. "color": color,
  43. "opacity": opacity,
  44. "lineThickness": lineThickness,
  45. "renderTop": renderTop
  46. }
  47. }
  48. if ( optionalProperties ) {
  49. for ( var key in optionalProperties ) {
  50. lineDef.properties[ key ] = optionalProperties[ key ];
  51. }
  52. }
  53. name = name || "line" + this.lineCount++;
  54. this.children.create( name, lineDef );
  55. graphFunction:
  56. parameters:
  57. - lineFunction
  58. - startValue
  59. - endValue
  60. - pointCount
  61. - color
  62. - opacity
  63. - lineThickness
  64. - renderTop
  65. - name
  66. - optionalProperties
  67. body: |
  68. var functionDef = {
  69. "extends": "http://vwf.example.com/graphtool/graphlinefunction.vwf",
  70. "properties": {
  71. "lineFunction": lineFunction,
  72. "startValue": startValue,
  73. "endValue": endValue,
  74. "pointCount": pointCount,
  75. "color": color,
  76. "opacity": opacity,
  77. "lineThickness": lineThickness,
  78. "renderTop": renderTop
  79. }
  80. }
  81. if ( optionalProperties ) {
  82. for ( var key in optionalProperties ) {
  83. functionDef.properties[ key ] = optionalProperties[ key ];
  84. }
  85. }
  86. name = name || "function" + this.functioncount++;
  87. this.children.create( name, functionDef );
  88. graphPlane:
  89. parameters:
  90. - origin
  91. - normal
  92. - rotationAngle
  93. - size
  94. - color
  95. - opacity
  96. - doubleSided
  97. - renderTop
  98. - name
  99. - optionalProperties
  100. body: |
  101. var planeDef = {
  102. "extends": "http://vwf.example.com/graphtool/graphplane.vwf",
  103. "properties": {
  104. "origin": origin,
  105. "normal": normal,
  106. "rotationAngle": rotationAngle,
  107. "size": size,
  108. "color": color,
  109. "opacity": opacity,
  110. "doubleSided": doubleSided,
  111. "renderTop": renderTop
  112. }
  113. }
  114. if ( optionalProperties ) {
  115. for ( var key in optionalProperties ) {
  116. planeDef.properties[ key ] = optionalProperties[ key ];
  117. }
  118. }
  119. name = name || "plane" + this.planecount++;
  120. this.children.create( name, planeDef );
  121. graphGroup:
  122. parameters:
  123. - groupVisible
  124. - graphObjects
  125. - name
  126. - optionalProperties
  127. body: |
  128. var groupDef = {
  129. "extends": "http://vwf.example.com/graphtool/graphgroup.vwf",
  130. "properties": {
  131. "groupVisible": groupVisible,
  132. "graphObjects": graphObjects
  133. }
  134. }
  135. if ( optionalProperties ) {
  136. for ( var key in optionalProperties ) {
  137. groupDef.properties[ key ] = optionalProperties[ key ];
  138. }
  139. }
  140. name = name || "group" + this.groupcount++;
  141. this.children.create( name, groupDef );
  142. scripts: |
  143. this.lineCount = 0;
  144. this.functioncount = 0;
  145. this.planecount = 0;
  146. this.groupcount = 0;