vislite 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/.editorconfig +18 -18
  2. package/AUTHORS.txt +6 -6
  3. package/CHANGELOG +16 -0
  4. package/LICENSE +20 -20
  5. package/README.md +69 -69
  6. package/lib/Buffer/index.umd.js +3 -3
  7. package/lib/Buffer/index.umd.min.js +3 -3
  8. package/lib/Canvas/index.umd.js +3 -3
  9. package/lib/Canvas/index.umd.min.js +3 -3
  10. package/lib/Cardinal/index.umd.js +3 -3
  11. package/lib/Cardinal/index.umd.min.js +3 -3
  12. package/lib/Eoap/index.umd.js +3 -3
  13. package/lib/Eoap/index.umd.min.js +3 -3
  14. package/lib/Geometry/index.umd.js +205 -0
  15. package/lib/Geometry/index.umd.min.js +11 -0
  16. package/lib/Hermite/index.umd.js +3 -3
  17. package/lib/Hermite/index.umd.min.js +3 -3
  18. package/lib/Matrix4/index.umd.js +3 -3
  19. package/lib/Matrix4/index.umd.min.js +3 -3
  20. package/lib/Mercator/index.umd.js +5 -4
  21. package/lib/Mercator/index.umd.min.js +4 -4
  22. package/lib/OralCanvas/index.es.js +3 -3
  23. package/lib/OralCanvas/index.es.min.js +3 -3
  24. package/lib/OralWebGL/index.es.js +11 -11
  25. package/lib/OralWebGL/index.es.min.js +4 -4
  26. package/lib/SVG/index.umd.js +10 -4
  27. package/lib/SVG/index.umd.min.js +4 -4
  28. package/lib/Shader/index.umd.js +11 -11
  29. package/lib/Shader/index.umd.min.js +4 -4
  30. package/lib/Texture/index.umd.js +3 -3
  31. package/lib/Texture/index.umd.min.js +3 -3
  32. package/lib/TreeLayout/index.umd.js +8 -5
  33. package/lib/TreeLayout/index.umd.min.js +4 -4
  34. package/lib/WebGL/index.umd.js +11 -11
  35. package/lib/WebGL/index.umd.min.js +4 -4
  36. package/lib/animation/index.umd.js +3 -3
  37. package/lib/animation/index.umd.min.js +3 -3
  38. package/lib/formatColor/index.umd.js +3 -3
  39. package/lib/formatColor/index.umd.min.js +3 -3
  40. package/lib/getLoopColors/index.umd.js +3 -3
  41. package/lib/getLoopColors/index.umd.min.js +3 -3
  42. package/lib/getWebGLContext/index.umd.js +3 -3
  43. package/lib/getWebGLContext/index.umd.min.js +3 -3
  44. package/lib/index.umd.js +166 -16
  45. package/lib/index.umd.min.js +4 -4
  46. package/lib/resizeObserver/index.umd.js +3 -3
  47. package/lib/resizeObserver/index.umd.min.js +3 -3
  48. package/lib/rotate/index.umd.js +3 -3
  49. package/lib/rotate/index.umd.min.js +3 -3
  50. package/lib/ruler/index.umd.js +3 -3
  51. package/lib/ruler/index.umd.min.js +3 -3
  52. package/lib/throttle/index.umd.js +3 -3
  53. package/lib/throttle/index.umd.min.js +3 -3
  54. package/lib/viewHandler/index.umd.js +3 -3
  55. package/lib/viewHandler/index.umd.min.js +3 -3
  56. package/miniprogram/ui-canvas/index.js +107 -107
  57. package/miniprogram/ui-canvas/index.json +4 -4
  58. package/miniprogram/ui-canvas/index.wxml +4 -4
  59. package/miniprogram/ui-canvas/index.wxss +5 -5
  60. package/package/Buffer/index.ts +2 -2
  61. package/package/Canvas/index.ts +2 -2
  62. package/package/Cardinal/index.ts +2 -2
  63. package/package/Eoap/index.ts +2 -2
  64. package/package/Geometry/index.ts +3 -0
  65. package/package/Hermite/index.ts +2 -2
  66. package/package/Matrix4/index.ts +2 -2
  67. package/package/Mercator/index.ts +2 -2
  68. package/package/OralCanvas/index.ts +2 -2
  69. package/package/OralWebGL/index.ts +2 -2
  70. package/package/SVG/index.ts +2 -2
  71. package/package/Shader/index.ts +39 -39
  72. package/package/Texture/index.ts +2 -2
  73. package/package/TreeLayout/index.ts +2 -2
  74. package/package/WebGL/index.ts +2 -2
  75. package/package/animation/index.ts +2 -2
  76. package/package/formatColor/index.ts +2 -2
  77. package/package/getLoopColors/index.ts +2 -2
  78. package/package/getWebGLContext/index.ts +39 -39
  79. package/package/index.ts +6 -1
  80. package/package/resizeObserver/index.ts +2 -2
  81. package/package/rotate/index.ts +2 -2
  82. package/package/ruler/index.ts +2 -2
  83. package/package/throttle/index.ts +2 -2
  84. package/package/viewHandler/index.ts +2 -2
  85. package/package.json +3 -1
  86. package/src/Canvas.ts +67 -67
  87. package/src/Eoap.ts +1 -1
  88. package/src/Geometry.ts +83 -0
  89. package/src/Matrix4/index.ts +2 -2
  90. package/src/Matrix4/move.ts +12 -12
  91. package/src/Matrix4/rotate.ts +15 -15
  92. package/src/Matrix4/scale.ts +11 -11
  93. package/src/Matrix4/transform.ts +64 -64
  94. package/src/Mercator.ts +3 -2
  95. package/src/SVG.ts +24 -24
  96. package/src/TreeLayout/index.ts +4 -3
  97. package/src/WebGL.ts +66 -66
  98. package/src/animation.ts +98 -98
  99. package/src/common/assemble.ts +22 -22
  100. package/src/common/canvas/arc.ts +50 -50
  101. package/src/common/canvas/config.ts +158 -158
  102. package/src/common/canvas/gradient.ts +29 -29
  103. package/src/common/canvas/index.ts +168 -168
  104. package/src/common/canvas/painter.ts +426 -426
  105. package/src/common/canvas/texts.ts +18 -18
  106. package/src/common/geometry/prism-horizontal.ts +33 -0
  107. package/src/common/geometry/prism-vertical.ts +40 -0
  108. package/src/common/geometry/sphere-fragment.ts +39 -0
  109. package/src/common/geometry/tool/circle.ts +12 -0
  110. package/src/common/mergeOption.ts +6 -6
  111. package/src/common/setStyle.ts +5 -5
  112. package/src/common/svg/config.ts +174 -174
  113. package/src/common/svg/index.ts +9 -1
  114. package/src/common/svg/tool.ts +44 -44
  115. package/src/common/tree/index.ts +25 -25
  116. package/src/common/tree/toInnerTree.ts +56 -56
  117. package/src/common/tree/toPlainTree.ts +131 -131
  118. package/src/common/webgl/buffer.ts +79 -79
  119. package/src/common/webgl/doDraw.ts +108 -108
  120. package/src/common/webgl/getColorFactory.ts +26 -26
  121. package/src/common/webgl/getShader.ts +48 -48
  122. package/src/common/webgl/getTexture.ts +11 -11
  123. package/src/common/webgl/getWebGLContext.ts +27 -27
  124. package/src/common/webgl/index.ts +223 -223
  125. package/src/common/webgl/shader.ts +75 -75
  126. package/src/common/webgl/texture.ts +96 -96
  127. package/src/formatColor.ts +44 -44
  128. package/src/getLoopColors.ts +42 -42
  129. package/src/interpolation/Cardinal.ts +110 -110
  130. package/src/interpolation/Hermite.ts +65 -65
  131. package/src/resizeObserver.ts +36 -36
  132. package/src/rotate.ts +1 -1
  133. package/src/ruler.ts +188 -188
  134. package/src/shader/fsColor.c +7 -7
  135. package/src/shader/fsColors.c +7 -7
  136. package/src/shader/fsCube.c +8 -8
  137. package/src/shader/fsImage.c +8 -8
  138. package/src/shader/vsColor.c +17 -17
  139. package/src/shader/vsColors.c +13 -13
  140. package/src/shader/vsCube.c +13 -13
  141. package/src/shader/vsImage.c +13 -13
  142. package/src/throttle.ts +51 -51
  143. package/src/viewHandler.ts +158 -158
  144. package/types/Buffer.d.ts +23 -23
  145. package/types/Canvas.d.ts +300 -300
  146. package/types/CanvasConfig.d.ts +24 -0
  147. package/types/CanvasOption.d.ts +7 -7
  148. package/types/Cardinal.d.ts +13 -13
  149. package/types/Geometry.d.ts +41 -0
  150. package/types/GeometryOption.d.ts +12 -0
  151. package/types/GeometryResult.d.ts +19 -0
  152. package/types/Gradient.d.ts +14 -14
  153. package/types/Hermite.d.ts +18 -18
  154. package/types/Map.d.ts +2 -2
  155. package/types/Matrix4.d.ts +4 -4
  156. package/types/Object3D.d.ts +114 -114
  157. package/types/SVG.d.ts +18 -13
  158. package/types/SVGConfig.d.ts +76 -60
  159. package/types/Scene3D.d.ts +6 -6
  160. package/types/Shader.d.ts +21 -21
  161. package/types/Texture.d.ts +16 -16
  162. package/types/Tree.d.ts +69 -69
  163. package/types/TreeConfig.d.ts +24 -24
  164. package/types/TreeLayout.d.ts +8 -2
  165. package/types/TreeOption.d.ts +48 -48
  166. package/types/WebGL.d.ts +38 -38
  167. package/types/WebGLOption.d.ts +7 -7
  168. package/types/animation.d.ts +6 -6
  169. package/types/formatColor.d.ts +2 -2
  170. package/types/getLoopColors.d.ts +2 -2
  171. package/types/getWebGLContext.d.ts +2 -2
  172. package/types/index.d.ts +15 -1
  173. package/types/painterConfig.d.ts +2 -2
  174. package/types/resizeObserver.d.ts +2 -2
  175. package/types/rotate.d.ts +1 -1
  176. package/types/ruler.d.ts +7 -7
  177. package/types/throttle.d.ts +4 -4
  178. package/types/throttleOption.d.ts +21 -21
  179. package/types/viewHandler.d.ts +13 -13
  180. package/uni-app/ui-canvas.vue +222 -222
