@visactor/vrender-kits 0.22.0 → 0.22.2

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 (44) hide show
  1. package/cjs/canvas/contributions/browser/context.js +1 -2
  2. package/cjs/canvas/contributions/browser/context.js.map +1 -1
  3. package/cjs/canvas/contributions/modules.js +1 -2
  4. package/cjs/env/contributions/browser-contribution.js +2 -1
  5. package/cjs/env/contributions/taro-contribution.js +1 -1
  6. package/cjs/index.d.ts +1 -0
  7. package/cjs/index.js +1 -1
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/picker/contributions/canvas-picker/image-picker.d.ts +5 -4
  10. package/cjs/picker/contributions/canvas-picker/image-picker.js +12 -9
  11. package/cjs/picker/contributions/canvas-picker/image-picker.js.map +1 -1
  12. package/cjs/picker/contributions/common/base.js +5 -5
  13. package/cjs/picker/contributions/common/base.js.map +1 -1
  14. package/cjs/tools/dynamicTexture/effect.d.ts +21 -0
  15. package/cjs/tools/dynamicTexture/effect.js +121 -0
  16. package/cjs/tools/dynamicTexture/effect.js.map +1 -0
  17. package/cjs/tools/dynamicTexture.d.ts +1 -0
  18. package/cjs/tools/dynamicTexture.js +1 -0
  19. package/cjs/tools/dynamicTexture.js.map +1 -0
  20. package/cjs/window/contributions/node-contribution.js +5 -4
  21. package/cjs/window/contributions/node-contribution.js.map +1 -1
  22. package/dist/index.es.js +183 -28
  23. package/es/canvas/contributions/browser/context.js +1 -2
  24. package/es/canvas/contributions/browser/context.js.map +1 -1
  25. package/es/canvas/contributions/modules.js +1 -2
  26. package/es/env/contributions/browser-contribution.js +2 -1
  27. package/es/env/contributions/taro-contribution.js +1 -1
  28. package/es/index.d.ts +1 -0
  29. package/es/index.js +2 -0
  30. package/es/index.js.map +1 -1
  31. package/es/picker/contributions/canvas-picker/image-picker.d.ts +5 -4
  32. package/es/picker/contributions/canvas-picker/image-picker.js +13 -9
  33. package/es/picker/contributions/canvas-picker/image-picker.js.map +1 -1
  34. package/es/picker/contributions/common/base.js +5 -5
  35. package/es/picker/contributions/common/base.js.map +1 -1
  36. package/es/tools/dynamicTexture/effect.d.ts +21 -0
  37. package/es/tools/dynamicTexture/effect.js +106 -0
  38. package/es/tools/dynamicTexture/effect.js.map +1 -0
  39. package/es/tools/dynamicTexture.d.ts +1 -0
  40. package/es/tools/dynamicTexture.js +1 -0
  41. package/es/tools/dynamicTexture.js.map +1 -0
  42. package/es/window/contributions/node-contribution.js +5 -4
  43. package/es/window/contributions/node-contribution.js.map +1 -1
  44. package/package.json +2 -2
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
4
+ graphic.dynamicTextureCache || (graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map((item => 2 * Math.random() * Math.PI)));
5
+ const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column], _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
6
+ return Math.min(1, Math.max(0, _r));
7
+ }
8
+
9
+ function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10
+ const delay = column / columnCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
11
+ return Math.min(1, Math.max(0, _r));
12
+ }
13
+
14
+ function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
15
+ const delay = (columnCount - 1 - column) / columnCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
16
+ return Math.min(1, Math.max(0, _r));
17
+ }
18
+
19
+ function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
20
+ const delay = row / rowCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
21
+ return Math.min(1, Math.max(0, _r));
22
+ }
23
+
24
+ function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
25
+ const delay = (rowCount - 1 - row) / rowCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
26
+ return Math.min(1, Math.max(0, _r));
27
+ }
28
+
29
+ function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
30
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
31
+ return Math.min(1, Math.max(0, _r));
32
+ }
33
+
34
+ function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
35
+ const delay = (row / rowCount + column / columnCount) / 2, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
36
+ return Math.min(1, Math.max(0, _r));
37
+ }
38
+
39
+ function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
40
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, angle = Math.atan2(row - centerRow, column - centerCol), delay = (angle < 0 ? angle + 2 * Math.PI : angle) / (2 * Math.PI), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
41
+ return Math.min(1, Math.max(0, _r));
42
+ }
43
+
44
+ function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
45
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, normalizedDistance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2)) / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2)), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI * 3 - 2 * normalizedDistance * Math.PI) + 1) / 2;
46
+ return Math.min(1, Math.max(0, _r));
47
+ }
48
+
49
+ function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
50
+ const delay = (row + column) % (rowCount + columnCount) / (rowCount + columnCount), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
51
+ return Math.min(1, Math.max(0, _r));
52
+ }
53
+
54
+ function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
55
+ const rowPhase = row / rowCount, colPhase = column / columnCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * rowPhase * Math.PI) * Math.sin(2 * ratio * Math.PI - 2 * colPhase * Math.PI) + 1) / 2;
56
+ return Math.min(1, Math.max(0, _r));
57
+ }
58
+
59
+ function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
60
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2)), angle = Math.atan2(row - centerRow, column - centerCol), delay = (distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2)) + angle / (2 * Math.PI)) / 2, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
61
+ return Math.min(1, Math.max(0, _r));
62
+ }
63
+
64
+ function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
65
+ const centerCol = columnCount / 2, distance = Math.abs(column - centerCol) / centerCol, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
66
+ return Math.min(1, Math.max(0, _r));
67
+ }
68
+
69
+ function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
70
+ const centerCol = columnCount / 2, distance = 1 - Math.abs(column - centerCol) / centerCol, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
71
+ return Math.min(1, Math.max(0, _r));
72
+ }
73
+
74
+ function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
75
+ const centerRow = rowCount / 2, distance = Math.abs(row - centerRow) / centerRow, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
76
+ return Math.min(1, Math.max(0, _r));
77
+ }
78
+
79
+ function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
80
+ const centerRow = rowCount / 2, distance = 1 - Math.abs(row - centerRow) / centerRow, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
81
+ return Math.min(1, Math.max(0, _r));
82
+ }
83
+
84
+ function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
85
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)), normalizedDistance = Math.min(distance, 1), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
86
+ return Math.min(1, Math.max(0, _r));
87
+ }
88
+
89
+ function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
90
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)), normalizedDistance = 1 - Math.min(distance, 1), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
91
+ return Math.min(1, Math.max(0, _r));
92
+ }
93
+
94
+ function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
95
+ const centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)), normalizedDistance = Math.min(distance, 1), wavePhase = 2 * ratio * Math.PI * 3, decay = Math.max(0, 1 - normalizedDistance), _r = minRatio + amplitude * ((Math.sin(wavePhase - 4 * normalizedDistance * Math.PI) + 1) / 2) * (.7 * decay + .3);
96
+ return Math.min(1, Math.max(0, _r));
97
+ }
98
+
99
+ function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
100
+ graphic.dynamicTextureCache || (graphic.dynamicTextureCache = {
101
+ phases: new Array(rowCount * columnCount).fill(0).map((() => 2 * Math.random() * Math.PI)),
102
+ speeds: new Array(rowCount * columnCount).fill(0).map((() => .5 + .5 * Math.random())),
103
+ directions: new Array(rowCount * columnCount).fill(0).map((() => 2 * Math.random() * Math.PI))
104
+ });
105
+ const index = row * columnCount + column, phase = graphic.dynamicTextureCache.phases[index], speed = graphic.dynamicTextureCache.speeds[index], direction = graphic.dynamicTextureCache.directions[index], centerRow = rowCount / 2, centerCol = columnCount / 2, distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)), normalizedDistance = Math.min(distance, 1), scatterRatio = (ratio - .4) / .6, movement = Math.sin(scatterRatio * speed * 8 * Math.PI + phase + direction * scatterRatio), distanceEffect = Math.cos(normalizedDistance * Math.PI + scatterRatio * Math.PI), _r = minRatio + amplitude * ((movement + 1) / 2 * Math.max(0, 1 - 1.2 * scatterRatio) * (.3 + .7 * distanceEffect));
106
+ return Math.min(1, Math.max(0, _r));
107
+ }
108
+
109
+ Object.defineProperty(exports, "__esModule", {
110
+ value: !0
111
+ }), exports.particleEffect = exports.pulseWave = exports.centerToCorner = exports.cornerToCenter = exports.rowEdgeToCenter = exports.rowCenterToEdge = exports.columnEdgeToCenter = exports.columnCenterToEdge = exports.spiralEffect = exports.alternatingWave = exports.snakeWave = exports.rippleEffect = exports.rotationScan = exports.diagonalTopLeftToBottomRight = exports.diagonalCenterToEdge = exports.rowBottomToTop = exports.rowTopToBottom = exports.columnRightToLeft = exports.columnLeftToRight = exports.randomOpacity = void 0,
112
+ exports.randomOpacity = randomOpacity, exports.columnLeftToRight = columnLeftToRight,
113
+ exports.columnRightToLeft = columnRightToLeft, exports.rowTopToBottom = rowTopToBottom,
114
+ exports.rowBottomToTop = rowBottomToTop, exports.diagonalCenterToEdge = diagonalCenterToEdge,
115
+ exports.diagonalTopLeftToBottomRight = diagonalTopLeftToBottomRight, exports.rotationScan = rotationScan,
116
+ exports.rippleEffect = rippleEffect, exports.snakeWave = snakeWave, exports.alternatingWave = alternatingWave,
117
+ exports.spiralEffect = spiralEffect, exports.columnCenterToEdge = columnCenterToEdge,
118
+ exports.columnEdgeToCenter = columnEdgeToCenter, exports.rowCenterToEdge = rowCenterToEdge,
119
+ exports.rowEdgeToCenter = rowEdgeToCenter, exports.cornerToCenter = cornerToCenter,
120
+ exports.centerToCorner = centerToCorner, exports.pulseWave = pulseWave, exports.particleEffect = particleEffect;
121
+ //# sourceMappingURL=effect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/dynamicTexture/effect.ts"],"names":[],"mappings":";;;AAEA,SAAgB,aAAa,CAC3B,GAAe,EACf,GAAW,EACX,MAAc,EACd,QAAgB,EAChB,WAAmB,EACnB,KAAa,EACb,OAAiB,EACjB,WAAmB,CAAC,EACpB,YAAoB,CAAC;IAErB,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE;QAChC,OAAO,CAAC,mBAAmB,GAAG,IAAI,KAAK,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAA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G,GAAG,CAAC,GAAG,GAAG,CAAC;IAEzC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC;IAEjG,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,kBAAkB,GAAG,IAAI,CAAC,EAAE,GAAG,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAEvF,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,YAAY,GAAG,GAAG,CAAC,CAAC;IAGlD,MAAM,UAAU,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,cAAc,CAAC,CAAC;IAC/E,MAAM,EAAE,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AA9CD,wCA8CC","file":"effect.js","sourcesContent":["import type { IContext2d, IGraphic } from '@visactor/vrender-core';\n\nexport function randomOpacity(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0, // 最小ratio值,默认为0\n amplitude: number = 1 // 变化幅度,默认为1\n): number {\n if (!graphic.dynamicTextureCache) {\n graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => Math.random() * 2 * Math.PI);\n }\n const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column];\n // 调整sin函数的振幅,并将结果映射到[minRatio, minRatio + amplitude]范围\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI + targetRandomValue) + 1)) / 2;\n return Math.min(1, Math.max(0, _r)); // 确保返回值在[0,1]范围内\n}\n\n// 从左到右的列式渐变\nexport function columnLeftToRight(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const delay = column / columnCount;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从右到左的列式渐变\nexport function columnRightToLeft(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const delay = (columnCount - 1 - column) / columnCount;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从上到下的行式渐变\nexport function rowTopToBottom(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const delay = row / rowCount;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从下到上的行式渐变\nexport function rowBottomToTop(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const delay = (rowCount - 1 - row) / rowCount;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从中心向两边的对角线渐变\nexport function diagonalCenterToEdge(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n const distance = Math.sqrt(\n Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)\n );\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从左上角到右下角的对角线渐变\nexport function diagonalTopLeftToBottomRight(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const delay = (row / rowCount + column / columnCount) / 2;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 旋转扫描效果\nexport function rotationScan(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n // 计算当前点相对于中心点的角度\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n const angle = Math.atan2(row - centerRow, column - centerCol);\n // 将角度归一化到 [0, 2π]\n const normalizedAngle = angle < 0 ? angle + 2 * Math.PI : angle;\n // 计算扫描延迟\n const delay = normalizedAngle / (2 * Math.PI);\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 波纹扩散效果\nexport function rippleEffect(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n // 计算到中心的距离\n const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n // 归一化距离\n const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n // 创建多个波纹\n const waves = 3;\n const _r =\n minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI * waves - normalizedDistance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 蛇形波动效果\nexport function snakeWave(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n // 使用行和列的位置创建蛇形路径\n const delay = ((row + column) % (rowCount + columnCount)) / (rowCount + columnCount);\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 交错波纹效果\nexport function alternatingWave(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n // 行和列的交错波纹\n const rowPhase = row / rowCount;\n const colPhase = column / columnCount;\n const _r =\n minRatio +\n (amplitude *\n (Math.sin(ratio * 2 * Math.PI - rowPhase * 2 * Math.PI) * Math.sin(ratio * 2 * Math.PI - colPhase * 2 * Math.PI) +\n 1)) /\n 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 螺旋效果\nexport function spiralEffect(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n // 计算到中心的距离和角度\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n const angle = Math.atan2(row - centerRow, column - centerCol);\n // 归一化距离\n const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n // 组合距离和角度创建螺旋效果\n const delay = (normalizedDistance + angle / (2 * Math.PI)) / 2;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从两边向中间的列式渐变\nexport function columnCenterToEdge(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerCol = columnCount / 2;\n // 计算到中心的距离,并归一化到[0,1]区间\n const distance = Math.abs(column - centerCol) / centerCol;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从中间向两边的列式渐变\nexport function columnEdgeToCenter(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerCol = columnCount / 2;\n // 计算到中心的距离,并归一化到[0,1]区间,然后用1减去它来反转延迟\n const distance = 1 - Math.abs(column - centerCol) / centerCol;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从上下向中间的行式渐变\nexport function rowCenterToEdge(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n // 计算到中心的距离,并归一化到[0,1]区间\n const distance = Math.abs(row - centerRow) / centerRow;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从中间向上下的行式渐变\nexport function rowEdgeToCenter(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n // 计算到中心的距离,并归一化到[0,1]区间,然后用1减去它来反转延迟\n const distance = 1 - Math.abs(row - centerRow) / centerRow;\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从四个角向中心的渐变\nexport function cornerToCenter(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n // 计算到中心的距离,使用欧几里得距离\n const distance = Math.sqrt(\n Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)\n );\n // 归一化到[0,1]区间\n const normalizedDistance = Math.min(distance, 1);\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - normalizedDistance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 从中心向四个角的渐变\nexport function centerToCorner(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n // 计算到中心的距离,使用欧几里得距离\n const distance = Math.sqrt(\n Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)\n );\n // 归一化到[0,1]区间并反转\n const normalizedDistance = 1 - Math.min(distance, 1);\n const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - normalizedDistance * 2 * Math.PI) + 1)) / 2;\n return Math.min(1, Math.max(0, _r));\n}\n\n// 脉冲波纹效果\nexport function pulseWave(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n // 计算到中心的距离\n const distance = Math.sqrt(\n Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)\n );\n const normalizedDistance = Math.min(distance, 1);\n // 创建多个波纹\n const waves = 3;\n const wavePhase = ratio * 2 * Math.PI * waves;\n // 添加距离衰减\n const decay = Math.max(0, 1 - normalizedDistance);\n // 组合波纹和衰减效果\n const wave = Math.sin(wavePhase - normalizedDistance * 4 * Math.PI);\n const _r = minRatio + amplitude * ((wave + 1) / 2) * (decay * 0.7 + 0.3);\n return Math.min(1, Math.max(0, _r));\n}\n\n// 粒子动画效果\nexport function particleEffect(\n ctx: IContext2d,\n row: number,\n column: number,\n rowCount: number,\n columnCount: number,\n ratio: number,\n graphic: IGraphic,\n minRatio: number = 0,\n amplitude: number = 1\n): number {\n // 初始化随机种子\n if (!graphic.dynamicTextureCache) {\n graphic.dynamicTextureCache = {\n phases: new Array(rowCount * columnCount).fill(0).map(() => Math.random() * 2 * Math.PI),\n speeds: new Array(rowCount * columnCount).fill(0).map(() => 0.5 + Math.random() * 0.5),\n directions: new Array(rowCount * columnCount).fill(0).map(() => Math.random() * 2 * Math.PI)\n };\n }\n\n const index = row * columnCount + column;\n const phase = graphic.dynamicTextureCache.phases[index];\n const speed = graphic.dynamicTextureCache.speeds[index];\n const direction = graphic.dynamicTextureCache.directions[index];\n\n // 计算到中心的距离\n const centerRow = rowCount / 2;\n const centerCol = columnCount / 2;\n const distance = Math.sqrt(\n Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)\n );\n const normalizedDistance = Math.min(distance, 1);\n\n // 扩散阶段:粒子随机运动\n const scatterRatio = (ratio - 0.4) / 0.6;\n // 使用相位和方向创建随机运动\n const movement = Math.sin(scatterRatio * speed * 8 * Math.PI + phase + direction * scatterRatio);\n // 添加距离影响\n const distanceEffect = Math.cos(normalizedDistance * Math.PI + scatterRatio * Math.PI);\n // 添加衰减效果\n const decay = Math.max(0, 1 - scatterRatio * 1.2);\n\n // 组合所有效果\n const baseEffect = ((movement + 1) / 2) * decay * (0.3 + 0.7 * distanceEffect);\n const _r = minRatio + amplitude * baseEffect;\n return Math.min(1, Math.max(0, _r));\n}\n"]}
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=dynamicTexture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/dynamicTexture.ts"],"names":[],"mappings":"","file":"dynamicTexture.js","sourcesContent":["// import type { IContext2d, IGraphic } from '@visactor/vrender-core';\n\n// export function randomOpacity(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// if (!graphic.dynamicTextureCache) {\n// graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => Math.random() * 2 * Math.PI);\n// }\n// const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column];\n// const _r = (Math.sin(ratio * 2 * Math.PI + targetRandomValue) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左到右的列式渐变\n// export function columnLeftToRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 根据列号计算延迟\n// const delay = column / columnCount;\n// // 使用连续的sin函数,不需要max(0,ratio-delay)的截断\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从右到左的列式渐变\n// export function columnRightToLeft(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (columnCount - 1 - column) / columnCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从上到下的行式渐变\n// export function rowTopToBottom(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = row / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从下到上的行式渐变\n// export function rowBottomToTop(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (rowCount - 1 - row) / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从中心向两边的对角线渐变\n// export function diagonalCenterToEdge(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const distance = Math.sqrt(\n// Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)\n// );\n// const _r = (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左上角到右下角的对角线渐变\n// export function diagonalTopLeftToBottomRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (row / rowCount + column / columnCount) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 旋转扫描效果\n// export function rotationScan(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 计算当前点相对于中心点的角度\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 将角度归一化到 [0, 2π]\n// const normalizedAngle = angle < 0 ? angle + 2 * Math.PI : angle;\n// // 计算扫描延迟\n// const delay = normalizedAngle / (2 * Math.PI);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 波纹扩散效果\n// export function rippleEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 创建多个波纹\n// const waves = 3;\n// const _r = (Math.sin(ratio * 2 * Math.PI * waves - normalizedDistance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 蛇形波动效果\n// export function snakeWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 使用行和列的位置创建蛇形路径\n// const delay = ((row + column) % (rowCount + columnCount)) / (rowCount + columnCount);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 交错波纹效果\n// export function alternatingWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 行和列的交错波纹\n// const rowPhase = row / rowCount;\n// const colPhase = column / columnCount;\n// const _r =\n// (Math.sin(ratio * 2 * Math.PI - rowPhase * 2 * Math.PI) * Math.sin(ratio * 2 * Math.PI - colPhase * 2 * Math.PI) +\n// 1) /\n// 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 螺旋效果\n// export function spiralEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离和角度\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 组合距离和角度创建螺旋效果\n// const delay = (normalizedDistance + angle / (2 * Math.PI)) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n"]}
@@ -58,13 +58,14 @@ let NodeWindowHandlerContribution = class extends vrender_core_1.BaseWindowHandl
58
58
  this.canvas = new node_1.NodeCanvas(options);
