@antv/g 1.0.0-alpha.20 → 1.0.0-alpha.24
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/es/Canvas.d.ts +40 -18
- package/es/Canvas.js +121 -65
- package/es/DisplayObjectPool.d.ts +2 -1
- package/es/DisplayObjectPool.js +4 -0
- package/{lib → es/camera}/Camera.d.ts +6 -3
- package/es/{Camera.js → camera/Camera.js} +22 -16
- package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/es/{Landmark.js → camera/Landmark.js} +1 -1
- package/es/camera/index.d.ts +2 -0
- package/es/camera/index.js +2 -0
- package/es/components/Cullable.js +1 -1
- package/es/components/Geometry.d.ts +8 -1
- package/es/components/Renderable.d.ts +9 -8
- package/es/components/Renderable.js +2 -6
- package/es/components/Sortable.d.ts +6 -2
- package/es/display-objects/Circle.d.ts +2 -3
- package/es/display-objects/Circle.js +2 -5
- package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
- package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
- package/es/display-objects/Ellipse.d.ts +2 -3
- package/es/display-objects/Ellipse.js +2 -5
- package/es/display-objects/Group.d.ts +2 -1
- package/es/display-objects/Group.js +13 -5
- package/es/display-objects/HTML.d.ts +2 -2
- package/es/display-objects/HTML.js +4 -7
- package/es/display-objects/Image.d.ts +2 -2
- package/es/display-objects/Image.js +2 -6
- package/es/display-objects/Line.d.ts +2 -2
- package/es/display-objects/Line.js +8 -8
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +8 -8
- package/es/display-objects/Polygon.d.ts +2 -2
- package/es/display-objects/Polygon.js +2 -6
- package/es/display-objects/Polyline.d.ts +2 -2
- package/es/display-objects/Polyline.js +8 -8
- package/es/display-objects/Rect.d.ts +2 -2
- package/es/display-objects/Rect.js +2 -6
- package/es/display-objects/Text.d.ts +2 -3
- package/es/display-objects/Text.js +8 -7
- package/es/display-objects/index.d.ts +2 -0
- package/es/display-objects/index.js +2 -0
- package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/es/{Animation.js → dom/Animation.js} +2 -3
- package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
- package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
- package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/es/dom/CustomElementRegistry.d.ts +15 -0
- package/es/dom/CustomElementRegistry.js +40 -0
- package/{lib → es/dom}/CustomEvent.d.ts +1 -1
- package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/es/dom/Document.d.ts +36 -17
- package/es/dom/Document.js +98 -14
- package/es/dom/Element.d.ts +71 -92
- package/es/dom/Element.js +179 -195
- package/es/dom/EventTarget.d.ts +11 -6
- package/es/dom/EventTarget.js +12 -4
- package/es/dom/FederatedEvent.d.ts +15 -7
- package/es/dom/FederatedEvent.js +33 -0
- package/es/dom/FederatedMouseEvent.d.ts +1 -1
- package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/es/dom/Node.d.ts +38 -23
- package/es/dom/Node.js +37 -33
- package/es/dom/index.d.ts +15 -2
- package/es/dom/index.js +16 -3
- package/es/dom/interfaces.d.ts +301 -0
- package/es/dom/interfaces.js +1 -0
- package/es/global-module.d.ts +0 -2
- package/es/global-module.js +31 -29
- package/es/index.d.ts +7 -14
- package/es/index.js +8 -15
- package/es/plugins/CullingPlugin.d.ts +2 -2
- package/es/plugins/CullingPlugin.js +13 -16
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +8 -7
- package/es/plugins/EventPlugin.js +52 -31
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/es/plugins/FrustumCullingStrategy.js +5 -4
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +42 -38
- package/es/property-handlers/aabb.d.ts +2 -3
- package/es/property-handlers/aabb.js +29 -21
- package/es/property-handlers/anchor.d.ts +3 -0
- package/es/property-handlers/anchor.js +21 -0
- package/es/property-handlers/clipPath.d.ts +1 -1
- package/es/property-handlers/clipPath.js +3 -4
- package/es/property-handlers/color.d.ts +1 -1
- package/es/property-handlers/dimension.d.ts +1 -1
- package/es/property-handlers/dimension.js +6 -9
- package/es/property-handlers/filter.d.ts +1 -1
- package/es/property-handlers/index.d.ts +5 -4
- package/es/property-handlers/index.js +1 -0
- package/es/property-handlers/localPosition.d.ts +1 -1
- package/es/property-handlers/localPosition.js +1 -6
- package/es/property-handlers/offsetDistance.d.ts +1 -1
- package/es/property-handlers/offsetPath.d.ts +1 -1
- package/es/property-handlers/origin.d.ts +1 -1
- package/es/property-handlers/origin.js +9 -2
- package/es/property-handlers/path.d.ts +2 -2
- package/es/property-handlers/path.js +8 -4
- package/es/property-handlers/points.d.ts +1 -1
- package/es/property-handlers/transform.d.ts +1 -1
- package/es/property-handlers/zIndex.d.ts +1 -1
- package/es/services/ContextService.d.ts +3 -2
- package/es/services/EventService.d.ts +18 -13
- package/es/services/EventService.js +604 -384
- package/es/services/RenderingContext.d.ts +1 -1
- package/es/services/RenderingService.d.ts +23 -29
- package/es/services/RenderingService.js +63 -54
- package/es/services/SceneGraphSelector.d.ts +7 -7
- package/es/services/SceneGraphSelector.js +10 -6
- package/es/services/SceneGraphService.d.ts +73 -78
- package/es/services/SceneGraphService.js +165 -78
- package/es/services/aabb/PathUpdater.d.ts +1 -1
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/interfaces.d.ts +1 -1
- package/es/shapes/Point.d.ts +4 -0
- package/es/shapes/Polygon.d.ts +9 -0
- package/es/shapes/Polygon.js +62 -0
- package/es/shapes/index.d.ts +1 -0
- package/es/shapes/index.js +2 -1
- package/es/types.d.ts +18 -6
- package/es/utils/animation.d.ts +1 -2
- package/es/utils/animation.js +5 -10
- package/es/utils/canvas.d.ts +1 -1
- package/es/utils/custom-easing.d.ts +3 -2
- package/es/utils/custom-easing.js +12 -6
- package/es/utils/event.js +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +3 -4
- package/es/utils/interpolation.js +0 -16
- package/es/utils/path.d.ts +2 -2
- package/lib/Canvas.d.ts +40 -18
- package/lib/Canvas.js +131 -74
- package/lib/DisplayObjectPool.d.ts +2 -1
- package/lib/DisplayObjectPool.js +4 -0
- package/{es → lib/camera}/Camera.d.ts +6 -3
- package/lib/{Camera.js → camera/Camera.js} +25 -20
- package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/lib/{Landmark.js → camera/Landmark.js} +2 -3
- package/lib/camera/index.d.ts +2 -0
- package/lib/camera/index.js +31 -0
- package/lib/components/Cullable.js +1 -1
- package/lib/components/Geometry.d.ts +8 -1
- package/lib/components/Renderable.d.ts +9 -8
- package/lib/components/Renderable.js +2 -6
- package/lib/components/Sortable.d.ts +6 -2
- package/lib/display-objects/Circle.d.ts +2 -3
- package/lib/display-objects/Circle.js +3 -6
- package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
- package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
- package/lib/display-objects/Ellipse.d.ts +2 -3
- package/lib/display-objects/Ellipse.js +3 -6
- package/lib/display-objects/Group.d.ts +2 -1
- package/lib/display-objects/Group.js +12 -4
- package/lib/display-objects/HTML.d.ts +2 -2
- package/lib/display-objects/HTML.js +4 -7
- package/lib/display-objects/Image.d.ts +2 -2
- package/lib/display-objects/Image.js +2 -6
- package/lib/display-objects/Line.d.ts +2 -2
- package/lib/display-objects/Line.js +8 -8
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +8 -8
- package/lib/display-objects/Polygon.d.ts +2 -2
- package/lib/display-objects/Polygon.js +2 -6
- package/lib/display-objects/Polyline.d.ts +2 -2
- package/lib/display-objects/Polyline.js +8 -8
- package/lib/display-objects/Rect.d.ts +2 -2
- package/lib/display-objects/Rect.js +2 -6
- package/lib/display-objects/Text.d.ts +2 -3
- package/lib/display-objects/Text.js +9 -8
- package/lib/display-objects/index.d.ts +2 -0
- package/lib/display-objects/index.js +26 -0
- package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/lib/{Animation.js → dom/Animation.js} +2 -3
- package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
- package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
- package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/lib/dom/CustomElementRegistry.d.ts +15 -0
- package/lib/dom/CustomElementRegistry.js +48 -0
- package/{es → lib/dom}/CustomEvent.d.ts +1 -1
- package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/lib/dom/Document.d.ts +36 -17
- package/lib/dom/Document.js +99 -15
- package/lib/dom/Element.d.ts +71 -92
- package/lib/dom/Element.js +180 -198
- package/lib/dom/EventTarget.d.ts +11 -6
- package/lib/dom/EventTarget.js +20 -10
- package/lib/dom/FederatedEvent.d.ts +15 -7
- package/lib/dom/FederatedEvent.js +33 -0
- package/lib/dom/FederatedMouseEvent.d.ts +1 -1
- package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/lib/dom/Node.d.ts +38 -23
- package/lib/dom/Node.js +37 -33
- package/lib/dom/index.d.ts +15 -2
- package/lib/dom/index.js +177 -8
- package/lib/dom/interfaces.d.ts +301 -0
- package/lib/dom/interfaces.js +5 -0
- package/lib/global-module.d.ts +0 -2
- package/lib/global-module.js +30 -30
- package/lib/index.d.ts +7 -14
- package/lib/index.js +44 -135
- package/lib/plugins/CullingPlugin.d.ts +2 -2
- package/lib/plugins/CullingPlugin.js +14 -16
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +9 -7
- package/lib/plugins/EventPlugin.js +52 -30
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/lib/plugins/FrustumCullingStrategy.js +5 -4
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +41 -37
- package/lib/property-handlers/aabb.d.ts +2 -3
- package/lib/property-handlers/aabb.js +28 -22
- package/lib/property-handlers/anchor.d.ts +3 -0
- package/lib/property-handlers/anchor.js +34 -0
- package/lib/property-handlers/clipPath.d.ts +1 -1
- package/lib/property-handlers/clipPath.js +3 -4
- package/lib/property-handlers/color.d.ts +1 -1
- package/lib/property-handlers/dimension.d.ts +1 -1
- package/lib/property-handlers/dimension.js +6 -9
- package/lib/property-handlers/filter.d.ts +1 -1
- package/lib/property-handlers/index.d.ts +5 -4
- package/lib/property-handlers/index.js +14 -0
- package/lib/property-handlers/localPosition.d.ts +1 -1
- package/lib/property-handlers/localPosition.js +1 -7
- package/lib/property-handlers/offsetDistance.d.ts +1 -1
- package/lib/property-handlers/offsetPath.d.ts +1 -1
- package/lib/property-handlers/origin.d.ts +1 -1
- package/lib/property-handlers/origin.js +10 -2
- package/lib/property-handlers/path.d.ts +2 -2
- package/lib/property-handlers/path.js +8 -4
- package/lib/property-handlers/points.d.ts +1 -1
- package/lib/property-handlers/transform.d.ts +1 -1
- package/lib/property-handlers/zIndex.d.ts +1 -1
- package/lib/services/ContextService.d.ts +3 -2
- package/lib/services/EventService.d.ts +18 -13
- package/lib/services/EventService.js +616 -385
- package/lib/services/RenderingContext.d.ts +1 -1
- package/lib/services/RenderingService.d.ts +23 -29
- package/lib/services/RenderingService.js +66 -56
- package/lib/services/SceneGraphSelector.d.ts +7 -7
- package/lib/services/SceneGraphSelector.js +10 -6
- package/lib/services/SceneGraphService.d.ts +73 -78
- package/lib/services/SceneGraphService.js +166 -79
- package/lib/services/aabb/PathUpdater.d.ts +1 -1
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/interfaces.d.ts +1 -1
- package/lib/shapes/Point.d.ts +4 -0
- package/lib/shapes/Polygon.d.ts +9 -0
- package/lib/shapes/Polygon.js +69 -0
- package/lib/shapes/index.d.ts +1 -0
- package/lib/shapes/index.js +13 -0
- package/lib/types.d.ts +18 -6
- package/lib/utils/animation.d.ts +1 -2
- package/lib/utils/animation.js +8 -16
- package/lib/utils/canvas.d.ts +1 -1
- package/lib/utils/custom-easing.d.ts +3 -2
- package/lib/utils/custom-easing.js +16 -8
- package/lib/utils/event.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +3 -4
- package/lib/utils/interpolation.js +0 -17
- package/lib/utils/path.d.ts +2 -2
- package/package.json +6 -6
- package/es/Batch.d.ts +0 -25
- package/es/Batch.js +0 -82
- package/es/shapes-type.d.ts +0 -175
- package/es/shapes-type.js +0 -18
- package/es/utils/matrix-decompose.d.ts +0 -3
- package/es/utils/matrix-decompose.js +0 -404
- package/lib/Batch.d.ts +0 -25
- package/lib/Batch.js +0 -91
- package/lib/shapes-type.d.ts +0 -175
- package/lib/shapes-type.js +0 -41
- package/lib/utils/matrix-decompose.d.ts +0 -3
- package/lib/utils/matrix-decompose.js +0 -414
package/lib/utils/animation.js
CHANGED
|
@@ -9,11 +9,11 @@ exports.normalizeTimingInput = normalizeTimingInput;
|
|
|
9
9
|
exports.parseEasingFunction = parseEasingFunction;
|
|
10
10
|
exports.calculateActiveDuration = calculateActiveDuration;
|
|
11
11
|
exports.calculateIterationProgress = calculateIterationProgress;
|
|
12
|
-
exports.
|
|
12
|
+
exports.getEase = exports.EasingKeys = exports.EASINGS = exports.linear = void 0;
|
|
13
13
|
|
|
14
14
|
var _tslib = require("tslib");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _dom = require("../dom");
|
|
17
17
|
|
|
18
18
|
var _customEasing = require("./custom-easing");
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ var linear = function linear(x) {
|
|
|
29
29
|
exports.linear = linear;
|
|
30
30
|
|
|
31
31
|
function makeTiming(timingInput, forGroup) {
|
|
32
|
-
var timing = new
|
|
32
|
+
var timing = new _dom.AnimationEffectTiming();
|
|
33
33
|
|
|
34
34
|
if (forGroup) {
|
|
35
35
|
timing.fill = 'both';
|
|
@@ -271,7 +271,9 @@ function calculateIterationProgress(activeDuration, localTime, timing) {
|
|
|
271
271
|
var overallProgress = calculateOverallProgress(duration, phase, timing.iterations, activeTime, timing.iterationStart);
|
|
272
272
|
var simpleIterationProgress = calculateSimpleIterationProgress(overallProgress, timing.iterationStart, phase, timing.iterations, activeTime, duration);
|
|
273
273
|
var currentIteration = calculateCurrentIteration(phase, timing.iterations, simpleIterationProgress, overallProgress);
|
|
274
|
-
var directedProgress = calculateDirectedProgress(timing.direction, currentIteration, simpleIterationProgress);
|
|
274
|
+
var directedProgress = calculateDirectedProgress(timing.direction, currentIteration, simpleIterationProgress);
|
|
275
|
+
timing.currentIteration = currentIteration;
|
|
276
|
+
timing.progress = directedProgress; // https://drafts.csswg.org/web-animations/#calculating-the-transformed-progress
|
|
275
277
|
// https://drafts.csswg.org/web-animations/#calculating-the-iteration-progress
|
|
276
278
|
|
|
277
279
|
return timing.easingFunction(directedProgress);
|
|
@@ -333,18 +335,8 @@ var getEase = function getEase(ease) {
|
|
|
333
335
|
} // Convert camelCase strings into dashed strings, then Remove the "ease-" keyword
|
|
334
336
|
|
|
335
337
|
|
|
336
|
-
var search = convertToDash(ease).replace(/^ease-/, '');
|
|
338
|
+
var search = (0, _customEasing.convertToDash)(ease).replace(/^ease-/, '');
|
|
337
339
|
return EASINGS[search] || ease;
|
|
338
340
|
};
|
|
339
341
|
|
|
340
|
-
exports.getEase = getEase;
|
|
341
|
-
|
|
342
|
-
var convertToDash = function convertToDash(str) {
|
|
343
|
-
str = str.replace(/([A-Z])/g, function (letter) {
|
|
344
|
-
return "-" + letter.toLowerCase();
|
|
345
|
-
}); // Remove first dash
|
|
346
|
-
|
|
347
|
-
return str.charAt(0) === '-' ? str.substr(1) : str;
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
exports.convertToDash = convertToDash;
|
|
342
|
+
exports.getEase = getEase;
|
package/lib/utils/canvas.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const convertToDash: (str: string) => string;
|
|
1
2
|
export declare const limit: (value: number, min: number, max: number) => number;
|
|
2
3
|
/**
|
|
3
4
|
* The format to use when defining custom easing functions
|
|
@@ -69,6 +70,6 @@ export declare const getEasingFunction: (ease: string) => TypeEasingFunction;
|
|
|
69
70
|
*/
|
|
70
71
|
export declare const registerEasingFunction: (key: string, fn: TypeEasingFunction) => void;
|
|
71
72
|
/**
|
|
72
|
-
* Allows you to register multiple new easing functions
|
|
73
|
-
*/
|
|
73
|
+
* Allows you to register multiple new easing functions
|
|
74
|
+
*/
|
|
74
75
|
export declare const registerEasingFunctions: (...obj: Array<typeof EasingFunctions>) => void;
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.registerEasingFunctions = exports.registerEasingFunction = exports.getEasingFunction = exports.complexEasingSyntax = exports.EasingFunctions = exports.EaseOutIn = exports.EaseInOut = exports.EaseOut = exports.easein = exports.Bezier = exports.Steps = exports.getEasingDuration = exports.parseEasingParameters = exports.INTINITE_LOOP_LIMIT = exports.EasingDurationCache = exports.Spring = exports.Elastic = exports.Bounce = exports.Back = exports.Circ = exports.Sine = exports.Expo = exports.Quint = exports.Quart = exports.Cubic = exports.Quad = exports.limit = void 0;
|
|
6
|
+
exports.registerEasingFunctions = exports.registerEasingFunction = exports.getEasingFunction = exports.complexEasingSyntax = exports.EasingFunctions = exports.EaseOutIn = exports.EaseInOut = exports.EaseOut = exports.easein = exports.Bezier = exports.Steps = exports.getEasingDuration = exports.parseEasingParameters = exports.INTINITE_LOOP_LIMIT = exports.EasingDurationCache = exports.Spring = exports.Elastic = exports.Bounce = exports.Back = exports.Circ = exports.Sine = exports.Expo = exports.Quint = exports.Quart = exports.Cubic = exports.Quad = exports.limit = exports.convertToDash = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
10
|
var _bezierEasing = require("./bezier-easing");
|
|
11
11
|
|
|
12
|
-
var _animation = require("./animation");
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* ported from https://github.com/okikio/native/blob/master/packages/animate/src/custom-easing.ts
|
|
16
14
|
*/
|
|
15
|
+
var convertToDash = function convertToDash(str) {
|
|
16
|
+
str = str.replace(/([A-Z])/g, function (letter) {
|
|
17
|
+
return "-" + letter.toLowerCase();
|
|
18
|
+
}); // Remove first dash
|
|
19
|
+
|
|
20
|
+
return str.charAt(0) === '-' ? str.substr(1) : str;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.convertToDash = convertToDash;
|
|
24
|
+
|
|
17
25
|
var limit = function limit(value, min, max) {
|
|
18
26
|
return Math.min(Math.max(value, min), max);
|
|
19
27
|
};
|
|
@@ -156,7 +164,7 @@ exports.INTINITE_LOOP_LIMIT = INTINITE_LOOP_LIMIT;
|
|
|
156
164
|
|
|
157
165
|
var parseEasingParameters = function parseEasingParameters(str) {
|
|
158
166
|
var match = /(\(|\s)([^)]+)\)?/.exec(str);
|
|
159
|
-
return match ? match[2].split(
|
|
167
|
+
return match ? match[2].split(',').map(function (value) {
|
|
160
168
|
var num = parseFloat(value);
|
|
161
169
|
return !Number.isNaN(num) ? num : value.trim();
|
|
162
170
|
}) : [];
|
|
@@ -363,8 +371,8 @@ var EasingFunctions = {
|
|
|
363
371
|
exports.EasingFunctions = EasingFunctions;
|
|
364
372
|
|
|
365
373
|
var complexEasingSyntax = function complexEasingSyntax(ease) {
|
|
366
|
-
return
|
|
367
|
-
.replace(/(\(|\s).+/,
|
|
374
|
+
return convertToDash(ease).replace(/^ease-/, '') // Remove the "ease-" keyword
|
|
375
|
+
.replace(/(\(|\s).+/, '') // Remove the function brackets and parameters
|
|
368
376
|
.toLowerCase().trim();
|
|
369
377
|
};
|
|
370
378
|
/** Re-maps a number from one range to another. Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful. */
|
|
@@ -388,8 +396,8 @@ var registerEasingFunction = function registerEasingFunction(key, fn) {
|
|
|
388
396
|
Object.assign(EasingFunctions, (_a = {}, _a[key] = fn, _a));
|
|
389
397
|
};
|
|
390
398
|
/**
|
|
391
|
-
* Allows you to register multiple new easing functions
|
|
392
|
-
*/
|
|
399
|
+
* Allows you to register multiple new easing functions
|
|
400
|
+
*/
|
|
393
401
|
|
|
394
402
|
|
|
395
403
|
exports.registerEasingFunction = registerEasingFunction;
|
package/lib/utils/event.js
CHANGED
|
@@ -12,7 +12,7 @@ var _util = require("@antv/util");
|
|
|
12
12
|
|
|
13
13
|
// use `self` instead of `window`, account for non-window contexts, such as in Web Workers
|
|
14
14
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/Window/self
|
|
15
|
-
var supportsTouchEvents =
|
|
15
|
+
var supportsTouchEvents = !!self.TouchEvent;
|
|
16
16
|
exports.supportsTouchEvents = supportsTouchEvents;
|
|
17
17
|
var supportsPointerEvents = !!self.PointerEvent;
|
|
18
18
|
exports.supportsPointerEvents = supportsPointerEvents;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -54,4 +54,17 @@ Object.keys(_raf).forEach(function (key) {
|
|
|
54
54
|
return _raf[key];
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _text = require("./text");
|
|
60
|
+
|
|
61
|
+
Object.keys(_text).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (key in exports && exports[key] === _text[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function get() {
|
|
67
|
+
return _text[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
57
70
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AnimationEffectTiming } from '../
|
|
2
|
-
import {
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: AnimationEffectTiming, target: DisplayObject | null): (target: DisplayObject, fraction: number) => void;
|
|
1
|
+
import type { AnimationEffectTiming } from '../dom';
|
|
2
|
+
import type { IElement } from '../dom/interfaces';
|
|
3
|
+
export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: AnimationEffectTiming, target: IElement | null): (target: IElement, fraction: number) => void;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.addPropertiesHandler = addPropertiesHandler;
|
|
7
6
|
exports.convertEffectInput = convertEffectInput;
|
|
8
7
|
|
|
9
8
|
var _tslib = require("tslib");
|
|
@@ -14,22 +13,6 @@ var _propertyHandlers = require("../property-handlers");
|
|
|
14
13
|
|
|
15
14
|
var _animation = require("./animation");
|
|
16
15
|
|
|
17
|
-
/**
|
|
18
|
-
* handlers for valid properties
|
|
19
|
-
*/
|
|
20
|
-
var propertyHandlers = {};
|
|
21
|
-
|
|
22
|
-
function addPropertyHandler(parser, merger, property) {
|
|
23
|
-
propertyHandlers[property] = propertyHandlers[property] || [];
|
|
24
|
-
propertyHandlers[property].push([parser, merger]);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function addPropertiesHandler(parser, merger, properties) {
|
|
28
|
-
for (var i = 0; i < properties.length; i++) {
|
|
29
|
-
addPropertyHandler(parser, merger, toCamelCase(properties[i]));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
16
|
function convertEffectInput(keyframes, timing, target) {
|
|
34
17
|
var propertySpecificKeyframeGroups = makePropertySpecificKeyframeGroups(keyframes, timing);
|
|
35
18
|
var interpolations = makeInterpolations(propertySpecificKeyframeGroups, target);
|
package/lib/utils/path.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { DisplayObject } from '../DisplayObject';
|
|
1
|
+
import type { DisplayObject } from '../display-objects/DisplayObject';
|
|
2
2
|
import { PathCommand } from '../types';
|
|
3
3
|
export declare function equalizeSegments(path1: PathCommand[], path2: PathCommand[], TL?: number): PathCommand[][];
|
|
4
4
|
export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
|
|
5
5
|
export declare function getPathArea(pathArray: PathCommand[]): number;
|
|
6
6
|
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
|
|
7
7
|
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
|
|
8
|
-
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["
|
|
8
|
+
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
|
|
9
9
|
/**
|
|
10
10
|
* convert object to path, should account for:
|
|
11
11
|
* * transform & origin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.24",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/antvis/g#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@antv/g-ecs": "^1.0.0-alpha.
|
|
40
|
+
"@antv/g-ecs": "^1.0.0-alpha.8",
|
|
41
41
|
"@antv/g-math": "^1.0.0-alpha.5",
|
|
42
|
-
"@antv/path-util": "^2.0.
|
|
42
|
+
"@antv/path-util": "^2.0.14",
|
|
43
43
|
"@antv/util": "^2.0.13",
|
|
44
|
+
"async-eventemitter": "0.2.4",
|
|
44
45
|
"d3-color": "^1.4.0",
|
|
45
46
|
"eventemitter3": "^4.0.0",
|
|
46
47
|
"gl-matrix": "^3.1.0",
|
|
47
48
|
"inversify": "^5.0.1",
|
|
48
|
-
"reflect-metadata": "^0.1.13"
|
|
49
|
-
"tapable": "^2.2.0"
|
|
49
|
+
"reflect-metadata": "^0.1.13"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "fb9ebf362059d1f55a855856f05d42514a72c922"
|
|
52
52
|
}
|
package/es/Batch.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CustomElement } from './CustomElement';
|
|
2
|
-
import { DisplayObjectConfig } from './DisplayObject';
|
|
3
|
-
import { BaseStyleProps } from './types';
|
|
4
|
-
export interface BatchStyleProps extends BaseStyleProps {
|
|
5
|
-
instances: this[];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* A container for multiple display objects with the same `style`,
|
|
9
|
-
* eg. 1000 Circles with the same stroke color, but their position, radius can be different
|
|
10
|
-
*
|
|
11
|
-
* @see https://developer.playcanvas.com/en/user-manual/optimization/batching/
|
|
12
|
-
*/
|
|
13
|
-
export declare class Batch extends CustomElement<BatchStyleProps> {
|
|
14
|
-
static tag: string;
|
|
15
|
-
private batchType?;
|
|
16
|
-
/**
|
|
17
|
-
* need to reconstruct batch
|
|
18
|
-
*/
|
|
19
|
-
dirty: boolean;
|
|
20
|
-
constructor({ style, ...rest }: DisplayObjectConfig<BatchStyleProps>);
|
|
21
|
-
getBatchType(): string;
|
|
22
|
-
appendChild(child: this): this;
|
|
23
|
-
removeChild(child: this): this;
|
|
24
|
-
attributeChangedCallback(name: string, value: any): void;
|
|
25
|
-
}
|
package/es/Batch.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { __assign, __extends, __rest } from "tslib";
|
|
2
|
-
import { Renderable, Cullable } from './components';
|
|
3
|
-
import { CustomElement } from './CustomElement';
|
|
4
|
-
/**
|
|
5
|
-
* A container for multiple display objects with the same `style`,
|
|
6
|
-
* eg. 1000 Circles with the same stroke color, but their position, radius can be different
|
|
7
|
-
*
|
|
8
|
-
* @see https://developer.playcanvas.com/en/user-manual/optimization/batching/
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
var Batch = function (_super) {
|
|
12
|
-
__extends(Batch, _super);
|
|
13
|
-
|
|
14
|
-
function Batch(_a) {
|
|
15
|
-
var _b = _a.style,
|
|
16
|
-
style = _b === void 0 ? {
|
|
17
|
-
instances: []
|
|
18
|
-
} : _b,
|
|
19
|
-
rest = __rest(_a, ["style"]);
|
|
20
|
-
|
|
21
|
-
var _this = _super.call(this, __assign({
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
type: Batch.tag,
|
|
24
|
-
style: style
|
|
25
|
-
}, rest)) || this;
|
|
26
|
-
/**
|
|
27
|
-
* need to reconstruct batch
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_this.dirty = true;
|
|
32
|
-
_this.getEntity().getComponent(Cullable).enable = false;
|
|
33
|
-
|
|
34
|
-
if (style.instances) {
|
|
35
|
-
style.instances.forEach(function (instance) {
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
_this.appendChild(instance);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
Batch.prototype.getBatchType = function () {
|
|
45
|
-
return this.batchType;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
Batch.prototype.appendChild = function (child) {
|
|
49
|
-
if (!this.batchType) {
|
|
50
|
-
this.batchType = child.nodeName;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
_super.prototype.appendChild.call(this, child);
|
|
54
|
-
|
|
55
|
-
child.getEntity().getComponent(Renderable).instanced = true;
|
|
56
|
-
var renderable = this.getEntity().getComponent(Renderable);
|
|
57
|
-
renderable.aabbDirty = true;
|
|
58
|
-
renderable.dirty = true;
|
|
59
|
-
this.dirty = true;
|
|
60
|
-
return child;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
Batch.prototype.removeChild = function (child) {
|
|
64
|
-
_super.prototype.removeChild.call(this, child);
|
|
65
|
-
|
|
66
|
-
child.getEntity().getComponent(Renderable).instanced = false;
|
|
67
|
-
var renderable = this.getEntity().getComponent(Renderable);
|
|
68
|
-
renderable.aabbDirty = true;
|
|
69
|
-
renderable.dirty = true;
|
|
70
|
-
this.dirty = true;
|
|
71
|
-
return child;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
Batch.prototype.attributeChangedCallback = function (name, value) {
|
|
75
|
-
throw new Error('Method not implemented.');
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
Batch.tag = 'batch';
|
|
79
|
-
return Batch;
|
|
80
|
-
}(CustomElement);
|
|
81
|
-
|
|
82
|
-
export { Batch };
|
package/es/shapes-type.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import type { BaseStyleProps, Cursor, PathCommand } from './types';
|
|
2
|
-
export declare const G_CANVAS_ELEMENT: readonly ["Group", "Rect", "Text", "Circle", "Ellipse", "Image", "Line", "Marker", "Path", "Polygon", "Polyline"];
|
|
3
|
-
export declare const ELEMENT_PROPS: string[];
|
|
4
|
-
export declare const GENERAL_SHAPE_ATTR: readonly ["cursor"];
|
|
5
|
-
export declare const COLOR_ATTRS: readonly ["fill", "stroke", "opacity", "fillOpacity", "strokeOpacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "globalCompositeOperation"];
|
|
6
|
-
export declare const GENERAL_LINE_ATTRS: readonly ["lineCap", "lineJoin", "lineWidth", "lineAppendWidth", "miterLimit", "lineDash", "startArrow", "endArrow"];
|
|
7
|
-
export declare const FONT_ATTRS: readonly ["font", "textAlign", "textBaseline", "fontStyle", "fontVariant", "fontSize", "fontFamily", "fontWeight"];
|
|
8
|
-
export declare const CIRCLE_ATTRS: readonly ["x", "y", "r", "lineWidth"];
|
|
9
|
-
export declare const DOM_ATTRS: readonly ["x", "y", "width", "height", "html"];
|
|
10
|
-
export declare const ELLIPSE_ATTRS: readonly ["x", "y", "rx", "ry"];
|
|
11
|
-
export declare const IMAGE_ATTRS: readonly ["x", "y", "width", "height", "img"];
|
|
12
|
-
export declare const LINE_ATTRS: readonly ["x1", "y1", "x2", "y2"];
|
|
13
|
-
export declare const MARKER_ATTRS: readonly ["x", "y", "r", "symbol"];
|
|
14
|
-
export declare const PATH_ATTRS: readonly ["path"];
|
|
15
|
-
export declare const POLYGON_ATTRS: readonly ["points"];
|
|
16
|
-
export declare const POLYLINE_ATTRS: readonly ["points"];
|
|
17
|
-
export declare const RECT_ATTRS: readonly ["x", "y", "width", "height", "radius"];
|
|
18
|
-
export declare const TEXT_ATTRS: readonly ["x", "y", "text"];
|
|
19
|
-
/**
|
|
20
|
-
* event
|
|
21
|
-
*/
|
|
22
|
-
export declare type GEvents = Partial<{
|
|
23
|
-
onMousedown: (evt: Event) => void;
|
|
24
|
-
onMouseup: (evt: Event) => void;
|
|
25
|
-
onClick: (evt: Event) => void;
|
|
26
|
-
onDblclick: (evt: Event) => void;
|
|
27
|
-
onMousemove: (evt: Event) => void;
|
|
28
|
-
onMouseover: (evt: Event) => void;
|
|
29
|
-
onMouseout: (evt: Event) => void;
|
|
30
|
-
onMouseenter: (evt: Event) => void;
|
|
31
|
-
onMouseleave: (evt: Event) => void;
|
|
32
|
-
onTouchstart: (evt: Event) => void;
|
|
33
|
-
onTouchmove: (evt: Event) => void;
|
|
34
|
-
onTouchend: (evt: Event) => void;
|
|
35
|
-
onDragstart: (evt: Event) => void;
|
|
36
|
-
onDrag: (evt: Event) => void;
|
|
37
|
-
onDragend: (evt: Event) => void;
|
|
38
|
-
onDragenter: (evt: Event) => void;
|
|
39
|
-
onDragleave: (evt: Event) => void;
|
|
40
|
-
onDragover: (evt: Event) => void;
|
|
41
|
-
onDrop: (evt: Event) => void;
|
|
42
|
-
onContextmenu: (evt: Event) => void;
|
|
43
|
-
onMousewheel: (evt: Event) => void;
|
|
44
|
-
}>;
|
|
45
|
-
export declare type Matrix = [number, number, number, number, number, number];
|
|
46
|
-
export declare type PathType = string | PathCommand[];
|
|
47
|
-
export declare type Point = [number, number];
|
|
48
|
-
export declare type Anchor = Point;
|
|
49
|
-
export declare type Points = Point[];
|
|
50
|
-
export declare type Arrow = {
|
|
51
|
-
path: PathType;
|
|
52
|
-
d?: number;
|
|
53
|
-
stroke?: string;
|
|
54
|
-
fill?: string;
|
|
55
|
-
lineWidth?: string;
|
|
56
|
-
} | boolean;
|
|
57
|
-
export declare type ElementProps = Partial<{
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
visible: boolean;
|
|
61
|
-
capture: boolean;
|
|
62
|
-
zIndex: number;
|
|
63
|
-
draggable: boolean;
|
|
64
|
-
cursor: Cursor;
|
|
65
|
-
}>;
|
|
66
|
-
export declare type StyleProps = Partial<{
|
|
67
|
-
fill: string;
|
|
68
|
-
stroke: string;
|
|
69
|
-
opacity: number;
|
|
70
|
-
strokeOpacity: number;
|
|
71
|
-
fillOpacity: number;
|
|
72
|
-
shadowColor: string;
|
|
73
|
-
shadowBlur: number;
|
|
74
|
-
shadowOffsetX: number;
|
|
75
|
-
shadowOffsetY: number;
|
|
76
|
-
globalCompositeOperation: string;
|
|
77
|
-
}>;
|
|
78
|
-
export declare type LineSizeProps = Partial<{
|
|
79
|
-
lineWidth: number;
|
|
80
|
-
lineAppendWidth: number;
|
|
81
|
-
}>;
|
|
82
|
-
export declare type LineStyleProps = Partial<{
|
|
83
|
-
lineCap: 'butt' | 'round' | 'square';
|
|
84
|
-
lineJoin: 'bevel' | 'round' | 'miter';
|
|
85
|
-
lineDash: number[];
|
|
86
|
-
miterLimit: number;
|
|
87
|
-
startArrow: Arrow;
|
|
88
|
-
endArrow: Arrow;
|
|
89
|
-
}> & LineSizeProps;
|
|
90
|
-
export declare type Radius = number | [number] | [number, number] | [number, number, number] | [number, number, number, number];
|
|
91
|
-
export declare type RectProps = BaseStyleProps & Partial<{
|
|
92
|
-
x: number;
|
|
93
|
-
y: number;
|
|
94
|
-
width: number;
|
|
95
|
-
height: number;
|
|
96
|
-
radius: Radius;
|
|
97
|
-
anchor: Anchor;
|
|
98
|
-
opacity: number;
|
|
99
|
-
}> & LineStyleProps;
|
|
100
|
-
export declare type TextProps = BaseStyleProps & Partial<{
|
|
101
|
-
x: number;
|
|
102
|
-
y: number;
|
|
103
|
-
text: string;
|
|
104
|
-
fontSize: number;
|
|
105
|
-
fontFamily: string;
|
|
106
|
-
fontStyle: 'normal' | 'italic' | 'oblique';
|
|
107
|
-
fontWeight: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
|
108
|
-
fontVariant: 'normal' | 'small-caps' | string;
|
|
109
|
-
textAlign: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
110
|
-
textBaseline: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
|
|
111
|
-
lineWidth: number;
|
|
112
|
-
fill?: string;
|
|
113
|
-
stroke?: string;
|
|
114
|
-
whiteSpace?: string;
|
|
115
|
-
wordWrap?: boolean;
|
|
116
|
-
wordWrapWidth?: number;
|
|
117
|
-
leading?: number;
|
|
118
|
-
letterSpacing?: number;
|
|
119
|
-
lineHeight?: number;
|
|
120
|
-
lineJoin?: string;
|
|
121
|
-
lineCap?: string;
|
|
122
|
-
miterLimit?: number;
|
|
123
|
-
padding?: number;
|
|
124
|
-
opacity?: number;
|
|
125
|
-
}>;
|
|
126
|
-
export declare type CircleProps = BaseStyleProps & Partial<{
|
|
127
|
-
x: number;
|
|
128
|
-
y: number;
|
|
129
|
-
r: number;
|
|
130
|
-
opacity: number;
|
|
131
|
-
}> & LineSizeProps;
|
|
132
|
-
export declare type EllipseProps = BaseStyleProps & Partial<{
|
|
133
|
-
x: number;
|
|
134
|
-
y: number;
|
|
135
|
-
rx: number;
|
|
136
|
-
ry: number;
|
|
137
|
-
opacity: number;
|
|
138
|
-
}> & LineSizeProps;
|
|
139
|
-
export declare type ImageProps = BaseStyleProps & {
|
|
140
|
-
img: string | HTMLImageElement | HTMLCanvasElement;
|
|
141
|
-
} & Partial<{
|
|
142
|
-
x: number;
|
|
143
|
-
y: number;
|
|
144
|
-
width: number;
|
|
145
|
-
height: number;
|
|
146
|
-
opacity: number;
|
|
147
|
-
}>;
|
|
148
|
-
export declare type LineProps = BaseStyleProps & Partial<{
|
|
149
|
-
x1: number;
|
|
150
|
-
y1: number;
|
|
151
|
-
x2: number;
|
|
152
|
-
y2: number;
|
|
153
|
-
anchor: Anchor;
|
|
154
|
-
opacity: number;
|
|
155
|
-
strokeOpacity: number;
|
|
156
|
-
}> & LineStyleProps;
|
|
157
|
-
export declare type PathProps = BaseStyleProps & {
|
|
158
|
-
path: PathType;
|
|
159
|
-
anchor: Anchor;
|
|
160
|
-
opacity?: number;
|
|
161
|
-
strokeOpacity?: number;
|
|
162
|
-
} & LineStyleProps;
|
|
163
|
-
export declare type PolygonProps = BaseStyleProps & {
|
|
164
|
-
points: Points;
|
|
165
|
-
opacity?: number;
|
|
166
|
-
strokeOpacity?: number;
|
|
167
|
-
};
|
|
168
|
-
export declare type PolylineProps = BaseStyleProps & {
|
|
169
|
-
points: Points;
|
|
170
|
-
anchor: Anchor;
|
|
171
|
-
opacity?: number;
|
|
172
|
-
strokeOpacity?: number;
|
|
173
|
-
} & LineStyleProps;
|
|
174
|
-
export declare type AllShapeProps = RectProps & TextProps & CircleProps & EllipseProps & ImageProps & LineProps & PathProps & PolygonProps & PolylineProps;
|
|
175
|
-
export declare type ShapeProps = RectProps | TextProps | CircleProps | EllipseProps | ImageProps | LineProps | PathProps | PolygonProps | PolylineProps;
|
package/es/shapes-type.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export var G_CANVAS_ELEMENT = ['Group', 'Rect', 'Text', 'Circle', 'Ellipse', 'Image', 'Line', 'Marker', 'Path', 'Polygon', 'Polyline']; // type ElementType = typeof G_CANVAS_ELEMENT[number];
|
|
2
|
-
|
|
3
|
-
export var ELEMENT_PROPS = ['id', 'name', 'type', 'visible', 'capture', 'destroyed', 'zIndex', 'draggable'];
|
|
4
|
-
export var GENERAL_SHAPE_ATTR = ['cursor'];
|
|
5
|
-
export var COLOR_ATTRS = ['fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'globalCompositeOperation'];
|
|
6
|
-
export var GENERAL_LINE_ATTRS = ['lineCap', 'lineJoin', 'lineWidth', 'lineAppendWidth', 'miterLimit', 'lineDash', 'startArrow', 'endArrow'];
|
|
7
|
-
export var FONT_ATTRS = ['font', 'textAlign', 'textBaseline', 'fontStyle', 'fontVariant', 'fontSize', 'fontFamily', 'fontWeight'];
|
|
8
|
-
export var CIRCLE_ATTRS = ['x', 'y', 'r', 'lineWidth'];
|
|
9
|
-
export var DOM_ATTRS = ['x', 'y', 'width', 'height', 'html'];
|
|
10
|
-
export var ELLIPSE_ATTRS = ['x', 'y', 'rx', 'ry'];
|
|
11
|
-
export var IMAGE_ATTRS = ['x', 'y', 'width', 'height', 'img'];
|
|
12
|
-
export var LINE_ATTRS = ['x1', 'y1', 'x2', 'y2'];
|
|
13
|
-
export var MARKER_ATTRS = ['x', 'y', 'r', 'symbol'];
|
|
14
|
-
export var PATH_ATTRS = ['path'];
|
|
15
|
-
export var POLYGON_ATTRS = ['points'];
|
|
16
|
-
export var POLYLINE_ATTRS = ['points'];
|
|
17
|
-
export var RECT_ATTRS = ['x', 'y', 'width', 'height', 'radius'];
|
|
18
|
-
export var TEXT_ATTRS = ['x', 'y', 'text'];
|