@antv/g 1.0.0-alpha.27 → 1.0.0-alpha.28

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.
Files changed (151) hide show
  1. package/dist/index.umd.js +4238 -0
  2. package/lib/index.js +222 -0
  3. package/package.json +11 -10
  4. package/dist/AbstractRenderer.d.ts +0 -26
  5. package/dist/Canvas.d.ts +0 -96
  6. package/dist/DisplayObjectPool.d.ts +0 -7
  7. package/dist/__tests__/canvas.spec.d.ts +0 -1
  8. package/dist/__tests__/custom-element.spec.d.ts +0 -3
  9. package/dist/__tests__/event.spec.d.ts +0 -1
  10. package/dist/camera/Camera.d.ts +0 -279
  11. package/dist/camera/Landmark.d.ts +0 -28
  12. package/dist/camera/__tests__/camera.spec.d.ts +0 -1
  13. package/dist/camera/__tests__/landmark.spec.d.ts +0 -1
  14. package/dist/camera/index.d.ts +0 -2
  15. package/dist/canvas-module.d.ts +0 -3
  16. package/dist/components/Cullable.d.ts +0 -15
  17. package/dist/components/Geometry.d.ts +0 -13
  18. package/dist/components/Renderable.d.ts +0 -25
  19. package/dist/components/Sortable.d.ts +0 -17
  20. package/dist/components/Transform.d.ts +0 -28
  21. package/dist/components/index.d.ts +0 -5
  22. package/dist/display-objects/Circle.d.ts +0 -12
  23. package/dist/display-objects/CustomElement.d.ts +0 -25
  24. package/dist/display-objects/DisplayObject.d.ts +0 -258
  25. package/dist/display-objects/Ellipse.d.ts +0 -14
  26. package/dist/display-objects/Group.d.ts +0 -6
  27. package/dist/display-objects/HTML.d.ts +0 -36
  28. package/dist/display-objects/Image.d.ts +0 -16
  29. package/dist/display-objects/Line.d.ts +0 -23
  30. package/dist/display-objects/Path.d.ts +0 -47
  31. package/dist/display-objects/Polygon.d.ts +0 -12
  32. package/dist/display-objects/Polyline.d.ts +0 -21
  33. package/dist/display-objects/Rect.d.ts +0 -16
  34. package/dist/display-objects/Text.d.ts +0 -65
  35. package/dist/display-objects/__tests__/circle.spec.d.ts +0 -1
  36. package/dist/display-objects/__tests__/display-object.bounds.spec.d.ts +0 -1
  37. package/dist/display-objects/__tests__/display-object.node.spec.d.ts +0 -1
  38. package/dist/display-objects/__tests__/display-object.transformable.spec.d.ts +0 -1
  39. package/dist/display-objects/__tests__/display-object.visible.spec.d.ts +0 -1
  40. package/dist/display-objects/__tests__/ellipse.spec.d.ts +0 -1
  41. package/dist/display-objects/__tests__/line.spec.d.ts +0 -1
  42. package/dist/display-objects/__tests__/path.spec.d.ts +0 -1
  43. package/dist/display-objects/__tests__/polygon.spec.d.ts +0 -1
  44. package/dist/display-objects/__tests__/polyline.spec.d.ts +0 -1
  45. package/dist/display-objects/__tests__/text.spec.d.ts +0 -1
  46. package/dist/display-objects/index.d.ts +0 -13
  47. package/dist/dom/Animation.d.ts +0 -132
  48. package/dist/dom/AnimationEffectTiming.d.ts +0 -59
  49. package/dist/dom/AnimationEvent.d.ts +0 -11
  50. package/dist/dom/AnimationTimeline.d.ts +0 -37
  51. package/dist/dom/CustomElementRegistry.d.ts +0 -15
  52. package/dist/dom/CustomEvent.d.ts +0 -16
  53. package/dist/dom/Document.d.ts +0 -59
  54. package/dist/dom/Element.d.ts +0 -143
  55. package/dist/dom/EventTarget.d.ts +0 -47
  56. package/dist/dom/FederatedEvent.d.ts +0 -146
  57. package/dist/dom/FederatedMouseEvent.d.ts +0 -52
  58. package/dist/dom/FederatedPointerEvent.d.ts +0 -69
  59. package/dist/dom/FederatedWheelEvent.d.ts +0 -20
  60. package/dist/dom/KeyframeEffect.d.ts +0 -48
  61. package/dist/dom/KeyframeList.d.ts +0 -2
  62. package/dist/dom/Node.d.ts +0 -106
  63. package/dist/dom/__tests__/animation.computed-timing.spec.d.ts +0 -1
  64. package/dist/dom/__tests__/animation.keyframe-effect.spec.d.ts +0 -1
  65. package/dist/dom/__tests__/animation.timeline.spec.d.ts +0 -1
  66. package/dist/dom/__tests__/document.spec.d.ts +0 -1
  67. package/dist/dom/__tests__/element.spec.d.ts +0 -1
  68. package/dist/dom/__tests__/event.spec.d.ts +0 -1
  69. package/dist/dom/__tests__/utils/easing.d.ts +0 -14
  70. package/dist/dom/__tests__/utils/keyframe.d.ts +0 -38
  71. package/dist/dom/index.d.ts +0 -17
  72. package/dist/dom/interfaces.d.ts +0 -327
  73. package/dist/global-module.d.ts +0 -1
  74. package/dist/index.d.ts +0 -15
  75. package/dist/index.esm.js +0 -13165
  76. package/dist/index.js +0 -13659
  77. package/dist/plugins/CullingPlugin.d.ts +0 -19
  78. package/dist/plugins/DirtyCheckPlugin.d.ts +0 -10
  79. package/dist/plugins/EventPlugin.d.ts +0 -26
  80. package/dist/plugins/FrustumCullingStrategy.d.ts +0 -21
  81. package/dist/plugins/PrepareRendererPlugin.d.ts +0 -6
  82. package/dist/property-handlers/__tests__/color.spec.d.ts +0 -1
  83. package/dist/property-handlers/__tests__/dimension.spec.d.ts +0 -1
  84. package/dist/property-handlers/__tests__/filter.spec.d.ts +0 -1
  85. package/dist/property-handlers/__tests__/transform.spec.d.ts +0 -1
  86. package/dist/property-handlers/aabb.d.ts +0 -2
  87. package/dist/property-handlers/anchor.d.ts +0 -3
  88. package/dist/property-handlers/clipPath.d.ts +0 -19
  89. package/dist/property-handlers/color.d.ts +0 -32
  90. package/dist/property-handlers/dimension.d.ts +0 -18
  91. package/dist/property-handlers/filter.d.ts +0 -9
  92. package/dist/property-handlers/index.d.ts +0 -17
  93. package/dist/property-handlers/interfaces.d.ts +0 -20
  94. package/dist/property-handlers/localPosition.d.ts +0 -2
  95. package/dist/property-handlers/numeric.d.ts +0 -5
  96. package/dist/property-handlers/offsetDistance.d.ts +0 -5
  97. package/dist/property-handlers/offsetPath.d.ts +0 -5
  98. package/dist/property-handlers/origin.d.ts +0 -11
  99. package/dist/property-handlers/path.d.ts +0 -5
  100. package/dist/property-handlers/points.d.ts +0 -6
  101. package/dist/property-handlers/transform.d.ts +0 -45
  102. package/dist/property-handlers/zIndex.d.ts +0 -2
  103. package/dist/services/ContextService.d.ts +0 -12
  104. package/dist/services/EventService.d.ts +0 -64
  105. package/dist/services/RenderingContext.d.ts +0 -28
  106. package/dist/services/RenderingService.d.ts +0 -51
  107. package/dist/services/SceneGraphSelector.d.ts +0 -20
  108. package/dist/services/SceneGraphService.d.ts +0 -146
  109. package/dist/services/aabb/CircleUpdater.d.ts +0 -10
  110. package/dist/services/aabb/EllipseUpdater.d.ts +0 -10
  111. package/dist/services/aabb/LineUpdater.d.ts +0 -10
  112. package/dist/services/aabb/PathUpdater.d.ts +0 -11
  113. package/dist/services/aabb/PolylineUpdater.d.ts +0 -10
  114. package/dist/services/aabb/RectUpdater.d.ts +0 -10
  115. package/dist/services/aabb/TextUpdater.d.ts +0 -13
  116. package/dist/services/aabb/index.d.ts +0 -8
  117. package/dist/services/aabb/interfaces.d.ts +0 -16
  118. package/dist/services/index.d.ts +0 -10
  119. package/dist/services/text/OffscreenCanvasCreator.d.ts +0 -6
  120. package/dist/services/text/index.d.ts +0 -35
  121. package/dist/shapes/AABB.d.ts +0 -33
  122. package/dist/shapes/BoundingSphere.d.ts +0 -8
  123. package/dist/shapes/Frustum.d.ts +0 -16
  124. package/dist/shapes/Plane.d.ts +0 -14
  125. package/dist/shapes/Point.d.ts +0 -11
  126. package/dist/shapes/Polygon.d.ts +0 -9
  127. package/dist/shapes/Ray.d.ts +0 -24
  128. package/dist/shapes/Rect.d.ts +0 -12
  129. package/dist/shapes/Rectangle.d.ts +0 -12
  130. package/dist/shapes/__tests__/aabb.spec.d.ts +0 -1
  131. package/dist/shapes/__tests__/boundingSphere.spec.d.ts +0 -1
  132. package/dist/shapes/__tests__/frustum.spec.d.ts +0 -1
  133. package/dist/shapes/__tests__/plane.spec.d.ts +0 -1
  134. package/dist/shapes/__tests__/ray.spec.d.ts +0 -1
  135. package/dist/shapes/index.d.ts +0 -8
  136. package/dist/types.d.ts +0 -219
  137. package/dist/utils/__tests__/event.spec.d.ts +0 -1
  138. package/dist/utils/__tests__/path.spec.d.ts +0 -1
  139. package/dist/utils/__tests__/raf.spec.d.ts +0 -1
  140. package/dist/utils/__tests__/text.spec.d.ts +0 -1
  141. package/dist/utils/animation.d.ts +0 -15
  142. package/dist/utils/bezier-easing.d.ts +0 -20
  143. package/dist/utils/canvas.d.ts +0 -5
  144. package/dist/utils/custom-easing.d.ts +0 -75
  145. package/dist/utils/event.d.ts +0 -11
  146. package/dist/utils/index.d.ts +0 -5
  147. package/dist/utils/interpolation.d.ts +0 -3
  148. package/dist/utils/math.d.ts +0 -22
  149. package/dist/utils/path.d.ts +0 -15
  150. package/dist/utils/raf.d.ts +0 -3
  151. package/dist/utils/text.d.ts +0 -2
