@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.
- package/cjs/canvas/contributions/browser/context.js +1 -2
- package/cjs/canvas/contributions/browser/context.js.map +1 -1
- package/cjs/canvas/contributions/modules.js +1 -2
- package/cjs/env/contributions/browser-contribution.js +2 -1
- package/cjs/env/contributions/taro-contribution.js +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/picker/contributions/canvas-picker/image-picker.d.ts +5 -4
- package/cjs/picker/contributions/canvas-picker/image-picker.js +12 -9
- package/cjs/picker/contributions/canvas-picker/image-picker.js.map +1 -1
- package/cjs/picker/contributions/common/base.js +5 -5
- package/cjs/picker/contributions/common/base.js.map +1 -1
- package/cjs/tools/dynamicTexture/effect.d.ts +21 -0
- package/cjs/tools/dynamicTexture/effect.js +121 -0
- package/cjs/tools/dynamicTexture/effect.js.map +1 -0
- package/cjs/tools/dynamicTexture.d.ts +1 -0
- package/cjs/tools/dynamicTexture.js +1 -0
- package/cjs/tools/dynamicTexture.js.map +1 -0
- package/cjs/window/contributions/node-contribution.js +5 -4
- package/cjs/window/contributions/node-contribution.js.map +1 -1
- package/dist/index.es.js +183 -28
- package/es/canvas/contributions/browser/context.js +1 -2
- package/es/canvas/contributions/browser/context.js.map +1 -1
- package/es/canvas/contributions/modules.js +1 -2
- package/es/env/contributions/browser-contribution.js +2 -1
- package/es/env/contributions/taro-contribution.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/picker/contributions/canvas-picker/image-picker.d.ts +5 -4
- package/es/picker/contributions/canvas-picker/image-picker.js +13 -9
- package/es/picker/contributions/canvas-picker/image-picker.js.map +1 -1
- package/es/picker/contributions/common/base.js +5 -5
- package/es/picker/contributions/common/base.js.map +1 -1
- package/es/tools/dynamicTexture/effect.d.ts +21 -0
- package/es/tools/dynamicTexture/effect.js +106 -0
- package/es/tools/dynamicTexture/effect.js.map +1 -0
- package/es/tools/dynamicTexture.d.ts +1 -0
- package/es/tools/dynamicTexture.js +1 -0
- package/es/tools/dynamicTexture.js.map +1 -0
- package/es/window/contributions/node-contribution.js +5 -4
- package/es/window/contributions/node-contribution.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
2
|
+
graphic.dynamicTextureCache || (graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map((item => 2 * Math.random() * Math.PI)));
|
|
3
|
+
const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column], _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
|
|
4
|
+
return Math.min(1, Math.max(0, _r));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
8
|
+
const delay = column / columnCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
9
|
+
return Math.min(1, Math.max(0, _r));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
13
|
+
const delay = (columnCount - 1 - column) / columnCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
14
|
+
return Math.min(1, Math.max(0, _r));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
18
|
+
const delay = row / rowCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
19
|
+
return Math.min(1, Math.max(0, _r));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
23
|
+
const delay = (rowCount - 1 - row) / rowCount, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
24
|
+
return Math.min(1, Math.max(0, _r));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28
|
+
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;
|
|
29
|
+
return Math.min(1, Math.max(0, _r));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
33
|
+
const delay = (row / rowCount + column / columnCount) / 2, _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
34
|
+
return Math.min(1, Math.max(0, _r));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
38
|
+
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;
|
|
39
|
+
return Math.min(1, Math.max(0, _r));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
43
|
+
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;
|
|
44
|
+
return Math.min(1, Math.max(0, _r));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
48
|
+
const delay = (row + column) % (rowCount + columnCount) / (rowCount + columnCount), _r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
|
|
49
|
+
return Math.min(1, Math.max(0, _r));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
53
|
+
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;
|
|
54
|
+
return Math.min(1, Math.max(0, _r));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
58
|
+
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;
|
|
59
|
+
return Math.min(1, Math.max(0, _r));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
63
|
+
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;
|
|
64
|
+
return Math.min(1, Math.max(0, _r));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
68
|
+
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;
|
|
69
|
+
return Math.min(1, Math.max(0, _r));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
73
|
+
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;
|
|
74
|
+
return Math.min(1, Math.max(0, _r));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
78
|
+
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;
|
|
79
|
+
return Math.min(1, Math.max(0, _r));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
83
|
+
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;
|
|
84
|
+
return Math.min(1, Math.max(0, _r));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
88
|
+
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;
|
|
89
|
+
return Math.min(1, Math.max(0, _r));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
93
|
+
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);
|
|
94
|
+
return Math.min(1, Math.max(0, _r));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
98
|
+
graphic.dynamicTextureCache || (graphic.dynamicTextureCache = {
|
|
99
|
+
phases: new Array(rowCount * columnCount).fill(0).map((() => 2 * Math.random() * Math.PI)),
|
|
100
|
+
speeds: new Array(rowCount * columnCount).fill(0).map((() => .5 + .5 * Math.random())),
|
|
101
|
+
directions: new Array(rowCount * columnCount).fill(0).map((() => 2 * Math.random() * Math.PI))
|
|
102
|
+
});
|
|
103
|
+
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));
|
|
104
|
+
return Math.min(1, Math.max(0, _r));
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=effect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/dynamicTexture/effect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,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,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;KAClH;IACD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;I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Y,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","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"]}
|
|
@@ -54,13 +54,14 @@ let NodeWindowHandlerContribution = class extends BaseWindowHandlerContribution
|
|
|
54
54
|
this.canvas = new NodeCanvas(options);
|
|
55
55
|
}
|
|
56
56
|
createWindowByCanvas(params) {
|
|
57
|
-
|
|
57
|
+
var _a;
|
|
58
|
+
const canvas = params.canvas, dpr = null !== (_a = params.dpr) && void 0 !== _a ? _a : 1;
|
|
58
59
|
let width = params.width, height = params.height;
|
|
59
|
-
null != width && null != height && params.canvasControled || (width = canvas.width,
|
|
60
|
-
height = canvas.height), this.canvas = new NodeCanvas({
|
|
60
|
+
null != width && null != height && params.canvasControled || (width = canvas.width / dpr,
|
|
61
|
+
height = canvas.height / dpr), this.canvas = new NodeCanvas({
|
|
61
62
|
width: width,
|
|
62
63
|
height: height,
|
|
63
|
-
dpr:
|
|
64
|
+
dpr: dpr,
|
|
64
65
|
nativeCanvas: canvas,
|
|
65
66
|
canvasControled: params.canvasControled
|
|
66
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window/contributions/node-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,6BAA6B,EAC7B,OAAO,EACP,eAAe,EACf,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAWhC,OAAO,EAAE,UAAU,EAAE,MAAM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ator,\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-kits",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@visactor/vutils": "~0.19.4",
|
|
16
|
-
"@visactor/vrender-core": "0.22.
|
|
16
|
+
"@visactor/vrender-core": "0.22.2",
|
|
17
17
|
"@resvg/resvg-js": "2.4.1",
|
|
18
18
|
"roughjs": "4.5.2",
|
|
19
19
|
"gifuct-js": "2.1.2",
|