@visactor/vrender-core 0.17.23-alpha.1 → 0.17.24-alpha.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/common/custom-path2d.d.ts +1 -0
- package/cjs/common/custom-path2d.js +5 -1
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/graphic/arc.js +12 -6
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/config.js +3 -0
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +6 -5
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +2 -1
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -1
- package/cjs/graphic/group.js +2 -2
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/node-tree.d.ts +1 -1
- package/cjs/graphic/node-tree.js +3 -2
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/theme.js +1 -1
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/interface/graphic/arc.d.ts +2 -0
- package/cjs/interface/graphic/arc.js.map +1 -1
- package/cjs/interface/graphic.d.ts +2 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/node-tree.d.ts +1 -1
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +24 -20
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.js +3 -1
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/arc3d-render.js +4 -1
- package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +4 -2
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +4 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +13 -6
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/module.js.map +1 -1
- package/es/common/custom-path2d.d.ts +1 -0
- package/es/common/custom-path2d.js +5 -1
- package/es/common/custom-path2d.js.map +1 -1
- package/es/graphic/arc.js +12 -5
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/config.js +3 -0
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +6 -5
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +2 -1
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -1
- package/es/graphic/group.js +2 -2
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/node-tree.d.ts +1 -1
- package/es/graphic/node-tree.js +3 -2
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/theme.js +1 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/interface/graphic/arc.d.ts +2 -0
- package/es/interface/graphic/arc.js.map +1 -1
- package/es/interface/graphic.d.ts +2 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/node-tree.d.ts +1 -1
- package/es/interface/node-tree.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +24 -20
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/render/contributions/render/arc-render.js +3 -1
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/arc3d-render.js +4 -1
- package/es/render/contributions/render/arc3d-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +4 -2
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js +4 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +1 -1
- package/es/render/contributions/render/draw-contribution.js +13 -6
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/module.js.map +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ export declare class CustomPath2D extends CurvePath implements ICustomPath2D {
|
|
|
21
21
|
closePath(): this;
|
|
22
22
|
addCurve(curve: ICurve<IPoint>): void;
|
|
23
23
|
clear(): void;
|
|
24
|
+
beginPath(): void;
|
|
24
25
|
toString(): string;
|
|
25
26
|
fromString(str: string, x?: number, y?: number, sX?: number, sY?: number): this;
|
|
26
27
|
fromLine(line: ILine): void;
|
|
@@ -57,6 +57,9 @@ class CustomPath2D extends path_1.CurvePath {
|
|
|
57
57
|
clear() {
|
|
58
58
|
this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
|
|
59
59
|
}
|
|
60
|
+
beginPath() {
|
|
61
|
+
this.clear();
|
|
62
|
+
}
|
|
60
63
|
toString() {
|
|
61
64
|
if (!this.toStringCbList) {
|
|
62
65
|
const list = [];
|
|
@@ -69,7 +72,8 @@ class CustomPath2D extends path_1.CurvePath {
|
|
|
69
72
|
let path = "";
|
|
70
73
|
for (let i = 0; i < bezierPathList.length; i += 6) path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${bezierPathList[i + 4]} ${bezierPathList[i + 5]}`;
|
|
71
74
|
return path;
|
|
72
|
-
}, list[path_svg_1.enumCommandMap.
|
|
75
|
+
}, list[path_svg_1.enumCommandMap.R] = cmd => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`,
|
|
76
|
+
list[path_svg_1.enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
|
|
73
77
|
}
|
|
74
78
|
const list = this.toStringCbList;
|
|
75
79
|
let path = "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/custom-path2d.ts"],"names":[],"mappings":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CAAC;QACtC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;QACtC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAW,CAAC;QAC/B,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAW,CAAC;QAC/B,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAW,CAAC;QAC/B,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;QACtC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;KACvC;SAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;KACvC;SAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;KACvC;SAAM;QACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;YAC9C,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;SAC5D;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"custom-path2d.js","sourcesContent":["import { BoundsContext } from './bounds-context';\nimport type { CommandStrType, CommandType, ICurve, ICustomPath2D, IDirection, ILine, IPath2D } from '../interface';\nimport { CurvePath } from './segment/curve/path';\nimport { enumCommandMap, parseSvgPath } from './path-svg';\nimport type { IPoint, IPointLike } from '@visactor/vutils';\nimport { abs } from '@visactor/vutils';\nimport { Direction } from './enums';\nimport { drawArc, addArcToBezierPath } from './shape/arc';\nimport { renderCommandList } from './render-command-list';\nimport { calcLineCache } from './segment';\n\n/**\n * 部分源码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 基于d3-shape重构\n// https://github.com/vega/vega/blob/master/packages/vega-scenegraph/src/path/render.js\n\nexport class CustomPath2D extends CurvePath implements ICustomPath2D {\n commandList: CommandType[] = [];\n _boundsContext: IPath2D;\n _ctx?: IPath2D;\n direction?: IDirection;\n protected transformCbList?: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[];\n protected toStringCbList?: ((cmd: CommandType) => string)[];\n\n constructor(ctx?: IPath2D) {\n super();\n if (ctx) {\n this._ctx = ctx;\n }\n this._boundsContext = new BoundsContext(this.bounds);\n }\n\n setCtx(ctx?: IPath2D) {\n this._ctx = ctx;\n }\n\n moveTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.M, x, y]);\n this._ctx && this._ctx.moveTo(x, y);\n return this;\n }\n lineTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.L, x, y]);\n this._ctx && this._ctx.lineTo(x, y);\n return this;\n }\n quadraticCurveTo(aCPx: number, aCPy: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.Q, aCPx, aCPy, aX, aY]);\n this._ctx && this._ctx.quadraticCurveTo(aCPx, aCPy, aX, aY);\n return this;\n }\n bezierCurveTo(aCP1x: number, aCP1y: number, aCP2x: number, aCP2y: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.C, aCP1x, aCP1y, aCP2x, aCP2y, aX, aY]);\n this._ctx && this._ctx.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n return this;\n }\n arcTo(aX1: number, aY1: number, aX2: number, aY2: number, aRadius: number) {\n this.commandList.push([enumCommandMap.AT, aX1, aY1, aX2, aY2, aRadius]);\n this._ctx && this._ctx.arcTo(aX1, aY1, aX2, aY2, aRadius);\n return this;\n }\n ellipse(\n aX: number,\n aY: number,\n xRadius: number,\n yRadius: number,\n aRotation: number,\n aStartAngle: number,\n aEndAngle: number,\n aClockwise: boolean\n ) {\n this.commandList.push([enumCommandMap.E, aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise]);\n this._ctx && this._ctx.ellipse(aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise);\n return this;\n }\n rect(x: number, y: number, w: number, h: number) {\n this.commandList.push([enumCommandMap.R, x, y, w, h]);\n this._ctx && this._ctx.rect(x, y, w, h);\n return this;\n }\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean) {\n this.commandList.push([enumCommandMap.A, x, y, radius, startAngle, endAngle, counterclockwise]);\n this._ctx && this._ctx.arc(x, y, radius, startAngle, endAngle, counterclockwise);\n return this;\n }\n closePath() {\n this.commandList.push([enumCommandMap.Z]);\n this._ctx && this._ctx.closePath();\n return this;\n }\n\n addCurve(curve: ICurve<IPoint>) {\n this.curves.push(curve);\n // todo parse curve\n }\n clear() {\n this.transformCbList = null;\n this.commandList.length = 0;\n this.curves.length = 0;\n }\n\n toString(): string {\n if (!this.toStringCbList) {\n const list: ((cmd: CommandType) => string)[] = [];\n list[enumCommandMap.M] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.L] = (cmd: CommandType) => `L${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.Q] = (cmd: CommandType) => `Q${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]}`;\n list[enumCommandMap.C] = (cmd: CommandType) => `C${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]} ${cmd[5]} ${cmd[6]}`;\n list[enumCommandMap.A] = (cmd: CommandType) => {\n const bezierPathList: number[] = [];\n addArcToBezierPath(\n bezierPathList,\n cmd[4] as number,\n cmd[5] as number,\n cmd[1] as number,\n cmd[2] as number,\n cmd[3] as number,\n cmd[3] as number\n );\n let path = '';\n for (let i = 0; i < bezierPathList.length; i += 6) {\n path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${\n bezierPathList[i + 4]\n } ${bezierPathList[i + 5]}`;\n }\n return path;\n };\n // list[enumCommandMap.AT] = this.arcToTransform;\n // list[enumCommandMap.E] = this.ellipseTransform;\n // list[enumCommandMap.R] = this.rectTransform;\n // list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = (cmd: CommandType) => `Z`;\n this.toStringCbList = list;\n }\n\n const list = this.toStringCbList;\n let path = '';\n this.commandList.forEach(c => {\n path += list[c[0]](c);\n });\n return path;\n }\n\n fromString(str: string, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n\n // 解析path字符串\n const commandStrList = parseSvgPath(str) as CommandStrType[]; // TODO: 目前正则性能较差,后续需要加上回调函数供用户直接操作绘图命令\n this._runCommandStrList(commandStrList, x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n fromLine(line: ILine) {\n const { points, curveType, clipRangeByDimension } = line.attribute;\n if (!points) {\n return;\n }\n const cache = calcLineCache(points, curveType);\n if (clipRangeByDimension === 'x') {\n this.direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n this.direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n this.direction = cache.direction;\n }\n this.curves = cache.curves;\n }\n fromCustomPath2D(path: ICustomPath2D, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n this._runCommandList(path.commandList as CommandType[], x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n transform(x: number, y: number, sx: number, sy: number) {\n const commandList = this.commandList;\n if (!this.transformCbList) {\n const list: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[] = [];\n list[enumCommandMap.M] = this.moveToTransform;\n list[enumCommandMap.L] = this.lineToTransform;\n list[enumCommandMap.Q] = this.quadraticCurveToTransform;\n list[enumCommandMap.C] = this.bezierCurveToTransform;\n list[enumCommandMap.AT] = this.arcToTransform;\n list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = this.rectTransform;\n list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = this.closePathTransform;\n this.transformCbList = list;\n }\n commandList.forEach(cmd => {\n this.transformCbList[cmd[0]](cmd, x, y, sx, sy);\n });\n this._updateBounds();\n }\n\n protected moveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected lineToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected quadraticCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n }\n protected bezierCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = (cmd[5] as number) * sx + x;\n cmd[6] = (cmd[6] as number) * sy + y;\n }\n arcToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = ((cmd[5] as number) * (sx + sy)) / 2;\n }\n ellipseTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n rectTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n arcTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = ((cmd[3] as number) * (sx + sy)) / 2;\n }\n closePathTransform() {\n return;\n }\n protected _runCommandStrList(\n commandStrList: CommandStrType[],\n l: number = 0,\n t: number = 0,\n sX: number = 1,\n sY: number = 1\n ) {\n let current; // current instruction\n let previous = null;\n let x = 0; // current x\n let y = 0; // current y\n // let sX = 0;\n // let sY = 0;\n let controlX = 0; // current control point x\n let controlY = 0; // current control point y\n let tempX;\n let tempY;\n let tempControlX;\n let tempControlY;\n\n // if (isNil(l)) l = 0;\n // if (isNil(t)) t = 0;\n // if (isNil(sX)) sX = 1;\n // if (isNil(sY)) sY = sX;\n\n for (let i = 0, len = commandStrList.length; i < len; ++i) {\n current = commandStrList[i];\n if (sX !== 1 || sY !== 1) {\n current = scale(current, sX, sY);\n }\n\n switch (\n current[0] // first letter\n ) {\n case 'l': // lineto, relative\n x += current[1] as number;\n y += current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'L': // lineto, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'h': // horizontal lineto, relative\n x += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'H': // horizontal lineto, absolute\n x = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'v': // vertical lineto, relative\n y += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'V': // verical lineto, absolute\n y = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'm': // moveTo, relative\n x += current[1] as number;\n y += current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'M': // moveTo, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'c': // bezierCurveTo, relative\n tempX = x + (current[5] as number);\n tempY = y + (current[6] as number);\n controlX = x + (current[3] as number);\n controlY = y + (current[4] as number);\n this.bezierCurveTo(\n x + (current[1] as number) + l, // x1\n y + (current[2] as number) + t, // y1\n controlX + l, // x2\n controlY + t, // y2\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n break;\n\n case 'C': // bezierCurveTo, absolute\n x = current[5] as number;\n y = current[6] as number;\n controlX = current[3] as number;\n controlY = current[4] as number;\n this.bezierCurveTo(\n (current[1] as number) + l,\n (current[2] as number) + t,\n controlX + l,\n controlY + t,\n x + l,\n y + t\n );\n break;\n\n case 's': // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n x + (current[1] as number) + l,\n y + (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n x = tempX;\n y = tempY;\n break;\n\n case 'S': // shorthand cubic bezierCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n (current[1] as number) + l,\n (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1] as number;\n controlY = current[2] as number;\n\n break;\n\n case 'q': // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'Q': // quadraticCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n\n this.quadraticCurveTo((current[1] as number) + l, (current[2] as number) + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1] as number;\n controlY = current[2] as number;\n break;\n\n case 't': // shorthand quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[1] as number);\n tempY = y + (current[2] as number);\n\n if ((previous![0] as string).match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous![0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - (tempControlX as number);\n controlY = 2 * y - (tempControlY as number);\n } else if (previous![0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n\n tempControlX = controlX;\n tempControlY = controlY;\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n break;\n\n case 'T':\n tempX = current[1] as number;\n tempY = current[2] as number;\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'a':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + x + l,\n (current[7] as number) + y + t\n ]);\n x += current[6] as number;\n y += current[7] as number;\n break;\n\n case 'A':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + l,\n (current[7] as number) + t\n ]);\n x = current[6] as number;\n y = current[7] as number;\n break;\n\n case 'z':\n case 'Z':\n this.closePath();\n break;\n }\n previous = current;\n }\n }\n\n protected _runCommandList(commandList: CommandType[], l: number = 0, t: number = 0, sX: number = 1, sY: number = 1) {\n if (l === 0 && t === 0 && sX === 1 && sY === 1) {\n this.commandList = commandList.map(entry => entry.slice() as CommandType);\n return;\n }\n\n for (let i = 0, len = commandList.length; i < len; ++i) {\n const current = commandList[i].slice() as CommandType;\n\n switch (\n current[0] // first letter\n ) {\n case enumCommandMap.L:\n this.lineToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.M:\n this.moveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.C:\n this.bezierCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.Q:\n this.quadraticCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.A:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.E:\n this.ellipseTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.R:\n this.rectTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.AT:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.Z:\n this.closePath();\n break;\n }\n }\n }\n private _updateBounds() {\n this.bounds.clear();\n renderCommandList(this.commandList, this._boundsContext as unknown as ICustomPath2D);\n }\n\n release(): void {\n this.commandList = [];\n this._boundsContext = null;\n this._ctx = null;\n }\n\n getLength(): number {\n if (this.direction === Direction.COLUMN) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.y - ec.p1.y);\n } else if (this.direction === Direction.ROW) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.x - ec.p1.x);\n }\n return this.curves.reduce((l, c) => l + c.getLength(), 0);\n }\n\n getAttrAt(distance: number): { pos: IPointLike; angle: number } {\n if (!this.curves) {\n return { pos: { x: 0, y: 0 }, angle: 0 };\n }\n let _dis = 0;\n let curve: ICurve<IPoint>;\n for (let i = 0; i < this.curves.length; i++) {\n curve = this.curves[i];\n const cl = curve.getLength(this.direction);\n if (_dis + cl >= distance) {\n break;\n } else {\n _dis += cl;\n }\n }\n const t = (distance - _dis) / curve.getLength(this.direction);\n const pos = curve.getPointAt(t);\n const angle = curve.getAngleAt(t);\n return { pos, angle };\n }\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\n\nfunction scale(current: CommandStrType, sX: number, sY: number) {\n const c = (temp[0] = current[0]);\n if (c === 'a' || c === 'A') {\n temp[1] = sX * (current[1] as number);\n temp[2] = sY * (current[2] as number);\n temp[3] = current[3] as number;\n temp[4] = current[4] as number;\n temp[5] = current[5] as number;\n temp[6] = sX * (current[6] as number);\n temp[7] = sY * (current[7] as number);\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * (current[1] as number);\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * (current[1] as number);\n } else {\n for (let i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 === 1 ? sX : sY) * (current[i] as number);\n }\n }\n return temp;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/common/custom-path2d.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,+CAAiD;AACjD,yCAA0D;AAE1D,6CAAuC;AACvC,mCAAoC;AACpC,qCAA0D;AAC1D,+DAA0D;AAC1D,uCAA0C;AAqB1C,MAAa,YAAa,SAAQ,gBAAS;IAQzC,YAAY,GAAa;QACvB,KAAK,EAAE,CAAC;QARV,gBAAW,GAAkB,EAAE,CAAC;QAS9B,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;SACjB;QACD,IAAI,CAAC,cAAc,GAAG,IAAI,8BAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,GAAa;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,yBAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,CAAC,CAAS,EAAE,CAAS;QACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,yBAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,gBAAgB,CA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M;QACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;YAC9C,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,OAAO,CAAC,CAAC,CAAY,CAAC;SAC5D;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"custom-path2d.js","sourcesContent":["import { BoundsContext } from './bounds-context';\nimport type { CommandStrType, CommandType, ICurve, ICustomPath2D, IDirection, ILine, IPath2D } from '../interface';\nimport { CurvePath } from './segment/curve/path';\nimport { enumCommandMap, parseSvgPath } from './path-svg';\nimport type { IPoint, IPointLike } from '@visactor/vutils';\nimport { abs } from '@visactor/vutils';\nimport { Direction } from './enums';\nimport { drawArc, addArcToBezierPath } from './shape/arc';\nimport { renderCommandList } from './render-command-list';\nimport { calcLineCache } from './segment';\n\n/**\n * 部分源码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 基于d3-shape重构\n// https://github.com/vega/vega/blob/master/packages/vega-scenegraph/src/path/render.js\n\nexport class CustomPath2D extends CurvePath implements ICustomPath2D {\n commandList: CommandType[] = [];\n _boundsContext: IPath2D;\n _ctx?: IPath2D;\n direction?: IDirection;\n protected transformCbList?: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[];\n protected toStringCbList?: ((cmd: CommandType) => string)[];\n\n constructor(ctx?: IPath2D) {\n super();\n if (ctx) {\n this._ctx = ctx;\n }\n this._boundsContext = new BoundsContext(this.bounds);\n }\n\n setCtx(ctx?: IPath2D) {\n this._ctx = ctx;\n }\n\n moveTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.M, x, y]);\n this._ctx && this._ctx.moveTo(x, y);\n return this;\n }\n lineTo(x: number, y: number) {\n this.commandList.push([enumCommandMap.L, x, y]);\n this._ctx && this._ctx.lineTo(x, y);\n return this;\n }\n quadraticCurveTo(aCPx: number, aCPy: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.Q, aCPx, aCPy, aX, aY]);\n this._ctx && this._ctx.quadraticCurveTo(aCPx, aCPy, aX, aY);\n return this;\n }\n bezierCurveTo(aCP1x: number, aCP1y: number, aCP2x: number, aCP2y: number, aX: number, aY: number) {\n this.commandList.push([enumCommandMap.C, aCP1x, aCP1y, aCP2x, aCP2y, aX, aY]);\n this._ctx && this._ctx.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n return this;\n }\n arcTo(aX1: number, aY1: number, aX2: number, aY2: number, aRadius: number) {\n this.commandList.push([enumCommandMap.AT, aX1, aY1, aX2, aY2, aRadius]);\n this._ctx && this._ctx.arcTo(aX1, aY1, aX2, aY2, aRadius);\n return this;\n }\n ellipse(\n aX: number,\n aY: number,\n xRadius: number,\n yRadius: number,\n aRotation: number,\n aStartAngle: number,\n aEndAngle: number,\n aClockwise: boolean\n ) {\n this.commandList.push([enumCommandMap.E, aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise]);\n this._ctx && this._ctx.ellipse(aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise);\n return this;\n }\n rect(x: number, y: number, w: number, h: number) {\n this.commandList.push([enumCommandMap.R, x, y, w, h]);\n this._ctx && this._ctx.rect(x, y, w, h);\n return this;\n }\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean) {\n this.commandList.push([enumCommandMap.A, x, y, radius, startAngle, endAngle, counterclockwise]);\n this._ctx && this._ctx.arc(x, y, radius, startAngle, endAngle, counterclockwise);\n return this;\n }\n closePath() {\n this.commandList.push([enumCommandMap.Z]);\n this._ctx && this._ctx.closePath();\n return this;\n }\n\n addCurve(curve: ICurve<IPoint>) {\n this.curves.push(curve);\n // todo parse curve\n }\n clear() {\n this.transformCbList = null;\n this.commandList.length = 0;\n this.curves.length = 0;\n }\n\n beginPath() {\n this.clear();\n }\n\n toString(): string {\n if (!this.toStringCbList) {\n const list: ((cmd: CommandType) => string)[] = [];\n list[enumCommandMap.M] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.L] = (cmd: CommandType) => `L${cmd[1]} ${cmd[2]}`;\n list[enumCommandMap.Q] = (cmd: CommandType) => `Q${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]}`;\n list[enumCommandMap.C] = (cmd: CommandType) => `C${cmd[1]} ${cmd[2]} ${cmd[3]} ${cmd[4]} ${cmd[5]} ${cmd[6]}`;\n list[enumCommandMap.A] = (cmd: CommandType) => {\n const bezierPathList: number[] = [];\n addArcToBezierPath(\n bezierPathList,\n cmd[4] as number,\n cmd[5] as number,\n cmd[1] as number,\n cmd[2] as number,\n cmd[3] as number,\n cmd[3] as number\n );\n let path = '';\n for (let i = 0; i < bezierPathList.length; i += 6) {\n path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${\n bezierPathList[i + 4]\n } ${bezierPathList[i + 5]}`;\n }\n return path;\n };\n // list[enumCommandMap.AT] = this.arcToTransform;\n // list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = (cmd: CommandType) => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`;\n // list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = (cmd: CommandType) => `Z`;\n this.toStringCbList = list;\n }\n\n const list = this.toStringCbList;\n let path = '';\n this.commandList.forEach(c => {\n path += list[c[0]](c);\n });\n return path;\n }\n\n fromString(str: string, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n\n // 解析path字符串\n const commandStrList = parseSvgPath(str) as CommandStrType[]; // TODO: 目前正则性能较差,后续需要加上回调函数供用户直接操作绘图命令\n this._runCommandStrList(commandStrList, x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n fromLine(line: ILine) {\n const { points, curveType, clipRangeByDimension } = line.attribute;\n if (!points) {\n return;\n }\n const cache = calcLineCache(points, curveType);\n if (clipRangeByDimension === 'x') {\n this.direction = Direction.ROW;\n } else if (clipRangeByDimension === 'y') {\n this.direction = Direction.COLUMN;\n } else if (clipRangeByDimension === 'auto') {\n this.direction = cache.direction;\n }\n this.curves = cache.curves;\n }\n fromCustomPath2D(path: ICustomPath2D, x?: number, y?: number, sX?: number, sY?: number) {\n this.clear();\n this._runCommandList(path.commandList as CommandType[], x, y, sX, sY);\n\n // 更新bounds\n this._updateBounds();\n return this;\n }\n transform(x: number, y: number, sx: number, sy: number) {\n const commandList = this.commandList;\n if (!this.transformCbList) {\n const list: ((cmd: CommandType, x: number, y: number, sx: number, sy: number) => void)[] = [];\n list[enumCommandMap.M] = this.moveToTransform;\n list[enumCommandMap.L] = this.lineToTransform;\n list[enumCommandMap.Q] = this.quadraticCurveToTransform;\n list[enumCommandMap.C] = this.bezierCurveToTransform;\n list[enumCommandMap.AT] = this.arcToTransform;\n list[enumCommandMap.E] = this.ellipseTransform;\n list[enumCommandMap.R] = this.rectTransform;\n list[enumCommandMap.A] = this.arcTransform;\n list[enumCommandMap.Z] = this.closePathTransform;\n this.transformCbList = list;\n }\n commandList.forEach(cmd => {\n this.transformCbList[cmd[0]](cmd, x, y, sx, sy);\n });\n this._updateBounds();\n }\n\n protected moveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected lineToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n }\n protected quadraticCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n }\n protected bezierCurveToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = (cmd[5] as number) * sx + x;\n cmd[6] = (cmd[6] as number) * sy + y;\n }\n arcToTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx + x;\n cmd[4] = (cmd[4] as number) * sy + y;\n cmd[5] = ((cmd[5] as number) * (sx + sy)) / 2;\n }\n ellipseTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n rectTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = (cmd[3] as number) * sx;\n cmd[4] = (cmd[4] as number) * sy;\n }\n arcTransform(cmd: CommandType, x: number, y: number, sx: number, sy: number) {\n cmd[1] = (cmd[1] as number) * sx + x;\n cmd[2] = (cmd[2] as number) * sy + y;\n cmd[3] = ((cmd[3] as number) * (sx + sy)) / 2;\n }\n closePathTransform() {\n return;\n }\n protected _runCommandStrList(\n commandStrList: CommandStrType[],\n l: number = 0,\n t: number = 0,\n sX: number = 1,\n sY: number = 1\n ) {\n let current; // current instruction\n let previous = null;\n let x = 0; // current x\n let y = 0; // current y\n // let sX = 0;\n // let sY = 0;\n let controlX = 0; // current control point x\n let controlY = 0; // current control point y\n let tempX;\n let tempY;\n let tempControlX;\n let tempControlY;\n\n // if (isNil(l)) l = 0;\n // if (isNil(t)) t = 0;\n // if (isNil(sX)) sX = 1;\n // if (isNil(sY)) sY = sX;\n\n for (let i = 0, len = commandStrList.length; i < len; ++i) {\n current = commandStrList[i];\n if (sX !== 1 || sY !== 1) {\n current = scale(current, sX, sY);\n }\n\n switch (\n current[0] // first letter\n ) {\n case 'l': // lineto, relative\n x += current[1] as number;\n y += current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'L': // lineto, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'h': // horizontal lineto, relative\n x += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'H': // horizontal lineto, absolute\n x = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'v': // vertical lineto, relative\n y += current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'V': // verical lineto, absolute\n y = current[1] as number;\n this.lineTo(x + l, y + t);\n break;\n\n case 'm': // moveTo, relative\n x += current[1] as number;\n y += current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'M': // moveTo, absolute\n x = current[1] as number;\n y = current[2] as number;\n this.moveTo(x + l, y + t);\n break;\n\n case 'c': // bezierCurveTo, relative\n tempX = x + (current[5] as number);\n tempY = y + (current[6] as number);\n controlX = x + (current[3] as number);\n controlY = y + (current[4] as number);\n this.bezierCurveTo(\n x + (current[1] as number) + l, // x1\n y + (current[2] as number) + t, // y1\n controlX + l, // x2\n controlY + t, // y2\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n break;\n\n case 'C': // bezierCurveTo, absolute\n x = current[5] as number;\n y = current[6] as number;\n controlX = current[3] as number;\n controlY = current[4] as number;\n this.bezierCurveTo(\n (current[1] as number) + l,\n (current[2] as number) + t,\n controlX + l,\n controlY + t,\n x + l,\n y + t\n );\n break;\n\n case 's': // shorthand cubic bezierCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n x + (current[1] as number) + l,\n y + (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n x = tempX;\n y = tempY;\n break;\n\n case 'S': // shorthand cubic bezierCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.bezierCurveTo(\n controlX + l,\n controlY + t,\n (current[1] as number) + l,\n (current[2] as number) + t,\n tempX + l,\n tempY + t\n );\n x = tempX;\n y = tempY;\n // set control point to 2nd one of this command\n // the first control point is assumed to be the reflection of\n // the second control point on the previous command relative\n // to the current point.\n controlX = current[1] as number;\n controlY = current[2] as number;\n\n break;\n\n case 'q': // quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[3] as number);\n tempY = y + (current[4] as number);\n\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'Q': // quadraticCurveTo, absolute\n tempX = current[3] as number;\n tempY = current[4] as number;\n\n this.quadraticCurveTo((current[1] as number) + l, (current[2] as number) + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = current[1] as number;\n controlY = current[2] as number;\n break;\n\n case 't': // shorthand quadraticCurveTo, relative\n // transform to absolute x,y\n tempX = x + (current[1] as number);\n tempY = y + (current[2] as number);\n\n if ((previous![0] as string).match(/[QqTt]/) === null) {\n // If there is no previous command or if the previous command was not a Q, q, T or t,\n // assume the control point is coincident with the current point\n controlX = x;\n controlY = y;\n } else if (previous![0] === 't') {\n // calculate reflection of previous control points for t\n controlX = 2 * x - (tempControlX as number);\n controlY = 2 * y - (tempControlY as number);\n } else if (previous![0] === 'q') {\n // calculate reflection of previous control points for q\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n }\n\n tempControlX = controlX;\n tempControlY = controlY;\n\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n controlX = x + (current[1] as number);\n controlY = y + (current[2] as number);\n break;\n\n case 'T':\n tempX = current[1] as number;\n tempY = current[2] as number;\n\n // calculate reflection of previous control points\n controlX = 2 * x - controlX;\n controlY = 2 * y - controlY;\n this.quadraticCurveTo(controlX + l, controlY + t, tempX + l, tempY + t);\n x = tempX;\n y = tempY;\n break;\n\n case 'a':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + x + l,\n (current[7] as number) + y + t\n ]);\n x += current[6] as number;\n y += current[7] as number;\n break;\n\n case 'A':\n drawArc(this, x + l, y + t, [\n current[1] as number,\n current[2] as number,\n current[3] as number,\n current[4] as number,\n current[5] as number,\n (current[6] as number) + l,\n (current[7] as number) + t\n ]);\n x = current[6] as number;\n y = current[7] as number;\n break;\n\n case 'z':\n case 'Z':\n this.closePath();\n break;\n }\n previous = current;\n }\n }\n\n protected _runCommandList(commandList: CommandType[], l: number = 0, t: number = 0, sX: number = 1, sY: number = 1) {\n if (l === 0 && t === 0 && sX === 1 && sY === 1) {\n this.commandList = commandList.map(entry => entry.slice() as CommandType);\n return;\n }\n\n for (let i = 0, len = commandList.length; i < len; ++i) {\n const current = commandList[i].slice() as CommandType;\n\n switch (\n current[0] // first letter\n ) {\n case enumCommandMap.L:\n this.lineToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.M:\n this.moveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.C:\n this.bezierCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.Q:\n this.quadraticCurveToTransform(current, l, t, sX, sY);\n break;\n\n case enumCommandMap.A:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.E:\n this.ellipseTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.R:\n this.rectTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.AT:\n this.arcToTransform(current, l, t, sX, sY);\n break;\n case enumCommandMap.Z:\n this.closePath();\n break;\n }\n }\n }\n private _updateBounds() {\n this.bounds.clear();\n renderCommandList(this.commandList, this._boundsContext as unknown as ICustomPath2D);\n }\n\n release(): void {\n this.commandList = [];\n this._boundsContext = null;\n this._ctx = null;\n }\n\n getLength(): number {\n if (this.direction === Direction.COLUMN) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.y - ec.p1.y);\n } else if (this.direction === Direction.ROW) {\n if (!this.curves.length) {\n return 0;\n }\n const sc = this.curves[0];\n const ec = this.curves[this.curves.length - 1];\n return abs(sc.p0.x - ec.p1.x);\n }\n return this.curves.reduce((l, c) => l + c.getLength(), 0);\n }\n\n getAttrAt(distance: number): { pos: IPointLike; angle: number } {\n if (!this.curves) {\n return { pos: { x: 0, y: 0 }, angle: 0 };\n }\n let _dis = 0;\n let curve: ICurve<IPoint>;\n for (let i = 0; i < this.curves.length; i++) {\n curve = this.curves[i];\n const cl = curve.getLength(this.direction);\n if (_dis + cl >= distance) {\n break;\n } else {\n _dis += cl;\n }\n }\n const t = (distance - _dis) / curve.getLength(this.direction);\n const pos = curve.getPointAt(t);\n const angle = curve.getAngleAt(t);\n return { pos, angle };\n }\n}\n\nconst temp = ['l', 0, 0, 0, 0, 0, 0, 0];\n\nfunction scale(current: CommandStrType, sX: number, sY: number) {\n const c = (temp[0] = current[0]);\n if (c === 'a' || c === 'A') {\n temp[1] = sX * (current[1] as number);\n temp[2] = sY * (current[2] as number);\n temp[3] = current[3] as number;\n temp[4] = current[4] as number;\n temp[5] = current[5] as number;\n temp[6] = sX * (current[6] as number);\n temp[7] = sY * (current[7] as number);\n } else if (c === 'h' || c === 'H') {\n temp[1] = sX * (current[1] as number);\n } else if (c === 'v' || c === 'V') {\n temp[1] = sY * (current[1] as number);\n } else {\n for (let i = 1, n = current.length; i < n; ++i) {\n temp[i] = (i % 2 === 1 ? sX : sY) * (current[i] as number);\n }\n }\n return temp;\n}\n"]}
|
package/cjs/graphic/arc.js
CHANGED
|
@@ -18,8 +18,9 @@ class Arc extends graphic_1.Graphic {
|
|
|
18
18
|
return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(outerRadius) && this._validNumber(innerRadius);
|
|
19
19
|
}
|
|
20
20
|
getParsedCornerRadius() {
|
|
21
|
-
const arcTheme = (0, theme_1.getTheme)(this).arc, {cornerRadius: cornerRadius = arcTheme.cornerRadius,
|
|
22
|
-
|
|
21
|
+
const arcTheme = (0, theme_1.getTheme)(this).arc, {cornerRadius: cornerRadius = arcTheme.cornerRadius, innerPadding: innerPadding = arcTheme.innerPadding, outerPadding: outerPadding = arcTheme.outerPadding} = this.attribute;
|
|
22
|
+
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
|
|
23
|
+
if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
23
24
|
const deltaRadius = Math.abs(outerRadius - innerRadius);
|
|
24
25
|
return Math.min((0, vutils_1.isNumber)(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
25
26
|
}
|
|
@@ -31,7 +32,10 @@ class Arc extends graphic_1.Graphic {
|
|
|
31
32
|
cap && (0, vutils_1.abs)(deltaAngle) < vutils_1.pi2 - vutils_1.epsilon) {
|
|
32
33
|
let startCap = 1, endCap = 1;
|
|
33
34
|
cap.length && (startCap = Number(cap[0]), endCap = Number(cap[1]));
|
|
34
|
-
|
|
35
|
+
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
|
|
36
|
+
const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = this.attribute;
|
|
37
|
+
outerRadius += outerPadding, innerRadius -= innerPadding;
|
|
38
|
+
const capWidth = Math.abs(outerRadius - innerRadius) / 2, capAngle = capWidth / outerRadius;
|
|
35
39
|
if (capWidth > vutils_1.epsilon && outerRadius > vutils_1.epsilon) return {
|
|
36
40
|
startAngle: startAngle - sign * capAngle * startCap,
|
|
37
41
|
endAngle: endAngle + sign * capAngle * endCap,
|
|
@@ -45,8 +49,10 @@ class Arc extends graphic_1.Graphic {
|
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
getParsePadAngle(startAngle, endAngle) {
|
|
48
|
-
const arcTheme = (0, theme_1.getTheme)(this).arc, {
|
|
49
|
-
|
|
52
|
+
const arcTheme = (0, theme_1.getTheme)(this).arc, {innerPadding: innerPadding = arcTheme.innerPadding, outerPadding: outerPadding = arcTheme.outerPadding, padAngle: padAngle = arcTheme.padAngle} = this.attribute;
|
|
53
|
+
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = this.attribute;
|
|
54
|
+
outerRadius += outerPadding, innerRadius -= innerPadding;
|
|
55
|
+
const {padRadius: padRadius = (0, vutils_1.sqrt)(outerRadius * outerRadius + innerRadius * innerRadius)} = this.attribute, deltaAngle = (0,
|
|
50
56
|
vutils_1.abs)(endAngle - startAngle);
|
|
51
57
|
let outerStartAngle = startAngle, outerEndAngle = endAngle, innerStartAngle = startAngle, innerEndAngle = endAngle;
|
|
52
58
|
const halfPadAngle = padAngle / 2;
|
|
@@ -100,7 +106,7 @@ class Arc extends graphic_1.Graphic {
|
|
|
100
106
|
}
|
|
101
107
|
toCustomPath() {
|
|
102
108
|
const attribute = this.attribute, {startAngle: startAngle, endAngle: endAngle} = this.getParsedAngle();
|
|
103
|
-
let innerRadius = attribute.innerRadius, outerRadius = attribute.outerRadius;
|
|
109
|
+
let innerRadius = attribute.innerRadius - (attribute.innerPadding || 0), outerRadius = attribute.outerRadius - (attribute.outerPadding || 0);
|
|
104
110
|
const deltaAngle = (0, vutils_1.abs)(endAngle - startAngle), clockwise = endAngle > startAngle;
|
|
105
111
|
if (outerRadius < innerRadius) {
|
|
106
112
|
const temp = outerRadius;
|
package/cjs/graphic/arc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/arc.ts"],"names":[],"mappings":";;;AACA,6CAAyG;AAEzG,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAE7C,2CAA8C;AAmB9C,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,cAAc;IACd,UAAU;IACV,WAAW;IACX,KAAK;IACL,GAAG,gCAAsB;CAC1B,CAAC;AAMF,MAAa,GAAI,SAAQ,iBAA6B;IA8CpD,YAAY,MAA4B;QACtC,KAAK,CAAC,MAAM,CAAC,CAAC;QA9ChB,SAAI,GAAgB,KAAK,CAAC;QA+CxB,IAAI,CAAC,UAAU,GAAG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MAAM,IAAI,GAAG,WAAW,GAAG,IAAA,YAAG,EAAC,QAAQ,CAAC,CAAC;YAEzC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAC7D,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,GAAG,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACxC,CAAC;IAED,oBAAoB;QAClB,OAAO,GAAG,CAAC,mBAAmB,CAAC;IACjC,CAAC;;AAnRH,kBAoRC;AAjRQ,uBAAmB,mBACxB,GAAG,EAAE,CAAC,IACH,6BAAmB,EACtB;AAgRJ,SAAgB,SAAS,CAAC,UAAgC;IACxD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AAFD,8BAEC","file":"arc.js","sourcesContent":["import type { AABBBounds, OBBBounds } from '@visactor/vutils';\nimport { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils';\nimport type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport type { GraphicType } from '../interface';\nimport { ARC_NUMBER_TYPE } from './constants';\n\n/**\n * 部分代码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n\nconst ARC_UPDATE_TAG_KEY = [\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'endAngle',\n 'cornerRadius',\n 'padAngle',\n 'padRadius',\n 'cap',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Arc extends Graphic<IArcGraphicAttribute> implements IArc {\n type: GraphicType = 'arc';\n\n static NOWORK_ANIMATE_ATTR = {\n cap: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n // static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) {\n // if (isArray(r)) {\n // if ((r as any[]).length === 1) {\n // const value = r[0];\n // return [value, value, value, value];\n // }\n\n // if ((r as any[]).length === 2) {\n // return [r[0], r[0], r[1], r[1]];\n // }\n\n // if ((r as any[]).length === 3) {\n // return [r[0], r[1], r[2], 0];\n // }\n\n // return (r as any[]).slice(0, 4);\n // }\n\n // return [r as string | number, r as string | number, r as string | number, r as string | number];\n // }\n\n // static isCornerRadiusEqual(oldR: IArcGraphicAttribute['cornerRadius'], newR: IArcGraphicAttribute['cornerRadius']) {\n // throw new Error('暂不支持');\n // if (oldR === newR) {\n // return true;\n // }\n\n // if (isArray(oldR) && !isArray(newR)) {\n // return (oldR as (string | number)[]).every(r => r === newR);\n // }\n\n // if (!isArray(oldR) && isArray(newR)) {\n // return (newR as (string | number)[]).every(r => r === oldR);\n // }\n\n // return arrayEqual(oldR as (string | number)[], newR as (string | number)[]);\n // }\n\n constructor(params: IArcGraphicAttribute) {\n super(params);\n this.numberType = ARC_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, outerRadius, innerRadius } = this.attribute;\n return (\n this._validNumber(startAngle) &&\n this._validNumber(endAngle) &&\n this._validNumber(outerRadius) &&\n this._validNumber(innerRadius)\n );\n }\n\n getParsedCornerRadius() {\n const arcTheme = getTheme(this).arc;\n const {\n cornerRadius = arcTheme.cornerRadius,\n outerRadius = arcTheme.outerRadius,\n innerRadius = arcTheme.innerRadius\n } = this.attribute;\n if (cornerRadius === 0 || cornerRadius === '0%') {\n return 0;\n }\n const deltaRadius = Math.abs(outerRadius - innerRadius);\n return Math.min(\n isNumber(cornerRadius, true)\n ? (cornerRadius as number)\n : (deltaRadius * parseFloat(cornerRadius as string)) / 100,\n deltaRadius / 2\n );\n }\n\n getParsedAngle() {\n const arcTheme = getTheme(this).arc;\n let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;\n const { cap = arcTheme.cap } = this.attribute;\n\n const sign = endAngle - startAngle >= 0 ? 1 : -1;\n const deltaAngle = endAngle - startAngle;\n\n startAngle = clampAngleByRadian(startAngle);\n endAngle = startAngle + deltaAngle;\n\n if (cap && abs(deltaAngle) < pi2 - epsilon) {\n let startCap = 1;\n let endCap = 1;\n if ((cap as boolean[]).length) {\n startCap = Number(cap[0]);\n endCap = Number(cap[1]);\n }\n const { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n\n if (capWidth > epsilon && outerRadius > epsilon) {\n return {\n startAngle: startAngle - sign * capAngle * startCap,\n endAngle: endAngle + sign * capAngle * endCap,\n sc: sign * capAngle * startCap,\n ec: sign * capAngle * endCap\n };\n }\n }\n\n return {\n startAngle: startAngle,\n endAngle: endAngle\n };\n }\n\n // 参考 https://github.com/d3/d3-shape/blob/main/src/arc.js\n getParsePadAngle(startAngle: number, endAngle: number) {\n const arcTheme = getTheme(this).arc;\n const {\n outerRadius = arcTheme.outerRadius,\n innerRadius = arcTheme.innerRadius,\n padAngle = arcTheme.padAngle\n } = this.attribute;\n\n const { padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius) } = this.attribute;\n const deltaAngle = abs(endAngle - startAngle);\n\n // Or is it a circular or annular sector?\n let outerStartAngle = startAngle;\n let outerEndAngle = endAngle;\n let innerStartAngle = startAngle;\n let innerEndAngle = endAngle;\n const halfPadAngle = padAngle / 2;\n let innerDeltaAngle = deltaAngle;\n let outerDeltaAngle = deltaAngle;\n\n // Apply padding? Note that since r1 ≥ r0, outerDeltaAngle ≥ innerDeltaAngle.\n if (halfPadAngle > epsilon && padRadius > epsilon) {\n const sign = endAngle > startAngle ? 1 : -1;\n\n let p0 = asin((Number(padRadius) / innerRadius) * sin(halfPadAngle));\n let p1 = asin((Number(padRadius) / outerRadius) * sin(halfPadAngle));\n if ((innerDeltaAngle -= p0 * 2) > epsilon) {\n p0 *= sign;\n innerStartAngle += p0;\n innerEndAngle -= p0;\n } else {\n innerDeltaAngle = 0;\n innerStartAngle = innerEndAngle = (startAngle + endAngle) / 2;\n }\n if ((outerDeltaAngle -= p1 * 2) > epsilon) {\n p1 *= sign;\n outerStartAngle += p1;\n outerEndAngle -= p1;\n } else {\n outerDeltaAngle = 0;\n outerStartAngle = outerEndAngle = (startAngle + endAngle) / 2;\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const arcTheme = getTheme(this).arc;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateArcAABBBounds(\n attribute,\n getTheme(this).arc,\n this._AABBBounds,\n full,\n this\n ) as AABBBounds;\n\n const { boundsPadding = arcTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, ARC_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);\n }\n\n getDefaultAttribute(name: string) {\n const arcTheme = getTheme(this).arc;\n return arcTheme[name];\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const { startAngle, endAngle } = this.getParsedAngle();\n let innerRadius = attribute.innerRadius;\n let outerRadius = attribute.outerRadius;\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const path = new CustomPath2D();\n\n if (outerRadius <= epsilon) {\n path.moveTo(x, y);\n } else if (deltaAngle >= pi2 - epsilon) {\n // 是个完整的圆环\n // Or is it a circle or annulus?\n path.moveTo(x + outerRadius * cos(startAngle), y + outerRadius * sin(startAngle));\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n if (innerRadius > epsilon) {\n path.moveTo(x + innerRadius * cos(endAngle), y + innerRadius * sin(endAngle));\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n } else {\n const xors = outerRadius * cos(startAngle);\n const yors = outerRadius * sin(startAngle);\n const xire = innerRadius * cos(endAngle);\n const yire = innerRadius * sin(endAngle);\n\n path.moveTo(x + xors, y + yors);\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n path.lineTo(x + xire, y + yire);\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n path.closePath();\n }\n\n return path;\n }\n\n clone() {\n return new Arc({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Arc.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArc(attributes: IArcGraphicAttribute): IArc {\n return new Arc(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/arc.ts"],"names":[],"mappings":";;;AACA,6CAAyG;AAEzG,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAE7C,2CAA8C;AAmB9C,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,cAAc;IACd,UAAU;IACV,WAAW;IACX,KAAK;IACL,GAAG,gCAAsB;CAC1B,CAAC;AAMF,MAAa,GAAI,SAAQ,iBAA6B;IA8CpD,YAAY,MAA4B;QACtC,KAAK,CAAC,MAAM,CAAC,CAAC;QA9ChB,SAAI,GAAgB,KAAK,CAAC;QA+CxB,IAAI,CAAC,UAAU,GAAG,2BAAe,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACO,QAAQ;QACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS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,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AAFD,8BAEC","file":"arc.js","sourcesContent":["import type { AABBBounds, OBBBounds } from '@visactor/vutils';\nimport { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils';\nimport type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport type { GraphicType } from '../interface';\nimport { ARC_NUMBER_TYPE } from './constants';\n\n/**\n * 部分代码参考 https://github.com/d3/d3-shape/\n * Copyright 2010-2022 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n\nconst ARC_UPDATE_TAG_KEY = [\n 'innerRadius',\n 'outerRadius',\n 'startAngle',\n 'endAngle',\n 'cornerRadius',\n 'padAngle',\n 'padRadius',\n 'cap',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Arc extends Graphic<IArcGraphicAttribute> implements IArc {\n type: GraphicType = 'arc';\n\n static NOWORK_ANIMATE_ATTR = {\n cap: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n // static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) {\n // if (isArray(r)) {\n // if ((r as any[]).length === 1) {\n // const value = r[0];\n // return [value, value, value, value];\n // }\n\n // if ((r as any[]).length === 2) {\n // return [r[0], r[0], r[1], r[1]];\n // }\n\n // if ((r as any[]).length === 3) {\n // return [r[0], r[1], r[2], 0];\n // }\n\n // return (r as any[]).slice(0, 4);\n // }\n\n // return [r as string | number, r as string | number, r as string | number, r as string | number];\n // }\n\n // static isCornerRadiusEqual(oldR: IArcGraphicAttribute['cornerRadius'], newR: IArcGraphicAttribute['cornerRadius']) {\n // throw new Error('暂不支持');\n // if (oldR === newR) {\n // return true;\n // }\n\n // if (isArray(oldR) && !isArray(newR)) {\n // return (oldR as (string | number)[]).every(r => r === newR);\n // }\n\n // if (!isArray(oldR) && isArray(newR)) {\n // return (newR as (string | number)[]).every(r => r === oldR);\n // }\n\n // return arrayEqual(oldR as (string | number)[], newR as (string | number)[]);\n // }\n\n constructor(params: IArcGraphicAttribute) {\n super(params);\n this.numberType = ARC_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, outerRadius, innerRadius } = this.attribute;\n return (\n this._validNumber(startAngle) &&\n this._validNumber(endAngle) &&\n this._validNumber(outerRadius) &&\n this._validNumber(innerRadius)\n );\n }\n\n getParsedCornerRadius() {\n const arcTheme = getTheme(this).arc;\n const {\n cornerRadius = arcTheme.cornerRadius,\n innerPadding = arcTheme.innerPadding,\n outerPadding = arcTheme.outerPadding\n } = this.attribute;\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n if (cornerRadius === 0 || cornerRadius === '0%') {\n return 0;\n }\n const deltaRadius = Math.abs(outerRadius - innerRadius);\n return Math.min(\n isNumber(cornerRadius, true)\n ? (cornerRadius as number)\n : (deltaRadius * parseFloat(cornerRadius as string)) / 100,\n deltaRadius / 2\n );\n }\n\n getParsedAngle() {\n const arcTheme = getTheme(this).arc;\n let { startAngle = arcTheme.startAngle, endAngle = arcTheme.endAngle } = this.attribute;\n const { cap = arcTheme.cap } = this.attribute;\n\n const sign = endAngle - startAngle >= 0 ? 1 : -1;\n const deltaAngle = endAngle - startAngle;\n\n startAngle = clampAngleByRadian(startAngle);\n endAngle = startAngle + deltaAngle;\n\n if (cap && abs(deltaAngle) < pi2 - epsilon) {\n let startCap = 1;\n let endCap = 1;\n if ((cap as boolean[]).length) {\n startCap = Number(cap[0]);\n endCap = Number(cap[1]);\n }\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n const { outerPadding = arcTheme.outerPadding, innerPadding = arcTheme.innerPadding } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n const capWidth = Math.abs(outerRadius - innerRadius) / 2;\n // 以外边界长度为准\n const capAngle = capWidth / outerRadius;\n\n if (capWidth > epsilon && outerRadius > epsilon) {\n return {\n startAngle: startAngle - sign * capAngle * startCap,\n endAngle: endAngle + sign * capAngle * endCap,\n sc: sign * capAngle * startCap,\n ec: sign * capAngle * endCap\n };\n }\n }\n\n return {\n startAngle: startAngle,\n endAngle: endAngle\n };\n }\n\n // 参考 https://github.com/d3/d3-shape/blob/main/src/arc.js\n getParsePadAngle(startAngle: number, endAngle: number) {\n const arcTheme = getTheme(this).arc;\n const {\n innerPadding = arcTheme.innerPadding,\n outerPadding = arcTheme.outerPadding,\n padAngle = arcTheme.padAngle\n } = this.attribute;\n let { outerRadius = arcTheme.outerRadius, innerRadius = arcTheme.innerRadius } = this.attribute;\n outerRadius += outerPadding;\n innerRadius -= innerPadding;\n\n const { padRadius = sqrt(outerRadius * outerRadius + innerRadius * innerRadius) } = this.attribute;\n const deltaAngle = abs(endAngle - startAngle);\n\n // Or is it a circular or annular sector?\n let outerStartAngle = startAngle;\n let outerEndAngle = endAngle;\n let innerStartAngle = startAngle;\n let innerEndAngle = endAngle;\n const halfPadAngle = padAngle / 2;\n let innerDeltaAngle = deltaAngle;\n let outerDeltaAngle = deltaAngle;\n\n // Apply padding? Note that since r1 ≥ r0, outerDeltaAngle ≥ innerDeltaAngle.\n if (halfPadAngle > epsilon && padRadius > epsilon) {\n const sign = endAngle > startAngle ? 1 : -1;\n\n let p0 = asin((Number(padRadius) / innerRadius) * sin(halfPadAngle));\n let p1 = asin((Number(padRadius) / outerRadius) * sin(halfPadAngle));\n if ((innerDeltaAngle -= p0 * 2) > epsilon) {\n p0 *= sign;\n innerStartAngle += p0;\n innerEndAngle -= p0;\n } else {\n innerDeltaAngle = 0;\n innerStartAngle = innerEndAngle = (startAngle + endAngle) / 2;\n }\n if ((outerDeltaAngle -= p1 * 2) > epsilon) {\n p1 *= sign;\n outerStartAngle += p1;\n outerEndAngle -= p1;\n } else {\n outerDeltaAngle = 0;\n outerStartAngle = outerEndAngle = (startAngle + endAngle) / 2;\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n return {\n outerStartAngle,\n outerEndAngle,\n innerStartAngle,\n innerEndAngle,\n innerDeltaAngle,\n outerDeltaAngle\n };\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const arcTheme = getTheme(this).arc;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateArcAABBBounds(\n attribute,\n getTheme(this).arc,\n this._AABBBounds,\n full,\n this\n ) as AABBBounds;\n\n const { boundsPadding = arcTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, ARC_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);\n }\n\n getDefaultAttribute(name: string) {\n const arcTheme = getTheme(this).arc;\n return arcTheme[name];\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const { startAngle, endAngle } = this.getParsedAngle();\n let innerRadius = attribute.innerRadius - (attribute.innerPadding || 0);\n let outerRadius = attribute.outerRadius - (attribute.outerPadding || 0);\n const deltaAngle = abs(endAngle - startAngle);\n const clockwise: boolean = endAngle > startAngle;\n\n if (outerRadius < innerRadius) {\n const temp = outerRadius;\n outerRadius = innerRadius;\n innerRadius = temp;\n }\n\n const path = new CustomPath2D();\n\n if (outerRadius <= epsilon) {\n path.moveTo(x, y);\n } else if (deltaAngle >= pi2 - epsilon) {\n // 是个完整的圆环\n // Or is it a circle or annulus?\n path.moveTo(x + outerRadius * cos(startAngle), y + outerRadius * sin(startAngle));\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n if (innerRadius > epsilon) {\n path.moveTo(x + innerRadius * cos(endAngle), y + innerRadius * sin(endAngle));\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n }\n } else {\n const xors = outerRadius * cos(startAngle);\n const yors = outerRadius * sin(startAngle);\n const xire = innerRadius * cos(endAngle);\n const yire = innerRadius * sin(endAngle);\n\n path.moveTo(x + xors, y + yors);\n path.arc(x, y, outerRadius, startAngle, endAngle, !clockwise);\n path.lineTo(x + xire, y + yire);\n path.arc(x, y, innerRadius, endAngle, startAngle, clockwise);\n path.closePath();\n }\n\n return path;\n }\n\n clone() {\n return new Arc({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Arc.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArc(attributes: IArcGraphicAttribute): IArc {\n return new Arc(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
|
package/cjs/graphic/config.js
CHANGED
|
@@ -123,6 +123,7 @@ exports.DefaultConnectAttribute = {
|
|
|
123
123
|
zIndex: 0,
|
|
124
124
|
layout: null,
|
|
125
125
|
boundsPadding: 0,
|
|
126
|
+
renderStyle: "default",
|
|
126
127
|
pickMode: "accurate",
|
|
127
128
|
customPickShape: null,
|
|
128
129
|
boundsMode: "accurate",
|
|
@@ -138,6 +139,8 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
|
|
|
138
139
|
endAngle: vutils_1.pi2,
|
|
139
140
|
innerRadius: 0,
|
|
140
141
|
outerRadius: 1,
|
|
142
|
+
innerPadding: 0,
|
|
143
|
+
outerPadding: 0,
|
|
141
144
|
cornerRadius: 0,
|
|
142
145
|
padRadius: 0,
|
|
143
146
|
padAngle: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,2DAAuD;AAiC1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAA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QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,YAAiC,EAC5C,iBAAiB,EAAE,KAAkC,EACrD,SAAS,EAAE,MAAiC,EAC5C,YAAY,EAAE,KAAmC,EACjD,eAAe,EAAE,YAAY,EAC7B,UAAU,EAAE,EAAE,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,KAAK,IACjB;AAEW,QAAA,qBAAqB,iCAChC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,IACN,wBAAgB,KACnB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,IACf;AAEW,QAAA,4BAA4B,mCACpC,6BAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,2DAAuD;AAiC1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,eAAM,EAAE;CACzB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,YAAY,GAAsD;IACtE,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,CAAC;IACjB,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,CAAC;IACrB,MAAM,EAAE,KAAK;CACd,CAAC;AAEW,QAAA,kBAAkB,mBAC7B,WAAW,kCAA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,EAAE,CAAC,IACf;AAEW,QAAA,4BAA4B,mCACpC,6BAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
@@ -450,14 +450,15 @@ let DefaultGraphicService = class {
|
|
|
450
450
|
aabbBounds;
|
|
451
451
|
}
|
|
452
452
|
updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return outerRadius
|
|
456
|
-
aabbBounds;
|
|
453
|
+
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = attribute;
|
|
454
|
+
const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = attribute;
|
|
455
|
+
return outerRadius += outerPadding, innerRadius -= innerPadding, outerRadius < innerRadius && (outerRadius = innerRadius),
|
|
456
|
+
aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius), aabbBounds;
|
|
457
457
|
}
|
|
458
458
|
updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic) {
|
|
459
459
|
let {outerRadius: outerRadius = arcTheme.outerRadius, innerRadius: innerRadius = arcTheme.innerRadius} = attribute;
|
|
460
|
-
|
|
460
|
+
const {outerPadding: outerPadding = arcTheme.outerPadding, innerPadding: innerPadding = arcTheme.innerPadding} = attribute;
|
|
461
|
+
if (outerRadius += outerPadding, innerRadius -= innerPadding, outerRadius < innerRadius) {
|
|
461
462
|
const temp = outerRadius;
|
|
462
463
|
outerRadius = innerRadius, innerRadius = temp;
|
|
463
464
|
}
|