package/.editorconfig CHANGED
@@ -1,19 +1,19 @@
1
- # http://editorconfig.org
2
-
3
- root = true
4
-
5
- [*]
6
- charset = utf-8
7
- indent_style = space
8
- indent_size = 4
9
- end_of_line = cr
10
- insert_final_newline = false
11
- trim_trailing_whitespace = true
12
-
13
- [*.md]
14
- insert_final_newline = false
15
- trim_trailing_whitespace = false
16
-
17
- [*.json]
18
- indent_size = 2
1
+ # http://editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ indent_style = space
8
+ indent_size = 4
9
+ end_of_line = cr
10
+ insert_final_newline = false
11
+ trim_trailing_whitespace = true
12
+
13
+ [*.md]
14
+ insert_final_newline = false
15
+ trim_trailing_whitespace = false
16
+
17
+ [*.json]
18
+ indent_size = 2
19
19
  insert_final_newline = true
package/AUTHORS.txt CHANGED
@@ -1,6 +1,6 @@
1
- Authors ordered by first contribution.
2
-
3
- zxl20070701 <1904314465@qq.com> <https://github.com/zxl20070701>
4
-
5
- -----------------------------------------------------
6
- We thank all of them for their contributions!
1
+ Authors ordered by first contribution.
2
+
3
+ zxl20070701 <1904314465@qq.com> <https://github.com/zxl20070701>
4
+
5
+ -----------------------------------------------------
6
+ We thank all of them for their contributions!
package/CHANGELOG CHANGED
@@ -114,3 +114,19 @@ v0.4.1:
114
114
  10、布局
115
115
  * 树布局 treeLayout
116
116
  11、着色器compile方法丰富参数(添加color、colors、image、cube四种内置着色器程序)