@@ -1,327 +0,0 @@
1
- import { Entity } from '@antv/g-ecs';
2
- import EventEmitter from 'eventemitter3';
3
- import type { AnimationTimeline } from './AnimationTimeline';
4
- import { BaseStyleProps, ParsedBaseStyleProps, SHAPE } from '../types';
5
- import type { FederatedEvent } from './FederatedEvent';
6
- import { CustomElementRegistry } from './CustomElementRegistry';
7
- import { DisplayObject } from '..';
8
- import type { PointLike } from '../shapes';
9
- import type { Camera } from '../camera';
10
- import { ContextService } from '../services';
11
- /**
12
- * built-in events for element
13
- */
14
- export declare enum ElementEvent {
15
- DESTROY = "destroy",
16
- ATTRIBUTE_CHANGED = "attribute-changed",
17
- /**
18
- * it has been inserted
19
- */
20
- INSERTED = "inserted",
21
- /**
22
- * it has had a child inserted
23
- */
24
- CHILD_INSERTED = "child-inserted",
25
- /**
26
- * it has been removed
27
- */
28
- REMOVED = "removed",
29
- /**
30
- * it has had a child removed
31
- */
32
- CHILD_REMOVED = "child-removed",
33
- MOUNTED = "mounted",
34
- UNMOUNTED = "unmounted",
35
- BOUNDS_CHANGED = "bounds-changed"
36
- }
37
- export interface IEventTarget {
38
- entity: Entity;
39
- getEntity(): Entity;
40
- emitter: EventEmitter;
41
- on(type: string, listener: EventListenerOrEventListenerObject | ((...args: any[]) => void), options?: boolean | AddEventListenerOptions): this;
42
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): this;
43
- off(type: string, listener: EventListenerOrEventListenerObject | ((...args: any[]) => void), options?: boolean | AddEventListenerOptions): this;
44
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): this;
45
- removeAllEventListeners(): void;
46
- dispatchEvent<T extends FederatedEvent>(e: T): boolean;
47
- emit(eventName: string, object: object): void;
48
- }
49
- export interface INode extends IEventTarget {
50
- shadow: boolean;
51
- /**
52
- * Returns node's node document's document base URL.
53
- */
54
- readonly baseURI: string;
55
- /**
56
- * Returns the children.
57
- */
58
- readonly childNodes: (IChildNode & INode)[];
59
- /**
60
- * Returns the first child.
61
- */
62
- readonly firstChild: (IChildNode & INode) | null;
63
- /**
64
- * Returns true if node is connected and false otherwise.
65
- */
66
- isConnected: boolean;
67
- /**
68
- * Returns the last child.
69
- */
70
- readonly lastChild: (IChildNode & INode) | null;
71
- /**
72
- * Returns the next sibling.
73
- */
74
- readonly nextSibling: (IChildNode & INode) | null;
75
- /**
76
- * Returns a string appropriate for the type of node.
77
- */
78
- readonly nodeName: string;
79
- /**
80
- * Returns the type of node.
81
- */
82
- readonly nodeType: number;
83
- nodeValue: string | null;
84
- /**
85
- * Returns the node document. Returns null for documents.
86
- */
87
- ownerDocument: IDocument | null;
88
- /**
89
- * Returns the parent element.
90
- */
91
- readonly parentElement: IElement | null;
92
- /**
93
- * Returns the parent.
94
- */
95
- parentNode: (INode & IParentNode) | null;
96
- /**
97
- * Returns the previous sibling.
98
- */
99
- readonly previousSibling: (IChildNode & INode) | null;
100
- textContent: string | null;
101
- appendChild<T extends INode>(newChild: T, index?: number): T;
102
- /**
103
- * Returns a copy of node. If deep is true, the copy also includes the node's descendants.
104
- */
105
- cloneNode(deep?: boolean): INode;
106
- /**
107
- * Returns a bitmask indicating the position of other relative to node.
108
- */
109
- compareDocumentPosition(other: INode): number;
110
- /**
111
- * Returns true if other is an inclusive descendant of node, and false otherwise.
112
- */
113
- contains(other: INode | null): boolean;
114
- /**
115
- * Returns node's root.
116
- */
117
- getRootNode(options?: GetRootNodeOptions): INode;
118
- /**
119
- * Returns node's ancestor.
120
- */
121
- getAncestor(n: number): INode | null;
122
- /**
123
- * Traverse in sub tree.
124
- */
125
- forEach(callback: (o: INode) => void | boolean): void;
126
- /**
127
- * Returns whether node has children.
128
- */
129
- hasChildNodes(): boolean;
130
- insertBefore<T extends INode>(newChild: T, refChild: INode | null): T;
131
- isDefaultNamespace(namespace: string | null): boolean;
132
- /**
133
- * Returns whether node and otherNode have the same properties.
134
- */
135
- isEqualNode(otherNode: INode | null): boolean;
136
- isSameNode(otherNode: INode | null): boolean;
137
- lookupNamespaceURI(prefix: string | null): string | null;
138
- lookupPrefix(namespace: string | null): string | null;
139
- /**
140
- * Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
141
- */
142
- normalize(): void;
143
- removeChild<T extends INode>(oldChild: T, destroy?: boolean): T;
144
- replaceChild<T extends INode & IChildNode>(newChild: INode, oldChild: T, destroy?: boolean): T;
145
- /**
146
- * Destroy itself.
147
- */
148
- destroy(): void;
149
- }
150
- export interface IParentNode {
151
- readonly childElementCount: number;
152
- /**
153
- * Returns the child elements.
154
- */
155
- readonly children: IElement[];
156
- /**
157
- * Returns the first child that is an element, and null otherwise.
158
- */
159
- readonly firstElementChild: IElement | null;
160
- /**
161
- * Returns the last child that is an element, and null otherwise.
162
- */
163
- readonly lastElementChild: IElement | null;
164
- /**
165
- * Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
166
- *
167
- * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
168
- */
169
- append(...nodes: INode[]): void;
170
- /**
171
- * Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
172
- *
173
- * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
174
- */
175
- prepend(...nodes: INode[]): void;
176
- /**
177
- * Returns the first element that is a descendant of node that matches selectors.
178
- */
179
- querySelector<E extends IElement = IElement>(selectors: string): E | null;
180
- /**
181
- * Returns all element descendants of node that match selectors.
182
- */
183
- querySelectorAll<E extends IElement = IElement>(selectors: string): E[];
184
- /**
185
- * Similar to querySelector, use custom filter instead of selectors.
186
- */
187
- find<E extends IElement = IElement>(filter: (node: E) => boolean): E | null;
188
- /**
189
- * Similar to querySelectorAll, use custom filter instead of selectors.
190
- */
191
- findAll<E extends IElement = IElement>(filter: (node: E) => boolean): E[];
192
- }
193
- export interface IChildNode extends INode {
194
- /**
195
- * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
196
- *
197
- * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
198
- */
199
- after(...nodes: INode[]): void;
200
- /**
201
- * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
202
- *
203
- * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
204
- */
205
- before(...nodes: INode[]): void;
206
- /**
207
- * Removes node.
208
- */
209
- remove(): void;
210
- /**
211
- * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
212
- *
213
- * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
214
- */
215
- replaceWith(...nodes: INode[]): void;
216
- }
217
- export interface DisplayObjectConfig<StyleProps> {
218
- /**
219
- * element's identifier, must be unique in a document.
220
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
221
- */
222
- id?: string;
223
- name?: string;
224
- className?: string;
225
- /**
226
- * all styles properties, not read-only
227
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style
228
- */
229
- style?: StyleProps;
230
- /**
231
- * compatible with G 3.0
232
- * @alias style
233
- * @deprecated
234
- */
235
- attrs?: StyleProps;
236
- type?: SHAPE | string;
237
- /**
238
- * @deprecated use `style.zIndex` instead
239
- */
240
- zIndex?: number;
241
- /**
242
- * @deprecated use `style.visibility = 'visible'` instead
243
- */
244
- visible?: boolean;
245
- /**
246
- * compatible with G 3.0
247
- * @alias interactive
248
- * @deprecated
249
- */
250
- capture?: boolean;
251
- /**
252
- * enable interaction events for the DisplayObject
253
- */
254
- interactive?: boolean;
255
- }
256
- export interface IElement<StyleProps extends BaseStyleProps = any, ParsedStyleProps extends ParsedBaseStyleProps = any> extends INode, IChildNode, IParentNode {
257
- /**
258
- * Returns the value of element's id content attribute. Can be set to change it.
259
- */
260
- id: string;
261
- /**
262
- * Returns the qualified name.
263
- */
264
- tagName: string;
265
- name: string;
266
- /**
267
- * Returns the value of element's class content attribute. Can be set to change it.
268
- */
269
- className: string;
270
- /**
271
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes
272
- */
273
- attributes: StyleProps;
274
- /**
275
- * compatible with `style`
276
- * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style
277
- */
278
- style: StyleProps;
279
- parsedStyle: ParsedStyleProps;
280
- getElementById<E extends IElement = IElement>(id: string): E | null;
281
- getElementsByName<E extends IElement = IElement>(name: string): E[];
282
- getElementsByClassName<E extends IElement = IElement>(className: string): E[];
283
- getElementsByTagName<E extends IElement = IElement>(tagName: string): E[];
284
- scrollLeft: number;
285
- scrollTop: number;
286
- /**
287
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
288
- */
289
- setAttribute<Key extends keyof StyleProps>(attributeName: Key, value: StyleProps[Key], force?: boolean): void;
290
- /**
291
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
292
- */
293
- getAttribute(attributeName: keyof StyleProps): StyleProps[keyof StyleProps] | undefined;
294
- /**
295
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute
296
- */
297
- removeAttribute(attributeName: keyof StyleProps): void;
298
- }
299
- export interface IDocument extends INode, IParentNode {
300
- /**
301
- * Returns the Window object of the active document.
302
- */
303
- readonly defaultView: ICanvas | null;
304
- /**
305
- * Gets a reference to the root node of the document.
306
- */
307
- readonly documentElement: IElement;
308
- readonly ownerDocument: null;
309
- readonly timeline: AnimationTimeline;
310
- /**
311
- * Creates an instance of the element for the specified tag.
312
- */
313
- createElement<T extends DisplayObject<StyleProps>, StyleProps extends BaseStyleProps>(tagName: string, options: DisplayObjectConfig<StyleProps>): T;
314
- }
315
- export interface ICanvas extends IEventTarget {
316
- document: IDocument;
317
- customElements: CustomElementRegistry;
318
- render(): void;
319
- destroy(destroyScenegraph?: boolean): void;
320
- resize(width: number, height: number): void;
321
- getCamera(): Camera;
322
- getContextService(): ContextService<unknown>;
323
- client2Viewport(client: PointLike): PointLike;
324
- viewport2Client(viewport: PointLike): PointLike;
325
- canvas2Viewport(canvas: PointLike): PointLike;
326
- viewport2Canvas(viewport: PointLike): PointLike;
327
- }
@@ -1 +0,0 @@
1
- export declare const containerModule: import("mana-syringe").SyringeModule;
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { World } from '@antv/g-ecs';
2
- declare const world: World;
3
- export { world };
4
- export * from './types';
5
- export * from './components';
6
- export * from './dom';
7
- export * from './AbstractRenderer';
8
- export * from './Canvas';
9
- export * from './DisplayObjectPool';
10
- export * from './camera';
11
- export * from './services';
12
- export * from './shapes';
13
- export * from './utils';
14
- export * from './property-handlers';
15
- export * from './display-objects';