59
59
  }
60
60
  createWindowByCanvas(params) {
61
- const canvas = params.canvas;
61
+ var _a;
62
+ const canvas = params.canvas, dpr = null !== (_a = params.dpr) && void 0 !== _a ? _a : 1;
62
63
  let width = params.width, height = params.height;
63
- null != width && null != height && params.canvasControled || (width = canvas.width,
64
- height = canvas.height), this.canvas = new node_1.NodeCanvas({
64
+ null != width && null != height && params.canvasControled || (width = canvas.width / dpr,
65
+ height = canvas.height / dpr), this.canvas = new node_1.NodeCanvas({
65
66
  width: width,
66
67
  height: height,
67
- dpr: 1,
68
+ dpr: dpr,
68
69
  nativeCanvas: canvas,
69
70
  canvasControled: params.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C,YAAY,CAAC;QACxC,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAYD,gBAAgB,CAAC,IAAa,EAAE,QAAiB,EAAE,OAAiB;QAClE,OAAO;IACT,CAAC;IAED,aAAa,CAAC,KAAU;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAYD,mBAAmB,CAAC,IAAa,EAAE,QAAiB,EAAE,OAAiB;QACrE,OAAO;IACT,CAAC;IAED,QAAQ;QACN,OAAO;IACT,CAAC;IACD,QAAQ,CAAC,KAAgD;QACvD,OAAO;IACT,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAc;QACzB,OAAO;IACT,CAAC;;AA5IM,iCAAG,GAAY,MAAM,CAAC;AADlB,6BAA6B;IADzC,IAAA,yBAAU,GAAE;IAUE,WAAA,IAAA,qBAAM,EAAC,sBAAO,CAAC,CAAA;;GATjB,6BAA6B,CA8IzC;AA9IY,sEAA6B;AAgJ7B,QAAA,gBAAgB,GAAG,IAAI,8BAAe,CAAC,IAAI,CAAC,EAAE;IAEzD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7C,IAAI,CAAC,wCAAyB,CAAC;SAC5B,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;SACvE,eAAe,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC","file":"node-contribution.js","sourcesContent":["import {\n inject,\n injectable,\n Generator,\n BaseWindowHandlerContribution,\n VGlobal,\n ContainerModule,\n WindowHandlerContribution\n} from '@visactor/vrender-core';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type {\n EnvType,\n IGlobal,\n IContext2d,\n ICanvas,\n IDomRectLike,\n IWindowHandlerContribution,\n IWindowParams\n} from '@visactor/vrender-core';\nimport { NodeCanvas } from '../../canvas/contributions/node';\n\n@injectable()\nexport class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n static env: EnvType = 'node';\n type: EnvType = 'node';\n\n canvas: ICanvas;\n get container(): HTMLElement | null {\n return null;\n }\n\n constructor(@inject(VGlobal) private readonly global: IGlobal) {\n super();\n }\n\n getTitle(): string {\n return '';\n }\n\n getWH(): { width: number; height: number } {\n return {\n width: this.canvas.displayWidth,\n height: this.canvas.displayHeight\n };\n }\n\n getXY(): { x: number; y: number } {\n return { x: 0, y: 0 };\n }\n\n createWindow(params: IWindowParams): void {\n // 如果没有传入canvas,那么就创建一个canvas\n if (!params.canvas) {\n this.createWindowByConfig(params);\n } else {\n this.createWindowByCanvas(params);\n }\n }\n private createWindowByConfig(params: IWindowParams) {\n // 创建canvas\n const nativeCanvas = this.global.createCanvas({ width: params.width, height: params.height });\n\n // 绑定\n const options = {\n width: params.width,\n height: params.height,\n dpr: params.dpr,\n nativeCanvas,\n id: Generator.GenAutoIncrementId().toString(),\n canvasControled: true\n };\n this.canvas = new NodeCanvas(options);\n }\n private createWindowByCanvas(params: IWindowParams) {\n // 获取canvas\n const canvas = params!.canvas as HTMLCanvasElement | null;\n\n // 如果没有传入wh,或者是不受控制的canvas,那就用canvas的原始wh\n let width = params.width;\n let height = params.height;\n if (width == null || height == null || !params.canvasControled) {\n width = canvas.width;\n height = canvas.height;\n }\n\n this.canvas = new NodeCanvas({\n width: width,\n height: height,\n dpr: 1,\n nativeCanvas: canvas,\n canvasControled: params.canvasControled\n });\n }\n releaseWindow(): void {\n this.canvas.release();\n }\n resizeWindow(width: number, height: number): void {\n this.canvas.resize(width, height);\n }\n setDpr(dpr: number): void {\n this.canvas.dpr = dpr;\n }\n\n getContext(): IContext2d {\n return this.canvas.getContext();\n }\n getNativeHandler(): ICanvas {\n return this.canvas;\n }\n getDpr(): number {\n return this.canvas.dpr;\n }\n\n getImageBuffer(type: string = 'image/png'): any {\n const canvas = this.canvas.nativeCanvas;\n return canvas.toBuffer(type);\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(type: unknown, listener: unknown, options?: unknown): void {\n return;\n }\n\n dispatchEvent(event: any): boolean {\n return true;\n }\n\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(type: unknown, listener: unknown, options?: unknown): void {\n return;\n }\n\n getStyle(): CSSStyleDeclaration | Record<string, any> {\n return;\n }\n setStyle(style: CSSStyleDeclaration | Record<string, any>): void {\n return;\n }\n\n getBoundingClientRect(): IDomRectLike {\n return null;\n }\n\n clearViewBox(color?: string): void {\n return;\n }\n}\n\nexport const nodeWindowModule = new ContainerModule(bind => {\n // node\n bind(NodeWindowHandlerContribution).toSelf();\n bind(WindowHandlerContribution)\n .toDynamicValue(ctx => ctx.container.get(NodeWindowHandlerContribution))\n .whenTargetNamed(NodeWindowHandlerContribution.env);\n});\n"]}
1
+ {"version":3,"sources":["../src/window/contributions/node-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yDAQgC;AAWhC,0DAA6D;AAGtD,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,4CAA6B;IAK9E,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAA8C,MAAe;QAC3D,KAAK,EAAE,CAAC;QADoC,WAAM,GAAN,MAAM,CAAS;QAP7D,SAAI,GAAY,MAAM,CAAC;IASvB,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK;QACH,OAAO;YACL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Q,CAAC,KAAgD;QACvD,OAAO;IACT,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,KAAc;QACzB,OAAO;IACT,CAAC;;AA5IM,iCAAG,GAAY,MAAM,CAAC;AADlB,6BAA6B;IADzC,IAAA,yBAAU,GAAE;IAUE,WAAA,IAAA,qBAAM,EAAC,sBAAO,CAAC,CAAA;;GATjB,6BAA6B,CA8IzC;AA9IY,sEAA6B;AAgJ7B,QAAA,gBAAgB,GAAG,IAAI,8BAAe,CAAC,IAAI,CAAC,EAAE;IAEzD,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7C,IAAI,CAAC,wCAAyB,CAAC;SAC5B,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;SACvE,eAAe,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC","file":"node-contribution.js","sourcesContent":["import {\n inject,\n injectable,\n Generator,\n BaseWindowHandlerContribution,\n VGlobal,\n ContainerModule,\n WindowHandlerContribution\n} from '@visactor/vrender-core';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type {\n EnvType,\n IGlobal,\n IContext2d,\n ICanvas,\n IDomRectLike,\n IWindowHandlerContribution,\n IWindowParams\n} from '@visactor/vrender-core';\nimport { NodeCanvas } from '../../canvas/contributions/node';\n\n@injectable()\nexport class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n static env: EnvType = 'node';\n type: EnvType = 'node';\n\n canvas: ICanvas;\n get container(): HTMLElement | null {\n return null;\n }\n\n constructor(@inject(VGlobal) private readonly global: IGlobal) {\n super();\n }\n\n getTitle(): string {\n return '';\n }\n\n getWH(): { width: number; height: number } {\n return {\n width: this.canvas.displayWidth,\n height: this.canvas.displayHeight\n };\n }\n\n getXY(): { x: number; y: number } {\n return { x: 0, y: 0 };\n }\n\n createWindow(params: IWindowParams): void {\n // 如果没有传入canvas,那么就创建一个canvas\n if (!params.canvas) {\n this.createWindowByConfig(params);\n } else {\n this.createWindowByCanvas(params);\n }\n }\n private createWindowByConfig(params: IWindowParams) {\n // 创建canvas\n const nativeCanvas = this.global.createCanvas({ width: params.width, height: params.height });\n\n // 绑定\n const options = {\n width: params.width,\n height: params.height,\n dpr: params.dpr,\n nativeCanvas,\n id: Generator.GenAutoIncrementId().toString(),\n canvasControled: true\n };\n this.canvas = new NodeCanvas(options);\n }\n private createWindowByCanvas(params: IWindowParams) {\n // 获取canvas\n const canvas = params!.canvas as HTMLCanvasElement | null;\n const dpr = params.dpr ?? 1;\n // 如果没有传入wh,或者是不受控制的canvas,那就用canvas的原始wh\n let width = params.width;\n let height = params.height;\n if (width == null || height == null || !params.canvasControled) {\n width = canvas.width / dpr;\n height = canvas.height / dpr;\n }\n\n this.canvas = new NodeCanvas({\n width: width,\n height: height,\n dpr: dpr,\n nativeCanvas: canvas,\n canvasControled: params.canvasControled\n });\n }\n releaseWindow(): void {\n this.canvas.release();\n }\n resizeWindow(width: number, height: number): void {\n this.canvas.resize(width, height);\n }\n setDpr(dpr: number): void {\n this.canvas.dpr = dpr;\n }\n\n getContext(): IContext2d {\n return this.canvas.getContext();\n }\n getNativeHandler(): ICanvas {\n return this.canvas;\n }\n getDpr(): number {\n return this.canvas.dpr;\n }\n\n getImageBuffer(type: string = 'image/png'): any {\n const canvas = this.canvas.nativeCanvas;\n return canvas.toBuffer(type);\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(type: unknown, listener: unknown, options?: unknown): void {\n return;\n }\n\n dispatchEvent(event: any): boolean {\n return true;\n }\n\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(type: unknown, listener: unknown, options?: unknown): void {\n return;\n }\n\n getStyle(): CSSStyleDeclaration | Record<string, any> {\n return;\n }\n setStyle(style: CSSStyleDeclaration | Record<string, any>): void {\n return;\n }\n\n getBoundingClientRect(): IDomRectLike {\n return null;\n }\n\n clearViewBox(color?: string): void {\n return;\n }\n}\n\nexport const nodeWindowModule = new ContainerModule(bind => {\n // node\n bind(NodeWindowHandlerContribution).toSelf();\n bind(WindowHandlerContribution)\n .toDynamicValue(ctx => ctx.container.get(NodeWindowHandlerContribution))\n .whenTargetNamed(NodeWindowHandlerContribution.env);\n});\n"]}
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { injectable, inject, DefaultCanvasArcRender, ARC_NUMBER_TYPE, CustomPath2D, drawArcPath, DefaultCanvasAreaRender, drawAreaSegments, DefaultCanvasCircleRender, CIRCLE_NUMBER_TYPE, DefaultCanvasLineRender, drawSegments, DefaultCanvasPathRender, PATH_NUMBER_TYPE, DefaultCanvasRectRender, RECT_NUMBER_TYPE, DefaultCanvasSymbolRender, BaseRender, SYMBOL_NUMBER_TYPE, ContainerModule, GraphicRender, graphicCreator, Group, clock, application, WILDCARD, DefaultFillStyle, DefaultStrokeStyle, DefaultTextStyle, matrixAllocate, transformMat4, createColor, getScaledStroke, createConicalGradient, BaseCanvas, CanvasFactory, Context2dFactory, ContributionProvider, named, DrawContribution, PickItemInterceptor, PickServiceInterceptor, DefaultPickService, canvasAllocate, GROUP_NUMBER_TYPE, bindContributionProvider, PickerService, WindowHandlerContribution, BaseWindowHandlerContribution, BaseEnvContribution, Generator, EnvContribution, container, VGlobal, EmptyContext2d, ArcRender, AreaRender, AREA_NUMBER_TYPE, CircleRender, GLYPH_NUMBER_TYPE, GlyphRender, IMAGE_NUMBER_TYPE, LineRender, LINE_NUMBER_TYPE, PolygonRender, POLYGON_NUMBER_TYPE, PathRender, RectRender, SymbolRender, TEXT_NUMBER_TYPE, rafBasedSto, vglobal, RafBasedSTO, mat4Allocate, TextRender, textLayoutOffsetY, textDrawOffsetX, RichTextRender, RICHTEXT_NUMBER_TYPE, Rect3DRender, RECT3D_NUMBER_TYPE, Arc3dRender, ARC3D_NUMBER_TYPE, Pyramid3dRender, PYRAMID3D_NUMBER_TYPE, Image as Image$1, ResourceLoader, ImageRenderContribution, DefaultCanvasImageRender, getTheme, DefaultRectRenderContribution, BaseRenderContributionTime, NOWORK_ANIMATE_ATTR, Rect, isBrowserEnv, registerArcGraphic, arcModule, registerArc3dGraphic, registerDirectionalLight, registerOrthoCamera, arc3dModule, registerAreaGraphic, areaModule, registerCircleGraphic, circleModule, registerGlyphGraphic, glyphModule, registerGroupGraphic, registerImageGraphic, imageModule, registerLineGraphic, lineModule, registerPathGraphic, pathModule, registerPolygonGraphic, polygonModule, registerPyramid3dGraphic, pyramid3dModule, registerRectGraphic, rectModule, registerRect3dGraphic, rect3dModule, registerRichtextGraphic, richtextModule, registerShadowRootGraphic, registerSymbolGraphic, symbolModule, registerTextGraphic, textModule, registerWrapTextGraphic } from '@visactor/vrender-core';
1
+ import { injectable, inject, DefaultCanvasArcRender, ARC_NUMBER_TYPE, CustomPath2D, drawArcPath, DefaultCanvasAreaRender, drawAreaSegments, DefaultCanvasCircleRender, CIRCLE_NUMBER_TYPE, DefaultCanvasLineRender, drawSegments, DefaultCanvasPathRender, PATH_NUMBER_TYPE, DefaultCanvasRectRender, RECT_NUMBER_TYPE, DefaultCanvasSymbolRender, BaseRender, SYMBOL_NUMBER_TYPE, ContainerModule, GraphicRender, graphicCreator, Group, clock, application, WILDCARD, DefaultFillStyle, DefaultStrokeStyle, DefaultTextStyle, matrixAllocate, transformMat4, createColor, getScaledStroke, createConicalGradient, BaseCanvas, CanvasFactory, Context2dFactory, ContributionProvider, named, DrawContribution, PickItemInterceptor, PickServiceInterceptor, DefaultPickService, canvasAllocate, GROUP_NUMBER_TYPE, bindContributionProvider, PickerService, WindowHandlerContribution, BaseWindowHandlerContribution, BaseEnvContribution, Generator, EnvContribution, container, VGlobal, EmptyContext2d, ArcRender, AreaRender, AREA_NUMBER_TYPE, CircleRender, GLYPH_NUMBER_TYPE, GlyphRender, IMAGE_NUMBER_TYPE, LineRender, LINE_NUMBER_TYPE, PolygonRender, POLYGON_NUMBER_TYPE, PathRender, RectRender, SymbolRender, TEXT_NUMBER_TYPE, rafBasedSto, vglobal, RafBasedSTO, mat4Allocate, TextRender, textLayoutOffsetY, textDrawOffsetX, RichTextRender, RICHTEXT_NUMBER_TYPE, ImageRender, Rect3DRender, RECT3D_NUMBER_TYPE, Arc3dRender, ARC3D_NUMBER_TYPE, Pyramid3dRender, PYRAMID3D_NUMBER_TYPE, Image as Image$1, ResourceLoader, ImageRenderContribution, DefaultCanvasImageRender, getTheme, DefaultRectRenderContribution, BaseRenderContributionTime, NOWORK_ANIMATE_ATTR, Rect, isBrowserEnv, registerArcGraphic, arcModule, registerArc3dGraphic, registerDirectionalLight, registerOrthoCamera, arc3dModule, registerAreaGraphic, areaModule, registerCircleGraphic, circleModule, registerGlyphGraphic, glyphModule, registerGroupGraphic, registerImageGraphic, imageModule, registerLineGraphic, lineModule, registerPathGraphic, pathModule, registerPolygonGraphic, polygonModule, registerPyramid3dGraphic, pyramid3dModule, registerRectGraphic, rectModule, registerRect3dGraphic, rect3dModule, registerRichtextGraphic, richtextModule, registerShadowRootGraphic, registerSymbolGraphic, symbolModule, registerTextGraphic, textModule, registerWrapTextGraphic } from '@visactor/vrender-core';
2
2
  import { isString, isArray, EventEmitter, Matrix, Logger, getContextFont, pi2, pi, AABBBounds, isValidNumber, isNumber, isFunction } from '@visactor/vutils';
3
3
 
4
4
  /******************************************************************************
@@ -3369,16 +3369,12 @@ let BrowserContext2d = class BrowserContext2d {
3369
3369
  _context.filter = `blur(${blur}px)`;
3370
3370
  this._clearFilterStyle = true;
3371
3371
  }
3372
- else if (this._clearFilterStyle) {
3373
- _context.filter = 'blur(0px)';
3374
- this._clearFilterStyle = false;
3375
- }
3376
- if (filter) {
3372
+ else if (filter) {
3377
3373
  _context.filter = filter;
3378
3374
  this._clearFilterStyle = true;
3379
3375
  }
3380
3376
  else if (this._clearFilterStyle) {
3381
- _context.filter = '';
3377
+ _context.filter = 'blur(0px)';
3382
3378
  this._clearFilterStyle = false;
3383
3379
  }
3384
3380
  if (globalCompositeOperation) {
@@ -4663,14 +4659,16 @@ class PickerBase {
4663
4659
  pickContext.setTransformForCurrent();
4664
4660
  }
4665
4661
  let picked = false;
4666
- this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => {
4667
- if (picked) {
4662
+ let _final = false;
4663
+ this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute, final) => {
4664
+ if (picked || _final) {
4668
4665
  return true;
4669
4666
  }
4670
4667
  picked = context.isPointInPath(point.x, point.y);
4668
+ _final = final || _final;
4671
4669
  return picked;
4672
- }, (context, arcAttribute, themeAttribute) => {
4673
- if (picked) {
4670
+ }, (context, arcAttribute, themeAttribute, final) => {
4671
+ if (picked || _final) {
4674
4672
  return true;
4675
4673
  }
4676
4674
  const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth;
@@ -4680,6 +4678,7 @@ class PickerBase {
4680
4678
  ? lineWidth + pickStrokeBuffer
4681
4679
  : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr);
4682
4680
  picked = context.isPointInStroke(point.x, point.y);
4681
+ _final = final || _final;
4683
4682
  return picked;
4684
4683
  });
4685
4684
  pickContext.highPerformanceRestore();
@@ -5904,17 +5903,19 @@ let NodeWindowHandlerContribution = class NodeWindowHandlerContribution extends
5904
5903
  this.canvas = new NodeCanvas(options);
5905
5904
  }
5906
5905
  createWindowByCanvas(params) {
5906
+ var _a;
5907
5907
  const canvas = params.canvas;
5908
+ const dpr = (_a = params.dpr) !== null && _a !== void 0 ? _a : 1;
5908
5909
  let width = params.width;
5909
5910
  let height = params.height;
5910
5911
  if (width == null || height == null || !params.canvasControled) {
5911
- width = canvas.width;
5912
- height = canvas.height;
5912
+ width = canvas.width / dpr;
5913
+ height = canvas.height / dpr;
5913
5914
  }
5914
5915
  this.canvas = new NodeCanvas({
5915
5916
  width: width,
5916
5917
  height: height,
5917
- dpr: 1,
5918
+ dpr: dpr,
5918
5919
  nativeCanvas: canvas,
5919
5920
  canvasControled: params.canvasControled
5920
5921
  });
@@ -8314,24 +8315,18 @@ const richtextCanvasPickModule = new ContainerModule((bind, unbind, isBound, reb
8314
8315
  bind(CanvasPickerContribution).toService(CanvasRichTextPicker);
8315
8316
  });
8316
8317
 
8317
- let DefaultCanvasImagePicker = class DefaultCanvasImagePicker {
8318
- constructor() {
8318
+ let DefaultCanvasImagePicker = class DefaultCanvasImagePicker extends PickerBase {
8319
+ constructor(canvasRenderer) {
8320
+ super();
8321
+ this.canvasRenderer = canvasRenderer;
8319
8322
  this.type = 'image';
8320
8323
  this.numberType = IMAGE_NUMBER_TYPE;
8321
8324
  }
8322
- contains(image, point, params) {
8323
- const { pickContext } = params !== null && params !== void 0 ? params : {};
8324
- if (!pickContext) {
8325
- return false;
8326
- }
8327
- if (!image.AABBBounds.containsPoint(point)) {
8328
- return false;
8329
- }
8330
- return true;
8331
- }
8332
8325
  };
8333
8326
  DefaultCanvasImagePicker = __decorate([
8334
- injectable()
8327
+ injectable(),
8328
+ __param(0, inject(ImageRender)),
8329
+ __metadata("design:paramtypes", [Object])
8335
8330
  ], DefaultCanvasImagePicker);
8336
8331
 
8337
8332
  let loadImagePick = false;
@@ -10264,6 +10259,166 @@ function _registerWrapText() {
10264
10259
  _registerWrapText.__loaded = false;
10265
10260
  const registerWrapText = _registerWrapText;
10266
10261
 
10262
+ function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10263
+ if (!graphic.dynamicTextureCache) {
10264
+ graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => Math.random() * 2 * Math.PI);
10265
+ }
10266
+ const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column];
10267
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI + targetRandomValue) + 1)) / 2;
10268
+ return Math.min(1, Math.max(0, _r));
10269
+ }
10270
+ function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10271
+ const delay = column / columnCount;
10272
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10273
+ return Math.min(1, Math.max(0, _r));
10274
+ }
10275
+ function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10276
+ const delay = (columnCount - 1 - column) / columnCount;
10277
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10278
+ return Math.min(1, Math.max(0, _r));
10279
+ }
10280
+ function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10281
+ const delay = row / rowCount;
10282
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10283
+ return Math.min(1, Math.max(0, _r));
10284
+ }
10285
+ function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10286
+ const delay = (rowCount - 1 - row) / rowCount;
10287
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10288
+ return Math.min(1, Math.max(0, _r));
10289
+ }
10290
+ function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10291
+ const centerRow = rowCount / 2;
10292
+ const centerCol = columnCount / 2;
10293
+ const distance = Math.sqrt(Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2));
10294
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;
10295
+ return Math.min(1, Math.max(0, _r));
10296
+ }
10297
+ function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10298
+ const delay = (row / rowCount + column / columnCount) / 2;
10299
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10300
+ return Math.min(1, Math.max(0, _r));
10301
+ }
10302
+ function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10303
+ const centerRow = rowCount / 2;
10304
+ const centerCol = columnCount / 2;
10305
+ const angle = Math.atan2(row - centerRow, column - centerCol);
10306
+ const normalizedAngle = angle < 0 ? angle + 2 * Math.PI : angle;
10307
+ const delay = normalizedAngle / (2 * Math.PI);
10308
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1)) / 2;
10309
+ return Math.min(1, Math.max(0, _r));
10310
+ }
10311
+ function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10312
+ const centerRow = rowCount / 2;
10313
+ const centerCol = columnCount / 2;
10314
+ const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));
10315
+ const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));
10316
+ const waves = 3;
10317
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI * waves - normalizedDistance * 2 * Math.PI) + 1)) / 2;
10318
+ return Math.min(1, Math.max(0, _r));
10319
+ }
10320
+ function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10321
+ const delay = ((row + column) % (rowCount + columnCount)) / (rowCount + columnCount);
10322
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1)) / 2;
10323
+ return Math.min(1, Math.max(0, _r));
10324
+ }
10325
+ function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10326
+ const rowPhase = row / rowCount;
10327
+ const colPhase = column / columnCount;
10328
+ const _r = minRatio +
10329
+ (amplitude *
10330
+ (Math.sin(ratio * 2 * Math.PI - rowPhase * 2 * Math.PI) * Math.sin(ratio * 2 * Math.PI - colPhase * 2 * Math.PI) +
10331
+ 1)) /
10332
+ 2;
10333
+ return Math.min(1, Math.max(0, _r));
10334
+ }
10335
+ function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10336
+ const centerRow = rowCount / 2;
10337
+ const centerCol = columnCount / 2;
10338
+ const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));
10339
+ const angle = Math.atan2(row - centerRow, column - centerCol);
10340
+ const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));
10341
+ const delay = (normalizedDistance + angle / (2 * Math.PI)) / 2;
10342
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1)) / 2;
10343
+ return Math.min(1, Math.max(0, _r));
10344
+ }
10345
+ function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10346
+ const centerCol = columnCount / 2;
10347
+ const distance = Math.abs(column - centerCol) / centerCol;
10348
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;
10349
+ return Math.min(1, Math.max(0, _r));
10350
+ }
10351
+ function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10352
+ const centerCol = columnCount / 2;
10353
+ const distance = 1 - Math.abs(column - centerCol) / centerCol;
10354
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;
10355
+ return Math.min(1, Math.max(0, _r));
10356
+ }
10357
+ function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10358
+ const centerRow = rowCount / 2;
10359
+ const distance = Math.abs(row - centerRow) / centerRow;
10360
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;
10361
+ return Math.min(1, Math.max(0, _r));
10362
+ }
10363
+ function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10364
+ const centerRow = rowCount / 2;
10365
+ const distance = 1 - Math.abs(row - centerRow) / centerRow;
10366
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1)) / 2;
10367
+ return Math.min(1, Math.max(0, _r));
10368
+ }
10369
+ function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10370
+ const centerRow = rowCount / 2;
10371
+ const centerCol = columnCount / 2;
10372
+ const distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2));
10373
+ const normalizedDistance = Math.min(distance, 1);
10374
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - normalizedDistance * 2 * Math.PI) + 1)) / 2;
10375
+ return Math.min(1, Math.max(0, _r));
10376
+ }
10377
+ function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10378
+ const centerRow = rowCount / 2;
10379
+ const centerCol = columnCount / 2;
10380
+ const distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2));
10381
+ const normalizedDistance = 1 - Math.min(distance, 1);
10382
+ const _r = minRatio + (amplitude * (Math.sin(ratio * 2 * Math.PI - normalizedDistance * 2 * Math.PI) + 1)) / 2;
10383
+ return Math.min(1, Math.max(0, _r));
10384
+ }
10385
+ function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10386
+ const centerRow = rowCount / 2;
10387
+ const centerCol = columnCount / 2;
10388
+ const distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2));
10389
+ const normalizedDistance = Math.min(distance, 1);
10390
+ const waves = 3;
10391
+ const wavePhase = ratio * 2 * Math.PI * waves;
10392
+ const decay = Math.max(0, 1 - normalizedDistance);
10393
+ const wave = Math.sin(wavePhase - normalizedDistance * 4 * Math.PI);
10394
+ const _r = minRatio + amplitude * ((wave + 1) / 2) * (decay * 0.7 + 0.3);
10395
+ return Math.min(1, Math.max(0, _r));
10396
+ }
10397
+ function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
10398
+ if (!graphic.dynamicTextureCache) {
10399
+ graphic.dynamicTextureCache = {
10400
+ phases: new Array(rowCount * columnCount).fill(0).map(() => Math.random() * 2 * Math.PI),
10401
+ speeds: new Array(rowCount * columnCount).fill(0).map(() => 0.5 + Math.random() * 0.5),
10402
+ directions: new Array(rowCount * columnCount).fill(0).map(() => Math.random() * 2 * Math.PI)
10403
+ };
10404
+ }
10405
+ const index = row * columnCount + column;
10406
+ const phase = graphic.dynamicTextureCache.phases[index];
10407
+ const speed = graphic.dynamicTextureCache.speeds[index];
10408
+ const direction = graphic.dynamicTextureCache.directions[index];
10409
+ const centerRow = rowCount / 2;
10410
+ const centerCol = columnCount / 2;
10411
+ const distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2));
10412
+ const normalizedDistance = Math.min(distance, 1);
10413
+ const scatterRatio = (ratio - 0.4) / 0.6;
10414
+ const movement = Math.sin(scatterRatio * speed * 8 * Math.PI + phase + direction * scatterRatio);
10415
+ const distanceEffect = Math.cos(normalizedDistance * Math.PI + scatterRatio * Math.PI);
10416
+ const decay = Math.max(0, 1 - scatterRatio * 1.2);
10417
+ const baseEffect = ((movement + 1) / 2) * decay * (0.3 + 0.7 * distanceEffect);
10418
+ const _r = minRatio + amplitude * baseEffect;
10419
+ return Math.min(1, Math.max(0, _r));
10420
+ }
10421
+
10267
10422
  const roughModule = _roughModule;
10268
10423
 
10269
- export { BrowserEnvContribution, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasGifImagePicker, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasLottiePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextPicker, DragNDrop, Fragment, Gesture, GifImage, Lottie, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, VArc, VArc3d, VArea, VCircle, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, _registerArc, arc3dCanvasPickModule, arcCanvasPickModule, arcMathPickModule, areaCanvasPickModule, areaMathPickModule, browserEnvModule, circleCanvasPickModule, circleMathPickModule, createGifImage, createImageElement$1 as createImageElement, createLottie, decodeReactDom, feishuEnvModule, gifImageCanvasPickModule, gifImageModule, glyphCanvasPickModule, glyphMathPickModule, harmonyEnvModule, imageCanvasPickModule, imageMathPickModule, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, jsx, lineCanvasPickModule, lineMathPickModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lottieCanvasPickModule, lottieModule, lynxEnvModule, nodeEnvModule, pathCanvasPickModule, pathMathPickModule, polygonCanvasPickModule, polygonMathPickModule, pyramid3dCanvasPickModule, rect3dCanvasPickModule, rectCanvasPickModule, rectMathPickModule, registerArc, registerArc3d, registerArea, registerCircle, registerGlyph, registerGroup, registerImage, registerLine, registerPath, registerPolygon, registerPyramid3d, registerRect, registerRect3d, registerRichtext, registerShadowRoot, registerSymbol, registerText, registerWrapText, richTextMathPickModule, richtextCanvasPickModule, roughModule, symbolCanvasPickModule, symbolMathPickModule, taroEnvModule, textCanvasPickModule, textMathPickModule, ttEnvModule, wxEnvModule };
10424
+ export { BrowserEnvContribution, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasGifImagePicker, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasLottiePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasSymbolPicker, CanvasTextPicker, DragNDrop, Fragment, Gesture, GifImage, Lottie, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathSymbolPicker, MathTextPicker, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, VArc, VArc3d, VArea, VCircle, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VText, _registerArc, alternatingWave, arc3dCanvasPickModule, arcCanvasPickModule, arcMathPickModule, areaCanvasPickModule, areaMathPickModule, browserEnvModule, centerToCorner, circleCanvasPickModule, circleMathPickModule, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, cornerToCenter, createGifImage, createImageElement$1 as createImageElement, createLottie, decodeReactDom, diagonalCenterToEdge, diagonalTopLeftToBottomRight, feishuEnvModule, gifImageCanvasPickModule, gifImageModule, glyphCanvasPickModule, glyphMathPickModule, harmonyEnvModule, imageCanvasPickModule, imageMathPickModule, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initWxEnv, jsx, lineCanvasPickModule, lineMathPickModule, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadNodeEnv, loadTTEnv, loadTaroEnv, loadWxEnv, lottieCanvasPickModule, lottieModule, lynxEnvModule, nodeEnvModule, particleEffect, pathCanvasPickModule, pathMathPickModule, polygonCanvasPickModule, polygonMathPickModule, pulseWave, pyramid3dCanvasPickModule, randomOpacity, rect3dCanvasPickModule, rectCanvasPickModule, rectMathPickModule, registerArc, registerArc3d, registerArea, registerCircle, registerGlyph, registerGroup, registerImage, registerLine, registerPath, registerPolygon, registerPyramid3d, registerRect, registerRect3d, registerRichtext, registerShadowRoot, registerSymbol, registerText, registerWrapText, richTextMathPickModule, richtextCanvasPickModule, rippleEffect, rotationScan, roughModule, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, spiralEffect, symbolCanvasPickModule, symbolMathPickModule, taroEnvModule, textCanvasPickModule, textMathPickModule, ttEnvModule, wxEnvModule };
@@ -430,8 +430,7 @@ let BrowserContext2d = class {
430
430
  _context.shadowColor = shadowColor, _context.shadowOffsetX = shadowOffsetX * this.dpr,
431
431
  _context.shadowOffsetY = shadowOffsetY * this.dpr, this._clearShadowStyle = !0) : this._clearShadowStyle && (_context.shadowBlur = 0,
432
432
  _context.shadowOffsetX = 0, _context.shadowOffsetY = 0), blur ? (_context.filter = `blur(${blur}px)`,
433
- this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "blur(0px)",
434
- this._clearFilterStyle = !1), filter ? (_context.filter = filter, this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "",
433
+ this._clearFilterStyle = !0) : filter ? (_context.filter = filter, this._clearFilterStyle = !0) : this._clearFilterStyle && (_context.filter = "blur(0px)",
435
434
  this._clearFilterStyle = !1), globalCompositeOperation ? (_context.globalCompositeOperation = globalCompositeOperation,
436
435
  this._clearGlobalCompositeOperationStyle = !0) : this._clearGlobalCompositeOperationStyle && (_context.globalCompositeOperation = "source-over",
437
436
  this._clearGlobalCompositeOperationStyle = !1));