117
+ v0.5.0:
118
+ date:2023-10-01
119
+ changes:
120
+ - 修复bug
121
+ 1、SVG画笔
122
+ * 修改文字默认值错误(50恢复成16)
123
+ - 优化改造
124
+ 1、一些types定义优化(比如 Array<number> 改成更具体的 [number, number] 类型)
125
+ - 新增功能
126
+ 1、Geometry 几何体运算
127
+ * cylinder 圆柱体
128
+ * prism 棱柱体
129
+ * sphere 球体
130
+ 2、SVG画笔
131
+ * bind 绑定事件
132
+ 3、布局的bind和use方法新增第二个可选参数noOpens,用于控制结点默认是否闭合
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) zxl20070701 走一步,再走一步
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) zxl20070701 走一步,再走一步
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,69 +1,69 @@
1
- - 开源不易,去 <i>[Github给个Star](https://github.com/oi-contrib/VISLite) </i>吧!
2
-
3
- <img src='./docs/images/logo.png' height='300px'/>
4
-
5
- <p>
6
- <a href="https://zxl20070701.github.io/toolbox/#/npm-download?packages=vislite&interval=7">
7
- <img src="https://img.shields.io/npm/dm/vislite.svg" alt="downloads">
8
- </a>
9
- <a href="https://www.npmjs.com/package/vislite">
10
- <img src="https://img.shields.io/npm/v/vislite.svg" alt="Version">
11
- </a>
12
- <a href="https://github.com/oi-contrib/VISLite" target='_blank'>
13
- <img alt="GitHub repo stars" src="https://img.shields.io/github/stars/oi-contrib/VISLite?style=social">
14
- </a>
15
- </p>
16
-
17
- # VISLite
18
-
19
- ```VISLite```是一个使用```TypeScript```开发的可视化库。官网地址:[https://oi-contrib.github.io/VISLite](https://oi-contrib.github.io/VISLite)
20
-
21
- 主要提供了跨端的画布和计算,开发人员只需要按照文档的描述就可以非常简单的完成包括Web、uni-app、微信小程序等平台的可视化开发,除了必要的初始化差异,主要的业务代码部分不同端完全一致。
22
-
23
- ## 特点
24
-
25
- - 灵活的引入方式:包括npm安装后按照```ES Module```或```CommonJS```规范引入或直接使用script标签的```CDN```方式。
26
- - 按需引入或全局引入:支持源码TS引入、按需JS引入或者全量引入等多种方式。
27
- - 简单与复杂共存:一方面我们提供了可视化需要的基础功能,你可以按照自己的需要组合使用;另一方面,为了加速开发,我们针对常见的可视化业务场景进行了封装,可以帮助你快速完成,你可以根据实际情况进行选择。
28
- - 向下兼容:我们向你保证,始终向下兼容```(alpha和beta版本为测试版本,不包括)```,因此,无论何时,最新版本总是最好的选择。
29
-
30
- > 版本说明:alpha为开发阶段、beta为发布前测试、无后缀的为正式版本。
31
-
32
- ## 需求墙
33
-
34
- 我们的目标是不断完善丰富可视化功能,非常希望获得你宝贵的建议和批评,无论任何想法,都可以给我们[留言](https://github.com/oi-contrib/VISLite/issues)告诉我们。
35
-
36
- 你所提的任何建议我们都会在最长一周内进行反馈说明。
37
-
38
- ## 更新日志
39
-
40
- 详见[正式版更新日志](./CHANGELOG),我们会在每次发布完正式版本后更新其内容。
41
-
42
- ## 下一步
43
-
44
- 我们会在这里列出接下来的工作重心:
45
-
46
- - Canvas、SVG和WebGL画笔功能丰富
47
- - 为加速开发,提供常用坐标系和布局
48
- - 文档优化(提高可读性、丰富用例、补充教程)
49
-
50
- 给我们[留言](https://github.com/oi-contrib/VISLite/issues)告诉我们你希望快速扩展的功能,我们会优先你的建议考虑哦~
51
-
52
- ## 参与贡献
53
-
54
- 你可以选择下列一项或多项进行参与:
55
-
56
- - 代码维护:由于新功能或一些BUG的出现,对代码进行维护和升级。
57
- - 文档编辑:主要是接口文档和教程需要编辑,这很重要。
58
- - 用例开发和测试:在项目的test文件夹下有一些测试,而在docs文档中存在一些例子需要补充。
59
- - 参与讨论:主要是讨论未来如何发展,改造的方向等。
60
-
61
- 如果有意向加入我们,你可以通过提 [issue](https://github.com/oi-contrib/VISLite/issues) 和我们取到联系,请简单说明一下情况,我们会尽快回复。
62
-
63
- 你可以查看[VISLite 贡献指南](./.github/CONTRIBUTING.md)文件了解更多细节,查看[AUTHORS.txt](./AUTHORS.txt)了解所有的贡献者。
64
-
65
- ## 版权
66
-
67
- MIT License
68
-
69
- Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
1
+ - 开源不易,去 <i>[Github给个Star](https://github.com/oi-contrib/VISLite) </i>吧!
2
+
3
+ <img src='https://oi-contrib.github.io/VISLite/images/logo.png' height='300px'/>
4
+
5
+ <p>
6
+ <a href="https://zxl20070701.github.io/toolbox/#/npm-download?packages=vislite&interval=7">
7
+ <img src="https://img.shields.io/npm/dm/vislite.svg" alt="downloads">
8
+ </a>
9
+ <a href="https://www.npmjs.com/package/vislite">
10
+ <img src="https://img.shields.io/npm/v/vislite.svg" alt="Version">
11
+ </a>
12
+ <a href="https://github.com/oi-contrib/VISLite" target='_blank'>
13
+ <img alt="GitHub repo stars" src="https://img.shields.io/github/stars/oi-contrib/VISLite?style=social">
14
+ </a>
15
+ </p>
16
+
17
+ # VISLite
18
+
19
+ ```VISLite```是一个使用```TypeScript```开发的可视化库。官网地址:[https://oi-contrib.github.io/VISLite](https://oi-contrib.github.io/VISLite)
20
+
21
+ 主要提供了跨端的画布和计算,开发人员只需要按照文档的描述就可以非常简单的完成包括Web、uni-app、微信小程序等平台的可视化开发,除了必要的初始化差异,主要的业务代码部分不同端完全一致。
22
+
23
+ ## 特点
24
+
25
+ - 灵活的引入方式:包括npm安装后按照```ES Module```或```CommonJS```规范引入或直接使用script标签的```CDN```方式。
26
+ - 按需引入或全局引入:支持源码TS引入、按需JS引入或者全量引入等多种方式。
27
+ - 简单与复杂共存:一方面我们提供了可视化需要的基础功能,你可以按照自己的需要组合使用;另一方面,为了加速开发,我们针对常见的可视化业务场景进行了封装,可以帮助你快速完成,你可以根据实际情况进行选择。
28
+ - 向下兼容:我们向你保证,始终向下兼容```(alpha和beta版本为测试版本,不包括)```,因此,无论何时,最新版本总是最好的选择。
29
+
30
+ > 版本说明:alpha为开发阶段、beta为发布前测试、无后缀的为正式版本。
31
+
32
+ ## 需求墙
33
+
34
+ 我们的目标是不断完善丰富可视化功能,非常希望获得你宝贵的建议和批评,无论任何想法,都可以给我们[留言](https://github.com/oi-contrib/VISLite/issues)告诉我们。
35
+
36
+ 你所提的任何建议我们都会在最长一周内进行反馈说明。
37
+
38
+ ## 更新日志
39
+
40
+ 详见[正式版更新日志](./CHANGELOG),我们会在每次发布完正式版本后更新其内容。
41
+
42
+ ## 下一步
43
+
44
+ 我们会在这里列出接下来的工作重心:
45
+
46
+ - Canvas、SVG和WebGL画笔功能丰富
47
+ - 为加速开发,提供常用坐标系和布局
48
+ - 文档优化(提高可读性、丰富用例、补充教程)
49
+
50
+ 给我们[留言](https://github.com/oi-contrib/VISLite/issues)告诉我们你希望快速扩展的功能,我们会优先你的建议考虑哦~
51
+
52
+ ## 参与贡献
53
+
54
+ 你可以选择下列一项或多项进行参与:
55
+
56
+ - 代码维护:由于新功能或一些BUG的出现,对代码进行维护和升级。
57
+ - 文档编辑:主要是接口文档和教程需要编辑,这很重要。
58
+ - 用例开发和测试:在项目的test文件夹下有一些测试,而在docs文档中存在一些例子需要补充。
59
+ - 参与讨论:主要是讨论未来如何发展,改造的方向等。
60
+
61
+ 如果有意向加入我们,你可以通过提 [issue](https://github.com/oi-contrib/VISLite/issues) 和我们取到联系,请简单说明一下情况,我们会尽快回复。
62
+
63
+ 你可以查看[VISLite 贡献指南](./.github/CONTRIBUTING.md)文件了解更多细节,查看[AUTHORS.txt](./AUTHORS.txt)了解所有的贡献者。
64
+
65
+ ## 版权
66
+
67
+ MIT License
68
+
69
+ Copyright (c) [zxl20070701](https://zxl20070701.github.io/notebook/home.html) 走一步,再走一步
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";return function(){function t(t,e){void 0===e&&(e=!1),this.__painter=t,this.__isElement=e,this.__buffer=function(t){return t.createBuffer()}(t),this.__type=e?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER}return t.prototype.use=function(){return this.__painter.bindBuffer(this.__type,this.__buffer),this},t.prototype.write=function(t){return function(t,e,i,n){var r=i?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;t.bufferData(r,e,n)}(this.__painter,t,this.__isElement,this.__painter.STATIC_DRAW),this.__fsize=t.BYTES_PER_ELEMENT,this},t.prototype.divide=function(t,e,i,n){return void 0===n&&(n=0),function(t,e,i,n,r,_,f){t.vertexAttribPointer(e,i,n,f,r,_),t.enableVertexAttribArray(e)}(this.__painter,t,e,this.__painter.FLOAT,i*this.__fsize,n*this.__fsize,!1),this},t}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Buffer=e();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,i;t=this,i=function(){"use strict";var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};function i(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}"function"==typeof SuppressedError&&SuppressedError;var e=function(t,i,e,n,r){var o=Math.cos(e),s=Math.sin(e);return[+((n-t)*o-(r-i)*s+t).toFixed(7),+((n-t)*s+(r-i)*o+i).toFixed(7)]},n=function(t,i,e,n,r){return t.beginPath(),t.translate(e,n),t.rotate(r),t.font=i.fontStyle+" "+i.fontWeight+" "+i.fontSize+"px "+i.fontFamily,t},r=function(t,i,n,r,o,s,a,_){if(o>s){var h=o;o=s,s=h}return a%=2*Math.PI,_>=1.999999*Math.PI||_<=1.999999*-Math.PI?_=2*Math.PI:_%=2*Math.PI,function(t,i,n,r,o,s,a){i<0&&(t+=i,i*=-1);var _,h=[];_=e(0,0,t,o,0),h[0]=_[0],h[1]=_[1],_=e(0,0,i,_[0],_[1]),h[2]=_[0],h[3]=_[1],_=e(0,0,t,s,0),h[4]=_[0],h[5]=_[1],_=e(0,0,i,_[0],_[1]),h[6]=_[0],h[7]=_[1],a(t,t+i,h[0]+n,h[1]+r,h[4]+n,h[5]+r,h[2]+n,h[3]+r,h[6]+n,h[7]+r,.5*(s-o))}(a,_,n,r,o,s,(function(e,a,_,h,l,p,u,f,c,g,y){y<0&&(y=-y),t.beginPath(),t.moveTo(_,h),t.arc(n,r,o,e,a,!1),"round"==i.arcEndCap?t.arc(.5*(u+c),.5*(f+g),y,a-Math.PI,a,!0):"-round"==i.arcEndCap?t.arc(.5*(u+c),.5*(f+g),y,a-Math.PI,a,!1):t.lineTo(c,g),t.arc(n,r,s,a,e,!0),"round"==i.arcStartCap?t.arc(.5*(_+l),.5*(h+p),y,e,e-Math.PI,!0):"-round"==i.arcStartCap?t.arc(.5*(_+l),.5*(h+p),y,e,e-Math.PI,!1):t.lineTo(_,h)})),"butt"==i.arcStartCap&&t.closePath(),t},o=function(t,i,e,n){return t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t},s=function(t,i,e,n,r){return t.beginPath(),t.rect(i,e,n,r),t};function a(t,i,e,n,r){for(var o=0,s="",a=0;a<i.length;a++)t.measureText(s+i[a]).width>e||/\n$/.test(s)?(r(s,((o+=1)-.5)*n),s=i[a]):a==i.length-1?(o+=1,r(s+i[a],(o-.5)*n)):s+=i[a];return o*n}var _=function(){function t(t,i,e,n){void 0===i&&(i={}),void 0===n&&(n=!1),this.__region=null,this.__onlyRegion=!1,this.__specialConfig={fontSize:16,fontFamily:"sans-serif",fontWeight:400,fontStyle:"normal",arcStartCap:"butt",arcEndCap:"butt"},this.__initConfig={fillStyle:"black",strokeStyle:"black",lineWidth:1,textAlign:"left",textBaseline:"middle",lineDash:[],shadowBlur:0,shadowColor:"black"},this.painter=t.getContext("2d",i),this.__region=e,this.__isPainter=n,this.painter.textBaseline="middle",this.painter.textAlign="left"}return t.prototype.useConfig=function(t,i){if(this.__region&&["fillStyle","strokeStyle","shadowBlur","shadowColor"].indexOf(t)<0&&this.__region.useConfig(t,i),this.__isPainter&&this.__onlyRegion)return this;if("lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)"fontSize"==t&&(i=Math.round(i)),this.__specialConfig[t]=i;else{if(!(t in this.__initConfig))throw new Error("Illegal configuration item of painter : "+t+" !");this.painter[t]=i}return this},t.prototype.fillText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.fillText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r).fillText(t,0,0),this.painter.restore()),this},t.prototype.strokeText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.strokeText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r).strokeText(t,0,0),this.painter.restore()),this},t.prototype.fullText=function(t,i,e,r){return void 0===r&&(r=0),this.__region&&this.__region.fullText(t,i,e,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),n(this.painter,this.__specialConfig,i,e,r),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore()),this},t.prototype.fillTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.fillText(t,0,i)}));return this.painter.restore(),l},t.prototype.strokeTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.fullTexts=function(t,i,e,r,o,s){var _=this;void 0===o&&(o=1.2),void 0===s&&(s=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,e,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),n(this.painter,this.__specialConfig,i,e,s);var l=a(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){_.painter.fillText(t,0,i),_.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.__isPainter&&this.__onlyRegion||this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.__isPainter&&this.__onlyRegion||this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.moveTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.lineTo=function(t,i){return this.__region&&this.__region.lineTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,n,r){return this.__region&&this.__region.arc(t,i,e,n,r),this.__isPainter&&this.__onlyRegion||this.painter.arc(t,i,e,n,n+r,r<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.__isPainter&&this.__onlyRegion||this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.__isPainter&&this.__onlyRegion||this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.__isPainter&&this.__onlyRegion||(this.painter.fill(),this.painter.stroke()),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.__isPainter&&this.__onlyRegion||this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.__isPainter&&this.__onlyRegion||this.painter.restore(),this},t.prototype.clip=function(){return this.__region&&this.__region.clip(),this.__isPainter&&this.__onlyRegion||this.painter.clip(),this},t.prototype.quadraticCurveTo=function(t,i,e,n){return this.__region&&this.__region.quadraticCurveTo(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.quadraticCurveTo(t,i,e,n),this},t.prototype.bezierCurveTo=function(t,i,e,n,r,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,n,r,o),this.__isPainter&&this.__onlyRegion||this.painter.bezierCurveTo(t,i,e,n,r,o),this},t.prototype.clearRect=function(t,i,e,n){return this.__region&&this.__region.clearRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.clearRect(t,i,e,n),this},t.prototype.fillArc=function(t,i,e,n,o,s){return this.__region&&this.__region.fillArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||r(this.painter,this.__specialConfig,t,i,e,n,o,s).fill(),this},t.prototype.strokeArc=function(t,i,e,n,o,s){return this.__region&&this.__region.strokeArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||r(this.painter,this.__specialConfig,t,i,e,n,o,s).stroke(),this},t.prototype.fullArc=function(t,i,e,n,o,s){return this.__region&&this.__region.fullArc(t,i,e,n,o,s),this.__isPainter&&this.__onlyRegion||(r(this.painter,this.__specialConfig,t,i,e,n,o,s),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillCircle=function(t,i,e){return this.__region&&this.__region.fillCircle(t,i,e),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),this.__isPainter&&this.__onlyRegion||(o(this.painter,t,i,e),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillRect=function(t,i,e,n){return this.__region&&this.__region.fillRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||s(this.painter,t,i,e,n).fill(),this},t.prototype.strokeRect=function(t,i,e,n){return this.__region&&this.__region.strokeRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||s(this.painter,t,i,e,n).stroke(),this},t.prototype.fullRect=function(t,i,e,n){return this.__region&&this.__region.fullRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||(s(this.painter,t,i,e,n),this.painter.fill(),this.painter.stroke()),this},t.prototype.draw=function(){},t}(),h={"font-size":"fontSize","font-family":"fontFamily","font-weight":"fontWeight","font-style":"fontStyle","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},l=function(t){function e(i,e){var n=t.call(this,i,{},e?new _(e,{willReadFrequently:!0}):null,!0)||this;return n.name="Canvas",n.__regionList={},n.__regionAssemble=function(t,i,e,n){for(var r=[],o=0;o<n;o++)r[o]=t;return function(){for(var o=0;o<n;o++){if(r[o]+e<i){r[o]=+(r[o]+e).toFixed(7);break}o<n-1&&(r[o]=t)}return r}}(0,255,10,3),n.setRegion(""),n}return i(e,t),e.prototype.config=function(t){for(var i in t){var e=h[i]||i;this.useConfig(e,t[i])}return this},e.prototype.onlyRegion=function(t){return this.__onlyRegion=t,this},e.prototype.setRegion=function(t){if(this.__region)if(t){if(null==this.__regionList[t]){var i=this.__regionAssemble();this.__regionList[t]="rgb("+i[0]+","+i[1]+","+i[2]+")"}this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])}else this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000");return this},e.prototype.getRegion=function(t,i){var e=this;return new Promise((function(n,r){var o=e.__region?e.__region.painter.getImageData(t-.5,i-.5,1,1):{data:[0,0,0,0]},s=o.data,a=function(){if(e.__region)for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){n(t);break}n("")};s?a():o.then((function(t){s=t,a()}))}))},e.prototype.textWidth=function(t){this.painter.save(),n(this.painter,this.__specialConfig,0,0,0);var i=this.painter.measureText(t+"").width;return this.painter.restore(),i},e.prototype.getContext=function(t){return void 0===t&&(t=!1),t?this.__region?this.__region.painter:null:this.painter},e.prototype.createLinearGradient=function(t,i,e,n){return function(t,i,e,n,r){var o=t.createLinearGradient(i,e,n,r),s={value:function(){return o},setColor:function(t,i){return o.addColorStop(t,i),s}};return s}(this.painter,t,i,e,n)},e.prototype.createRadialGradient=function(t,i,e){return function(t,i,e,n){var r=t.createRadialGradient(i,e,0,i,e,n),o={value:function(){return r},setColor:function(t,i){return r.addColorStop(t,i),o}};return o}(this.painter,t,i,e)},e.prototype.getColor=function(t,i){var e=this.painter.getImageData(t-.5,i-.5,1,1).data;return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},e}(_);return function(t){function e(i,e){void 0===e&&(e={});var n=this;if(!i)throw new Error("VISLite Canvas:The mount point requires an HTMLElement type but encountered null.");e=function(t,i){for(var e in t)i[e]=t[e];return i}(e,{region:!0});var r,o,s=i.clientWidth,a=i.clientHeight,_=i;_._vislite_canvas_?(r=_._vislite_canvas_[0],o=_._vislite_canvas_[1]):(r=document.createElement("canvas"),i.appendChild(r),e.region&&(o=document.createElement("canvas")),_._vislite_canvas_=[r,o],i.setAttribute("vislite","Canvas"));for(var h=0,l=[r,o];h<l.length;h++){var p=l[h];p&&(p.style.width=s+"px",p.setAttribute("width",s+""),p.style.height=a+"px",p.setAttribute("height",a+""))}return(n=t.call(this,r,o)||this).__canvas=r,n}return i(e,t),e.prototype.toDataURL=function(){var t=this;return new Promise((function(i){i(t.__canvas.toDataURL())}))},e}(l)},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Canvas=i();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,i;t=this,i=function(){"use strict";var t=function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,i,_,h,s,e){if(!(t<_))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=_;var n=this.__u*s,o=this.__u*e;return i/=_-t,h/=_-t,this.__MR=[2*i-2*h+n+o,3*h-3*i-2*n-o,n,i],this},t.prototype.use=function(t){if(this.__MR){var i=(t-this.__a)/(this.__b-this.__a),_=i*i;return(i*_*this.__MR[0]+_*this.__MR[1]+i*this.__MR[2]+this.__MR[3])*(this.__b-this.__a)}throw new Error("You shoud first set the position!")},t}();return function(){function i(t){void 0===t&&(t=0),this.name="Cardinal",this.__t=t}return i.prototype.setP=function(i){this.__HS={x:[],h:[]};var _,h,s=(i[1][1]-i[0][1])/(i[1][0]-i[0][0]);for(this.__HS.x[0]=i[0][0],_=1;_<i.length;_++){if(i[_][0]<=i[_-1][0])throw new Error("The point position should be increamented!");this.__HS.x[_]=i[_][0],h=_<i.length-1?i[_+1][1]>i[_][1]&&i[_-1][1]>i[_][1]||i[_+1][1]<i[_][1]&&i[_-1][1]<i[_][1]||i[_+1][1]==i[_][1]||i[_-1][1]==i[_][1]?0:(i[_+1][1]-i[_-1][1])/(i[_+1][0]-i[_-1][0]):(i[_][1]-i[_-1][1])/(i[_][0]-i[_-1][0]),this.__HS.h[_-1]=new t(.5*(1-this.__t)).setP(i[_-1][0],i[_-1][1],i[_][0],i[_][1],s,h),s=h}return this},i.prototype.use=function(t){if(this.__HS){for(this.__i=-1;this.__i+1<this.__HS.x.length&&(t>this.__HS.x[this.__i+1]||-1==this.__i&&t>=this.__HS.x[this.__i+1]);)this.__i+=1;return this.__i<0?this.__HS.h[0].use(this.__HS.x[0]):this.__i>=this.__HS.h.length?this.__HS.h[this.__HS.h.length-1].use(this.__HS.x[this.__HS.x.length-1]):this.__HS.h[this.__i].use(t)}throw new Error("You shoud first set the position!")},i}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Cardinal=i();
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  (function (global, factory) {
12
12
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * VISLite JavaScript Library v0.4.1
2
+ * VISLite JavaScript Library v0.5.0
3
3
  * git+https://github.com/oi-contrib/VISLite.git
4
4
  *
5
5
  * Copyright zxl20070701
6
6
  * Released under the MIT license
7
7
  * https://zxl20070701.github.io/notebook/home.html
8
- *
9
- * Publish Date: Sun Sep 03 2023 00:05:54 GMT+0800 (中国标准时间)
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
10
  */
11
11
  var t,e;t=this,e=function(){"use strict";var t=function(t,e,n,i){var o=Math.cos(t),a=Math.sin(t);return[e*o-n*a,e*a+n*o,i]};return function(){function e(t,e){void 0===t&&(t=7),void 0===e&&(e=[107,36]),this.name="Eoap",this.__scale=t,this.__center=e}return e.prototype.use=function(e,n){var i,o,a,s,r,h,u=(i=(360-n)/180*Math.PI,o=100*this.__scale,a=0,s=0,r=Math.cos(i),h=Math.sin(i),[s*h+o*r,a,s*r-o*h]);return u=t(e/180*Math.PI,u[0],u[1],u[2]),u=t((90-this.__center[0])/180*Math.PI,u[0],u[1],u[2]),u=function(t,e,n,i){var o=Math.cos(t),a=Math.sin(t);return[e,n*o-i*a,n*a+i*o]}((90-this.__center[1])/180*Math.PI,u[0],u[1],u[2]),[-u[0],u[1],u[2]]},e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Eoap=e();
@@ -0,0 +1,205 @@
1
+ /*!
2
+ * VISLite JavaScript Library v0.5.0
3
+ * git+https://github.com/oi-contrib/VISLite.git
4
+ *
5
+ * Copyright zxl20070701
6
+ * Released under the MIT license
7
+ * https://zxl20070701.github.io/notebook/home.html
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
+ */
11
+ (function (global, factory) {
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
13
+ typeof define === 'function' && define.amd ? define(factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VISLite_Geometry = factory());
15
+ })(this, (function () { 'use strict';
16
+
17
+ var splitNum = function (precision, radius) {
18
+ var num = Math.ceil(Math.PI * 2 /
19
+ Math.asin(precision / radius) * 2);
20
+ return (isNaN(num) || num < 12) ? 12 : num;
21
+ };
22
+
23
+ function rotate (cx, cy, deg, x, y) {
24
+ var cos = Math.cos(deg), sin = Math.sin(deg);
25
+ return [
26
+ (x - cx) * cos - (y - cy) * sin + cx,
27
+ (x - cx) * sin + (y - cy) * cos + cy
28
+ ];
29
+ }
30
+
31
+ function prismHorizontal (normal, x, y, z, radius, num, d) {
32
+ var beginX, beginZ;
33
+ if (num == 4) {
34
+ var temp = radius / 1.414;
35
+ beginX = x + temp;
36
+ beginZ = z + temp;
37
+ }
38
+ else {
39
+ beginX = x + radius;
40
+ beginZ = z;
41
+ }
42
+ var point = [beginX, beginZ], points = [], deg = Math.PI * 2 / num;
43
+ for (var i = 0; i < num; i++) {
44
+ points.push(x, y, z);
45
+ if (normal)
46
+ points.push(0, d, 0);
47
+ points.push(point[0], y, point[1]);
48
+ if (normal)
49
+ points.push(0, d, 0);
50
+ point = rotate(x, z, deg * (i + 1), beginX, beginZ);
51
+ points.push(point[0], y, point[1]);
52
+ if (normal)
53
+ points.push(0, d, 0);
54
+ }
55
+ return points;
56
+ }
57
+
58
+ /******************************************************************************
59
+ Copyright (c) Microsoft Corporation.
60
+
61
+ Permission to use, copy, modify, and/or distribute this software for any
62
+ purpose with or without fee is hereby granted.
63
+
64
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
65
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
66
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
67
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
68
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
69
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
70
+ PERFORMANCE OF THIS SOFTWARE.
71
+ ***************************************************************************** */
72
+ /* global Reflect, Promise, SuppressedError, Symbol */
73
+
74
+
75
+ function __spreadArray(to, from, pack) {
76
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
77
+ if (ar || !(i in from)) {
78
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
79
+ ar[i] = from[i];
80
+ }
81
+ }
82
+ return to.concat(ar || Array.prototype.slice.call(from));
83
+ }
84
+
85
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
86
+ var e = new Error(message);
87
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
88
+ };
89
+
90
+ function prismVertical (normal, x, y, z, radius, height, num) {
91
+ var points = [];
92
+ var beginPosition;
93
+ if (num == 4) {
94
+ beginPosition = rotate(x, z, Math.PI * 0.25, x - radius, z);
95
+ }
96
+ else {
97
+ beginPosition = [x + radius, z];
98
+ }
99
+ var deg = Math.PI * 2 / num, degHalf = Math.PI * 2 / (num * 2);
100
+ var endPosition, normalPosition = [];
101
+ for (var i = 0; i < num; i++) {
102
+ endPosition = rotate.apply(void 0, __spreadArray([x, z, deg], beginPosition, false));
103
+ if (normal) {
104
+ var halfPosition = rotate.apply(void 0, __spreadArray([x, z, degHalf], beginPosition, false));
105
+ normalPosition = [halfPosition[0], 0, halfPosition[1]];
106
+ }
107
+ points.push.apply(points, __spreadArray([beginPosition[0], y, beginPosition[1]], normalPosition, false));
108
+ points.push.apply(points, __spreadArray([beginPosition[0], y + height, beginPosition[1]], normalPosition, false));
109
+ points.push.apply(points, __spreadArray([endPosition[0], y + height, endPosition[1]], normalPosition, false));
110
+ points.push.apply(points, __spreadArray([beginPosition[0], y, beginPosition[1]], normalPosition, false));
111
+ points.push.apply(points, __spreadArray([endPosition[0], y, endPosition[1]], normalPosition, false));
112
+ points.push.apply(points, __spreadArray([endPosition[0], y + height, endPosition[1]], normalPosition, false));
113
+ beginPosition = endPosition;
114
+ }
115
+ return points;
116
+ }
117
+
118
+ function sphereFragment (normal, cx, cy, cz, radius, num, index) {
119
+ var points = [cx, cy + radius, cz], deg = Math.PI * 2 / num, point;
120
+ if (normal)
121
+ points.push(0, radius, 0);
122
+ var copy2 = function () {
123
+ points.push.apply(points, points.slice(points.length - (normal ? 12 : 6)));
124
+ };
125
+ for (var i = 1; i < num * 0.5; i++) {
126
+ point = rotate(cx, cy, deg * i, cx, cy + radius);
127
+ if (i > 1)
128
+ copy2();
129
+ var point1 = rotate(cx, cz, deg * index, point[0], cz);
130
+ points.push(point1[0], point[1], point1[1]);
131
+ if (normal)
132
+ points.push(point1[0] - cx, point[1] - cy, point1[1] - cz);
133
+ if (i > 1)
134
+ copy2();
135
+ var point2 = rotate(cx, cz, deg * (index + 1), point[0], cz);
136
+ points.push(point2[0], point[1], point2[1]);
137
+ if (normal)
138
+ points.push(point2[0] - cx, point2[1] - cy, point2[1] - cz);
139
+ }
140
+ copy2();
141
+ points.push(cx, cy - radius, cz);
142
+ if (normal)
143
+ points.push(0, -radius, 0);
144
+ return points;
145
+ }
146
+
147
+ function mergeOption (option, defaultOption) {
148
+ for (var key in option) {
149
+ defaultOption[key] = option[key];
150
+ }
151
+ return defaultOption;
152
+ }
153
+
154
+ var Geometry = (function () {
155
+ function Geometry(option) {
156
+ if (option === void 0) { option = {}; }
157
+ this.name = 'Geometry';
158
+ this.__option = mergeOption(option, {
159
+ precision: 0.1,
160
+ normal: false,
161
+ });
162
+ }
163
+ Geometry.prototype.config = function (option) {
164
+ for (var key in option) {
165
+ this.__option[key] = option[key];
166
+ }
167
+ return this;
168
+ };
169
+ Geometry.prototype.cylinder = function (x, y, z, radius, height) {
170
+ var num = splitNum(this.__option.precision, radius);
171
+ return this.prism(x, y, z, radius, height, num);
172
+ };
173
+ Geometry.prototype.prism = function (x, y, z, radius, height, num) {
174
+ var _a, _b, _c;
175
+ var result = [{
176
+ points: [],
177
+ length: 0,
178
+ method: "TRIANGLES"
179
+ }];
180
+ (_a = result[0].points).push.apply(_a, prismHorizontal(this.__option.normal, x, y, z, radius, num, height > 0 ? -1 : 1));
181
+ (_b = result[0].points).push.apply(_b, prismHorizontal(this.__option.normal, x, y + height, z, radius, num, height > 0 ? 1 : -1));
182
+ (_c = result[0].points).push.apply(_c, prismVertical(this.__option.normal, x, y, z, radius, height, num));
183
+ result[0].length = 12 * num;
184
+ return result;
185
+ };
186
+ Geometry.prototype.sphere = function (cx, cy, cz, radius) {
187
+ var _a;
188
+ var num = splitNum(this.__option.precision, radius);
189
+ var result = [{
190
+ points: [],
191
+ length: 0,
192
+ method: "TRIANGLES"
193
+ }];
194
+ for (var i = 0; i < num; i++) {
195
+ (_a = result[0].points).push.apply(_a, sphereFragment(this.__option.normal, cx, cy, cz, radius, num, i));
196
+ }
197
+ result[0].length = result[0].points.length / (this.__option.normal ? 6 : 3);
198
+ return result;
199
+ };
200
+ return Geometry;
201
+ }());
202
+
203
+ return Geometry;
204
+
205
+ }));
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * VISLite JavaScript Library v0.5.0
3
+ * git+https://github.com/oi-contrib/VISLite.git
4
+ *
5
+ * Copyright zxl20070701
6
+ * Released under the MIT license
7
+ * https://zxl20070701.github.io/notebook/home.html
8
+ *
9
+ * Publish Date: Sat Sep 30 2023 19:14:04 GMT+0800 (中国标准时间)
10
+ */
11
+ var t,n;t=this,n=function(){"use strict";var t=function(t,n){var p=Math.ceil(2*Math.PI/Math.asin(t/n)*2);return isNaN(p)||p<12?12:p};function n(t,n,p,o,r){var i=Math.cos(p),e=Math.sin(p);return[(o-t)*i-(r-n)*e+t,(o-t)*e+(r-n)*i+n]}function p(t,p,o,r,i,e,s){var u,a;if(4==e){var h=i/1.414;u=p+h,a=r+h}else u=p+i,a=r;for(var l=[u,a],f=[],c=2*Math.PI/e,y=0;y<e;y++)f.push(p,o,r),t&&f.push(0,s,0),f.push(l[0],o,l[1]),t&&f.push(0,s,0),l=n(p,r,c*(y+1),u,a),f.push(l[0],o,l[1]),t&&f.push(0,s,0);return f}function o(t,n,p){if(p||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))}function r(t,p,o,r,i,e,s){var u,a=[p,o+i,r],h=2*Math.PI/e;t&&a.push(0,i,0);for(var l=function(){a.push.apply(a,a.slice(a.length-(t?12:6)))},f=1;f<.5*e;f++){u=n(p,o,h*f,p,o+i),f>1&&l();var c=n(p,r,h*s,u[0],r);a.push(c[0],u[1],c[1]),t&&a.push(c[0]-p,u[1]-o,c[1]-r),f>1&&l();var y=n(p,r,h*(s+1),u[0],r);a.push(y[0],u[1],y[1]),t&&a.push(y[0]-p,y[1]-o,y[1]-r)}return l(),a.push(p,o-i,r),t&&a.push(0,-i,0),a}return"function"==typeof SuppressedError&&SuppressedError,function(){function i(t){void 0===t&&(t={}),this.name="Geometry",this.__option=function(t,n){for(var p in t)n[p]=t[p];return n}(t,{precision:.1,normal:!1})}return i.prototype.config=function(t){for(var n in t)this.__option[n]=t[n];return this},i.prototype.cylinder=function(n,p,o,r,i){var e=t(this.__option.precision,r);return this.prism(n,p,o,r,i,e)},i.prototype.prism=function(t,r,i,e,s,u){var a,h,l,f=[{points:[],length:0,method:"TRIANGLES"}];return(a=f[0].points).push.apply(a,p(this.__option.normal,t,r,i,e,u,s>0?-1:1)),(h=f[0].points).push.apply(h,p(this.__option.normal,t,r+s,i,e,u,s>0?1:-1)),(l=f[0].points).push.apply(l,function(t,p,r,i,e,s,u){var a,h=[];a=4==u?n(p,i,.25*Math.PI,p-e,i):[p+e,i];for(var l,f=2*Math.PI/u,c=2*Math.PI/(2*u),y=[],v=0;v<u;v++){if(l=n.apply(void 0,o([p,i,f],a,!1)),t){var _=n.apply(void 0,o([p,i,c],a,!1));y=[_[0],0,_[1]]}h.push.apply(h,o([a[0],r,a[1]],y,!1)),h.push.apply(h,o([a[0],r+s,a[1]],y,!1)),h.push.apply(h,o([l[0],r+s,l[1]],y,!1)),h.push.apply(h,o([a[0],r,a[1]],y,!1)),h.push.apply(h,o([l[0],r,l[1]],y,!1)),h.push.apply(h,o([l[0],r+s,l[1]],y,!1)),a=l}return h}(this.__option.normal,t,r,i,e,s,u)),f[0].length=12*u,f},i.prototype.sphere=function(n,p,o,i){for(var e,s=t(this.__option.precision,i),u=[{points:[],length:0,method:"TRIANGLES"}],a=0;a<s;a++)(e=u[0].points).push.apply(e,r(this.__option.normal,n,p,o,i,s,a));return u[0].length=u[0].points.length/(this.__option.normal?6:3),u},i}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).VISLite_Geometry=n();