@visactor/vrender-core 0.16.15 → 0.16.16
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/common/Reflect-metadata.js +1 -1
- package/cjs/common/bezier-utils.js +1 -2
- package/cjs/common/bounds-context.js +1 -1
- package/cjs/common/canvas-utils.js +1 -1
- package/cjs/common/contribution-provider.js +1 -1
- package/cjs/common/custom-path2d.js +1 -1
- package/cjs/common/enums.js +1 -1
- package/cjs/common/generator.js +1 -1
- package/cjs/common/matrix.js +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +2 -2
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -2
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/core/camera.js +2 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/event/constant.js +1 -1
- package/cjs/event/event-manager.js +1 -1
- package/cjs/event/event-system.js +1 -1
- package/cjs/event/event-target.js +1 -1
- package/cjs/event/index.js +2 -1
- package/cjs/event/util.js +1 -1
- package/cjs/graphic/builtin-symbol/index.js +0 -1
- package/cjs/graphic/builtin-symbol/index.js.map +1 -1
- package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
- package/cjs/graphic/builtin-symbol/rect.js +11 -6
- package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
- package/cjs/interface/allocator.js +1 -1
- package/cjs/interface/animate.js +1 -1
- package/cjs/interface/camera.js +1 -1
- package/cjs/interface/canvas.js +1 -1
- package/cjs/interface/color.js +1 -1
- package/cjs/interface/common.js +1 -1
- package/dist/index.js +18 -11
- package/dist/index.min.js +1 -1
- package/es/common/Reflect-metadata.js +1 -1
- package/es/common/bezier-utils.js +1 -2
- package/es/common/bounds-context.js +1 -1
- package/es/common/canvas-utils.js +1 -1
- package/es/common/contribution-provider.js +1 -1
- package/es/common/custom-path2d.js +1 -1
- package/es/common/enums.js +1 -1
- package/es/common/generator.js +1 -1
- package/es/common/matrix.js +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -2
- package/es/common/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.js +1 -1
- package/es/core/camera.js +2 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.js +1 -1
- package/es/event/constant.js +1 -1
- package/es/event/event-manager.js +1 -1
- package/es/event/event-system.js +1 -1
- package/es/event/event-target.js +1 -1
- package/es/event/index.js +2 -1
- package/es/event/util.js +1 -1
- package/es/graphic/builtin-symbol/index.js +0 -1
- package/es/graphic/builtin-symbol/index.js.map +1 -1
- package/es/graphic/builtin-symbol/rect.d.ts +2 -1
- package/es/graphic/builtin-symbol/rect.js +9 -4
- package/es/graphic/builtin-symbol/rect.js.map +1 -1
- package/es/interface/allocator.js +1 -1
- package/es/interface/animate.js +1 -1
- package/es/interface/camera.js +1 -1
- package/es/interface/canvas.js +1 -1
- package/es/interface/color.js +1 -1
- package/es/interface/common.js +1 -1
- package/package.json +4 -4
|
@@ -22,5 +22,4 @@ export function cubicCalc(p0, p1, p2, p3, t) {
|
|
|
22
22
|
export function cubicPointAt(p0, p1, p2, p3, t) {
|
|
23
23
|
const x = cubicCalc(p0.x, p1.x, p2.x, p3.x, t), y = cubicCalc(p0.y, p1.y, p2.y, p3.y, t);
|
|
24
24
|
return new Point(x, y);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=bezier-utils.js.map
|
|
25
|
+
}
|
|
@@ -62,4 +62,4 @@ function createConicGradient(context, color, params, offsetX = 0, offsetY = 0) {
|
|
|
62
62
|
canvasGradient.addColorStop(stop.offset, stop.color);
|
|
63
63
|
})), canvasGradient.GetPattern(w + x, h + y, undefined);
|
|
64
64
|
}
|
|
65
|
-
//# sourceMappingURL=canvas-utils.js.map
|
|
65
|
+
//# sourceMappingURL=canvas-utils.js.map
|
|
@@ -17,4 +17,4 @@ export function bindContributionProvider(bind, id) {
|
|
|
17
17
|
export function bindContributionProviderNoSingletonScope(bind, id) {
|
|
18
18
|
bind(ContributionProvider).toDynamicValue((({container: container}) => new ContributionProviderCache(id, container))).whenTargetNamed(id);
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=contribution-provider.js.map
|
|
20
|
+
//# sourceMappingURL=contribution-provider.js.map
|
|
@@ -335,4 +335,4 @@ function scale(current, sX, sY) {
|
|
|
335
335
|
temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
|
|
336
336
|
return temp;
|
|
337
337
|
}
|
|
338
|
-
//# sourceMappingURL=custom-path2d.js.map
|
|
338
|
+
//# sourceMappingURL=custom-path2d.js.map
|
package/es/common/enums.js
CHANGED
|
@@ -70,4 +70,4 @@ export var BaseRenderContributionTime;
|
|
|
70
70
|
BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
|
|
71
71
|
BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
|
|
72
72
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
73
|
-
//# sourceMappingURL=enums.js.map
|
|
73
|
+
//# sourceMappingURL=enums.js.map
|
package/es/common/generator.js
CHANGED
package/es/common/matrix.js
CHANGED
|
@@ -45,4 +45,4 @@ export function transformMat4(out, a, m) {
|
|
|
45
45
|
return w = w || 1, out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w, out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w,
|
|
46
46
|
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
|
|
47
47
|
}
|
|
48
|
-
//# sourceMappingURL=matrix.js.map
|
|
48
|
+
//# sourceMappingURL=matrix.js.map
|
package/es/common/path-svg.js
CHANGED
package/es/common/polygon.js
CHANGED
package/es/common/render-area.js
CHANGED
package/es/common/seg-context.js
CHANGED
package/es/common/sort.js
CHANGED
package/es/common/split-path.js
CHANGED
package/es/common/store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
class StageStore {}
|
|
2
|
-
//# sourceMappingURL=store.js.map
|
|
2
|
+
//# sourceMappingURL=store.js.map
|
package/es/common/text.js
CHANGED
|
@@ -16,4 +16,4 @@ export function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
|
16
16
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight),
|
|
17
17
|
-(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=text.js.map
|
|
19
|
+
//# sourceMappingURL=text.js.map
|
package/es/common/utils.js
CHANGED
package/es/core/camera.js
CHANGED
package/es/core/global-module.js
CHANGED
package/es/core/global.js
CHANGED
|
@@ -174,4 +174,4 @@ let DefaultGlobal = class {
|
|
|
174
174
|
DefaultGlobal = __decorate([ injectable(), __param(0, inject(ContributionProvider)), __param(0, named(EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal);
|
|
175
175
|
|
|
176
176
|
export { DefaultGlobal };
|
|
177
|
-
//# sourceMappingURL=global.js.map
|
|
177
|
+
//# sourceMappingURL=global.js.map
|
package/es/core/graphic-utils.js
CHANGED
|
@@ -143,4 +143,4 @@ let DefaultTransformUtil = class {
|
|
|
143
143
|
DefaultTransformUtil = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultTransformUtil);
|
|
144
144
|
|
|
145
145
|
export { DefaultTransformUtil };
|
|
146
|
-
//# sourceMappingURL=graphic-utils.js.map
|
|
146
|
+
//# sourceMappingURL=graphic-utils.js.map
|
package/es/core/index.js
CHANGED
package/es/core/layer-service.js
CHANGED
|
@@ -79,4 +79,4 @@ let DefaultLayerService = class {
|
|
|
79
79
|
DefaultLayerService = __decorate([ injectable(), __param(0, inject(VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService);
|
|
80
80
|
|
|
81
81
|
export { DefaultLayerService };
|
|
82
|
-
//# sourceMappingURL=layer-service.js.map
|
|
82
|
+
//# sourceMappingURL=layer-service.js.map
|
package/es/core/layer.js
CHANGED
package/es/core/light.js
CHANGED
|
@@ -17,4 +17,4 @@ export class DirectionalLight {
|
|
|
17
17
|
return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=light.js.map
|
|
20
|
+
//# sourceMappingURL=light.js.map
|
package/es/core/stage.js
CHANGED
package/es/core/window.js
CHANGED
|
@@ -127,4 +127,4 @@ __decorate([ postConstruct(), __metadata("design:type", Function), __metadata("d
|
|
|
127
127
|
DefaultWindow = __decorate([ injectable(), __param(0, inject(VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultWindow);
|
|
128
128
|
|
|
129
129
|
export { DefaultWindow };
|
|
130
|
-
//# sourceMappingURL=window.js.map
|
|
130
|
+
//# sourceMappingURL=window.js.map
|
package/es/event/constant.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const WILDCARD = "*";
|
|
2
|
-
//# sourceMappingURL=constant.js.map
|
|
2
|
+
//# sourceMappingURL=constant.js.map
|
package/es/event/event-system.js
CHANGED
package/es/event/event-target.js
CHANGED
package/es/event/index.js
CHANGED
package/es/event/util.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const clock = "object" == typeof performance && performance.now ? performance : Date;
|
|
2
|
-
//# sourceMappingURL=util.js.map
|
|
2
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -55,7 +55,6 @@ builtinSymbols.forEach((symbol => {
|
|
|
55
55
|
export const builtInSymbolStrMap = {
|
|
56
56
|
arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
|
|
57
57
|
arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
|
|
58
|
-
rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
|
|
59
58
|
rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
|
|
60
59
|
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 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AAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,YAAY;IACZ,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,GAAG;IACH,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACX,QAAQ;IACR,UAAU;IACV,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAiC,EAAE,CAAC;AAElE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,mCAAmC;IAE/C,SAAS,EAEP,8PAA8P;IAChQ,SAAS,EACP,sNAAsN;CACzN,CAAC;AAEF,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport arrow2Up from './arrow2-up';\nimport arrow2Down from './arrow2-down';\nimport lineV from './line-v';\nimport lineH from './line-h';\nimport close from './close';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n arrow2Up,\n arrow2Down,\n rect,\n lineV,\n lineH,\n close\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport const builtInSymbolStrMap: Record<string, string> = {\n arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',\n arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',\n // rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',\n rectRound:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n roundLine:\n 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'\n};\n\nexport * from './utils';\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
|
|
2
2
|
import { BaseSymbol } from './base';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number): boolean;
|
|
4
|
+
export declare function rectSize(ctx: IContext2d, size: number, x: number, y: number): boolean;
|
|
4
5
|
export declare class RectSymbol extends BaseSymbol implements ISymbolClass {
|
|
5
6
|
type: SymbolType;
|
|
6
7
|
pathStr: string;
|
|
@@ -2,19 +2,24 @@ import { isNumber } from "@visactor/vutils";
|
|
|
2
2
|
|
|
3
3
|
import { BaseSymbol } from "./base";
|
|
4
4
|
|
|
5
|
-
export function
|
|
5
|
+
export function rectSizeArray(ctx, size, x, y) {
|
|
6
6
|
return ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]), !1;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export function rectSize(ctx, size, x, y) {
|
|
10
|
+
const w = size, h = size / 2;
|
|
11
|
+
return ctx.rect(x - w / 2, y - h / 2, w, h), !1;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
export class RectSymbol extends BaseSymbol {
|
|
10
15
|
constructor() {
|
|
11
|
-
super(...arguments), this.type = "rect", this.pathStr = "M-0.5,-0.
|
|
16
|
+
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
12
17
|
}
|
|
13
18
|
draw(ctx, size, x, y) {
|
|
14
|
-
return
|
|
19
|
+
return isNumber(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
15
20
|
}
|
|
16
21
|
drawOffset(ctx, size, x, y, offset) {
|
|
17
|
-
return
|
|
22
|
+
return isNumber(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [ size[0] + 2 * offset, size[1] + 2 * offset ], x, y);
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,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AGxC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC/F,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/C;QACD,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;CACF;AAED,eAAe,IAAI,UAAU,EAAE,CAAC","file":"rect.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number) {\n ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n return false;\n}\n\nexport function rectSize(ctx: IContext2d, size: number, x: number, y: number) {\n const w = size;\n const h = size / 2;\n ctx.rect(x - w / 2, y - h / 2, w, h);\n return false;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class RectSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'rect';\n pathStr: string = 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z';\n\n draw(ctx: IContext2d, size: number | [number, number], x: number, y: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size, x, y);\n }\n return rectSizeArray(ctx, size, x, y);\n // const rectSize: [number, number] = ? [size, size] : size;\n // return rect(ctx, rectSize, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number | [number, number], x: number, y: number, offset: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size + 2 * offset, x, y);\n }\n return rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);\n }\n}\n\nexport default new RectSymbol();\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=allocator.js.map
|
|
2
|
+
//# sourceMappingURL=allocator.js.map
|
package/es/interface/animate.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=animate.js.map
|
|
2
|
+
//# sourceMappingURL=animate.js.map
|
package/es/interface/camera.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=camera.js.map
|
|
2
|
+
//# sourceMappingURL=camera.js.map
|
package/es/interface/canvas.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=canvas.js.map
|
|
2
|
+
//# sourceMappingURL=canvas.js.map
|
package/es/interface/color.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=color.js.map
|
|
2
|
+
//# sourceMappingURL=color.js.map
|
package/es/interface/common.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=common.js.map
|
|
2
|
+
//# sourceMappingURL=common.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-core",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"color-convert": "2.0.1",
|
|
16
|
-
"@visactor/vutils": "~0.16.
|
|
16
|
+
"@visactor/vutils": "~0.16.10"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"vite": "3.2.6",
|
|
32
32
|
"typescript": "4.9.5",
|
|
33
33
|
"@internal/bundler": "0.0.1",
|
|
34
|
-
"@internal/
|
|
35
|
-
"@internal/
|
|
34
|
+
"@internal/eslint-config": "0.0.1",
|
|
35
|
+
"@internal/ts-config": "0.0.1"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"VisActor",
|