@visactor/vrender 0.11.0-alpha.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/segment/index.d.ts +1 -0
- package/cjs/common/segment/index.js +2 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +18 -18
- package/cjs/index.js.map +1 -1
- package/dist/index.js +55 -1
- package/dist/index.min.js +1 -1
- package/es/common/segment/index.d.ts +1 -0
- package/es/common/segment/index.js +2 -0
- package/es/common/segment/index.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -5,6 +5,7 @@ export * from './linear-closed';
|
|
|
5
5
|
export * from './basis';
|
|
6
6
|
export * from './monotone';
|
|
7
7
|
export * from './step';
|
|
8
|
+
export * from './curve/curve-context';
|
|
8
9
|
export declare function calcLineCache(points: IPointLike[], curveType: ICurveType, params?: {
|
|
9
10
|
startPoint: IPointLike;
|
|
10
11
|
}): ISegPath2D | null;
|
|
@@ -52,5 +52,6 @@ function calcLineCache(points, curveType, params) {
|
|
|
52
52
|
|
|
53
53
|
__exportStar(require("./linear"), exports), __exportStar(require("./linear-closed"), exports),
|
|
54
54
|
__exportStar(require("./basis"), exports), __exportStar(require("./monotone"), exports),
|
|
55
|
-
__exportStar(require("./step"), exports), exports
|
|
55
|
+
__exportStar(require("./step"), exports), __exportStar(require("./curve/curve-context"), exports),
|
|
56
|
+
exports.calcLineCache = calcLineCache;
|
|
56
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/segment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,qCAA6C;AAC7C,mCAA2C;AAC3C,yCAAwE;AACxE,iCAAyC;AACzC,mDAA0D;AAE1D,2CAAyB;AACzB,kDAAgC;AAChC,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;
|
|
1
|
+
{"version":3,"sources":["../../src/common/segment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,qCAA6C;AAC7C,mCAA2C;AAC3C,yCAAwE;AACxE,iCAAyC;AACzC,mDAA0D;AAE1D,2CAAyB;AACzB,kDAAgC;AAChC,0CAAwB;AACxB,6CAA2B;AAC3B,yCAAuB;AACvB,wDAAsC;AAEtC,SAAgB,aAAa,CAC3B,MAAoB,EACpB,SAAqB,EACrB,MAAmC;IAEnC,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,IAAA,0BAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,KAAK,OAAO;YACV,OAAO,IAAA,wBAAgB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,KAAK,WAAW;YACd,OAAO,IAAA,+BAAoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9C,KAAK,WAAW;YACd,OAAO,IAAA,+BAAoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9C,KAAK,MAAM;YACT,OAAO,IAAA,sBAAe,EAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC9C,KAAK,YAAY;YACf,OAAO,IAAA,sBAAe,EAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC5C,KAAK,WAAW;YACd,OAAO,IAAA,sBAAe,EAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC5C,KAAK,cAAc;YACjB,OAAO,IAAA,uCAAuB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjD;YACE,OAAO,IAAA,0BAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5C;AACH,CAAC;AAzBD,sCAyBC","file":"index.js","sourcesContent":["import { IPointLike } from '@visactor/vutils';\nimport { ICurveType, ISegPath2D } from '../../interface';\nimport { genLinearSegments } from './linear';\nimport { genBasisSegments } from './basis';\nimport { genMonotoneXSegments, genMonotoneYSegments } from './monotone';\nimport { genStepSegments } from './step';\nimport { genLinearClosedSegments } from './linear-closed';\n\nexport * from './linear';\nexport * from './linear-closed';\nexport * from './basis';\nexport * from './monotone';\nexport * from './step';\nexport * from './curve/curve-context';\n\nexport function calcLineCache(\n points: IPointLike[],\n curveType: ICurveType,\n params?: { startPoint: IPointLike }\n): ISegPath2D | null {\n switch (curveType) {\n case 'linear':\n return genLinearSegments(points, params);\n case 'basis':\n return genBasisSegments(points, params);\n case 'monotoneX':\n return genMonotoneXSegments(points, params);\n case 'monotoneY':\n return genMonotoneYSegments(points, params);\n case 'step':\n return genStepSegments(points, 0.5, params);\n case 'stepBefore':\n return genStepSegments(points, 0, params);\n case 'stepAfter':\n return genStepSegments(points, 1, params);\n case 'linearClosed':\n return genLinearClosedSegments(points, params);\n default:\n return genLinearSegments(points, params);\n }\n}\n"]}
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -18,22 +18,22 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
20
|
}), exports.version = void 0, require("reflect-metadata"), require("./modules"),
|
|
21
|
-
exports.version = "0.11.0
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./
|
|
29
|
-
__exportStar(require("./common/
|
|
30
|
-
__exportStar(require("./common/
|
|
31
|
-
__exportStar(require("./common/
|
|
32
|
-
__exportStar(require("./common/
|
|
33
|
-
__exportStar(require("./common/
|
|
34
|
-
__exportStar(require("./common/
|
|
35
|
-
__exportStar(require("./common/render-
|
|
36
|
-
__exportStar(require("./common/
|
|
37
|
-
__exportStar(require("./common/
|
|
38
|
-
__exportStar(require("./
|
|
21
|
+
exports.version = "0.11.0", __exportStar(require("./container"), exports), __exportStar(require("./core/global"), exports),
|
|
22
|
+
__exportStar(require("./graphic"), exports), __exportStar(require("./modules"), exports),
|
|
23
|
+
__exportStar(require("./create"), exports), __exportStar(require("./event"), exports),
|
|
24
|
+
__exportStar(require("./interface"), exports), __exportStar(require("./render"), exports),
|
|
25
|
+
__exportStar(require("./canvas"), exports), __exportStar(require("./core"), exports),
|
|
26
|
+
__exportStar(require("./picker"), exports), __exportStar(require("./kits"), exports),
|
|
27
|
+
__exportStar(require("./animate"), exports), __exportStar(require("./resource-loader/loader"), exports),
|
|
28
|
+
__exportStar(require("./common/text"), exports), __exportStar(require("./common/bezier-utils"), exports),
|
|
29
|
+
__exportStar(require("./common/bounds-context"), exports), __exportStar(require("./common/seg-context"), exports),
|
|
30
|
+
__exportStar(require("./common/custom-path2d"), exports), __exportStar(require("./common/segment"), exports),
|
|
31
|
+
__exportStar(require("./common/canvas-utils"), exports), __exportStar(require("./common/contribution-provider"), exports),
|
|
32
|
+
__exportStar(require("./common/generator"), exports), __exportStar(require("./common/utils"), exports),
|
|
33
|
+
__exportStar(require("./common/shape/arc"), exports), __exportStar(require("./common/shape/rect"), exports),
|
|
34
|
+
__exportStar(require("./common/path-svg"), exports), __exportStar(require("./common/render-curve"), exports),
|
|
35
|
+
__exportStar(require("./common/render-area"), exports), __exportStar(require("./common/render-command-list"), exports),
|
|
36
|
+
__exportStar(require("./common/sort"), exports), __exportStar(require("./common/morphing-utils"), exports),
|
|
37
|
+
__exportStar(require("./common/split-path"), exports), __exportStar(require("./common/enums"), exports),
|
|
38
|
+
__exportStar(require("./animate/default-ticker"), exports);
|
|
39
39
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,qBAAmB;AAGN,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,qBAAmB;AAGN,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B;AAC1B,2DAAyC;AAGzC,gDAA8B;AAC9B,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,yDAAuC;AACvC,mDAAiC;AACjC,wDAAsC;AACtC,iEAA+C;AAC/C,qDAAmC;AACnC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AAEpC,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,0DAAwC;AACxC,sDAAoC;AACpC,iDAA+B;AAE/B,2DAAyC","file":"index.js","sourcesContent":["import 'reflect-metadata';\nimport './modules';\n\n// 导出版本号\nexport const version = \"0.11.0\";\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './canvas';\nexport * from './core';\nexport * from './picker';\nexport * from './kits';\nexport * from './animate';\nexport * from './resource-loader/loader';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\n\nexport * from './animate/default-ticker';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -6938,6 +6938,59 @@
|
|
|
6938
6938
|
return genCurveSegments(path, points, 1);
|
|
6939
6939
|
}
|
|
6940
6940
|
|
|
6941
|
+
class CurveContext {
|
|
6942
|
+
_lastX;
|
|
6943
|
+
_lastY;
|
|
6944
|
+
_startX;
|
|
6945
|
+
_startY;
|
|
6946
|
+
constructor(path) {
|
|
6947
|
+
this.path = path;
|
|
6948
|
+
this._lastX = this._lastY = this._startX = this._startY = 0;
|
|
6949
|
+
}
|
|
6950
|
+
moveTo(x, y) {
|
|
6951
|
+
this._lastX = this._startX = x;
|
|
6952
|
+
this._lastY = this._startY = y;
|
|
6953
|
+
return this;
|
|
6954
|
+
}
|
|
6955
|
+
lineTo(x, y) {
|
|
6956
|
+
const curve = this.addLinearCurve(x, y);
|
|
6957
|
+
this.path.curves.push(curve);
|
|
6958
|
+
this._lastX = x;
|
|
6959
|
+
this._lastY = y;
|
|
6960
|
+
}
|
|
6961
|
+
addLinearCurve(x, y) {
|
|
6962
|
+
const curve = new LineCurve(new Point(this._lastX, this._lastY), new Point(x, y));
|
|
6963
|
+
return curve;
|
|
6964
|
+
}
|
|
6965
|
+
quadraticCurveTo(aCPx, aCPy, aX, aY) {
|
|
6966
|
+
throw new Error('CurveContext不支持调用quadraticCurveTo');
|
|
6967
|
+
}
|
|
6968
|
+
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
6969
|
+
const curve = new CubicBezierCurve(new Point(this._lastX, this._lastY), new Point(cp1x, cp1y), new Point(cp2x, cp2y), new Point(x, y));
|
|
6970
|
+
this.path.curves.push(curve);
|
|
6971
|
+
this._lastX = x;
|
|
6972
|
+
this._lastY = y;
|
|
6973
|
+
}
|
|
6974
|
+
arcTo(aX1, aY1, aX2, aY2, aRadius) {
|
|
6975
|
+
throw new Error('CurveContext不支持调用arcTo');
|
|
6976
|
+
}
|
|
6977
|
+
ellipse(aX, aY, xRadius, yRadius, aRotation, aStartAngle, aEndAngle, aClockwise) {
|
|
6978
|
+
throw new Error('CurveContext不支持调用ellipse');
|
|
6979
|
+
}
|
|
6980
|
+
rect(x, y, w, h) {
|
|
6981
|
+
throw new Error('CurveContext不支持调用rect');
|
|
6982
|
+
}
|
|
6983
|
+
arc(x, y, radius, startAngle, endAngle, counterclockwise) {
|
|
6984
|
+
throw new Error('CurveContext不支持调用arc');
|
|
6985
|
+
}
|
|
6986
|
+
closePath() {
|
|
6987
|
+
if (this.path.curves.length < 2) {
|
|
6988
|
+
return;
|
|
6989
|
+
}
|
|
6990
|
+
this.lineTo(this._startX, this._startY);
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
|
|
6941
6994
|
function calcLineCache$1(points, curveType, params) {
|
|
6942
6995
|
switch (curveType) {
|
|
6943
6996
|
case 'linear':
|
|
@@ -33581,7 +33634,7 @@
|
|
|
33581
33634
|
return new Stage(params);
|
|
33582
33635
|
}
|
|
33583
33636
|
|
|
33584
|
-
const version = "0.11.0
|
|
33637
|
+
const version = "0.11.0";
|
|
33585
33638
|
|
|
33586
33639
|
exports.ACustomAnimate = ACustomAnimate;
|
|
33587
33640
|
exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;
|
|
@@ -33616,6 +33669,7 @@
|
|
|
33616
33669
|
exports.ColorInterpolate = ColorInterpolate;
|
|
33617
33670
|
exports.Context2dFactory = Context2dFactory;
|
|
33618
33671
|
exports.ContributionProvider = ContributionProvider;
|
|
33672
|
+
exports.CurveContext = CurveContext;
|
|
33619
33673
|
exports.CustomEvent = CustomEvent;
|
|
33620
33674
|
exports.CustomPath2D = CustomPath2D;
|
|
33621
33675
|
exports.CustomSymbolClass = CustomSymbolClass;
|