@antv/g-svg 2.0.46 → 2.1.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/dist/index.esm.js +2036 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2037 -28
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +4 -28
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +6 -8
- package/types/index.d.ts +6 -5
- package/types/index.d.ts.map +1 -1
- package/types/plugins/picker/SVGPickerPlugin.d.ts +13 -0
- package/types/plugins/picker/SVGPickerPlugin.d.ts.map +1 -0
- package/types/plugins/picker/index.d.ts +7 -0
- package/types/plugins/picker/index.d.ts.map +1 -0
- package/types/plugins/svg-renderer/DefaultElementLifeCycleContribution.d.ts +15 -0
- package/types/plugins/svg-renderer/DefaultElementLifeCycleContribution.d.ts.map +1 -0
- package/types/plugins/svg-renderer/SVGRendererPlugin.d.ts +64 -0
- package/types/plugins/svg-renderer/SVGRendererPlugin.d.ts.map +1 -0
- package/types/plugins/svg-renderer/components/ElementSVG.d.ts +19 -0
- package/types/plugins/svg-renderer/components/ElementSVG.d.ts.map +1 -0
- package/types/plugins/svg-renderer/index.d.ts +17 -0
- package/types/plugins/svg-renderer/index.d.ts.map +1 -0
- package/types/plugins/svg-renderer/interfaces.d.ts +12 -0
- package/types/plugins/svg-renderer/interfaces.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/defs/DefElementManager.d.ts +19 -0
- package/types/plugins/svg-renderer/shapes/defs/DefElementManager.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/defs/Filter.d.ts +8 -0
- package/types/plugins/svg-renderer/shapes/defs/Filter.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/defs/Pattern.d.ts +7 -0
- package/types/plugins/svg-renderer/shapes/defs/Pattern.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/defs/Shadow.d.ts +7 -0
- package/types/plugins/svg-renderer/shapes/defs/Shadow.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/defs/index.d.ts +5 -0
- package/types/plugins/svg-renderer/shapes/defs/index.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Image.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Image.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Line.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Line.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Path.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Path.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Polyline.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Polyline.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Rect.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Rect.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/Text.d.ts +3 -0
- package/types/plugins/svg-renderer/shapes/paths/Text.d.ts.map +1 -0
- package/types/plugins/svg-renderer/shapes/paths/index.d.ts +7 -0
- package/types/plugins/svg-renderer/shapes/paths/index.d.ts.map +1 -0
- package/types/plugins/svg-renderer/utils/dom.d.ts +2 -0
- package/types/plugins/svg-renderer/utils/dom.d.ts.map +1 -0
- package/types/plugins/svg-renderer/utils/format.d.ts +3 -0
- package/types/plugins/svg-renderer/utils/format.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g-svg",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A renderer implemented by SVG",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antv",
|
|
@@ -35,11 +35,9 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@antv/util": "^3.3.5",
|
|
37
37
|
"@babel/runtime": "^7.25.6",
|
|
38
|
+
"gl-matrix": "^3.4.3",
|
|
38
39
|
"tslib": "^2.5.3",
|
|
39
|
-
"@antv/g-
|
|
40
|
-
"@antv/g-plugin-svg-picker": "2.0.46",
|
|
41
|
-
"@antv/g-lite": "2.5.1",
|
|
42
|
-
"@antv/g-plugin-svg-renderer": "2.4.1"
|
|
40
|
+
"@antv/g-lite": "2.6.0"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
43
|
"@types/gl-matrix": "^2.4.5"
|
|
@@ -48,9 +46,9 @@
|
|
|
48
46
|
"access": "public"
|
|
49
47
|
},
|
|
50
48
|
"scripts": {
|
|
51
|
-
"build:
|
|
52
|
-
"build": "
|
|
53
|
-
"
|
|
49
|
+
"build:js": "rimraf dist && rollup -c",
|
|
50
|
+
"build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck",
|
|
51
|
+
"build": "npm run build:js && npm run build:types",
|
|
54
52
|
"sync": "tnpm sync",
|
|
55
53
|
"watch": "rollup -c -w"
|
|
56
54
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { RendererConfig } from '@antv/g-lite';
|
|
2
|
-
import { AbstractRenderer } from '@antv/g-lite';
|
|
3
|
-
import * as
|
|
4
|
-
import * as SVGPicker from '
|
|
5
|
-
import * as SVGRenderer from '@antv/g-plugin-svg-renderer';
|
|
6
|
-
export { DomInteraction, SVGPicker, SVGRenderer };
|
|
2
|
+
import { AbstractRenderer, DomInteraction } from '@antv/g-lite';
|
|
3
|
+
import * as SVGRenderer from './plugins/svg-renderer';
|
|
4
|
+
import * as SVGPicker from './plugins/picker';
|
|
7
5
|
export interface SVGRendererConfig extends RendererConfig {
|
|
8
6
|
/**
|
|
9
7
|
* Whether to output id on SVGElement with `setAttribute` like: <circle id="g-circle-123">.
|
|
@@ -13,4 +11,7 @@ export interface SVGRendererConfig extends RendererConfig {
|
|
|
13
11
|
export declare class Renderer extends AbstractRenderer {
|
|
14
12
|
constructor(config?: Partial<SVGRendererConfig>);
|
|
15
13
|
}
|
|
14
|
+
export { createSVGElement, G_SVG_PREFIX } from './plugins/svg-renderer';
|
|
15
|
+
export { SVGRenderer, SVGPicker };
|
|
16
|
+
export { DomInteraction };
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAG9C,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,QAAS,SAAQ,gBAAgB;gBAChC,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAM;CAYpD;AAGD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GlobalRuntime, RenderingPlugin, RenderingPluginContext } from '@antv/g-lite';
|
|
2
|
+
/**
|
|
3
|
+
* pick shape(s) with Mouse/Touch event
|
|
4
|
+
*
|
|
5
|
+
* 1. find AABB with r-tree
|
|
6
|
+
* 2. use elementFromPoint
|
|
7
|
+
*/
|
|
8
|
+
export declare class SVGPickerPlugin implements RenderingPlugin {
|
|
9
|
+
static tag: string;
|
|
10
|
+
apply(context: RenderingPluginContext, runtime: GlobalRuntime): void;
|
|
11
|
+
private pick;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SVGPickerPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVGPickerPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/picker/SVGPickerPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,eAAe,EACf,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAEtB;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,eAAe;IACrD,MAAM,CAAC,GAAG,SAAe;IAEzB,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,aAAa;IAuB7D,OAAO,CAAC,IAAI;CAsCb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,MAAO,SAAQ,sBAAsB;IAChD,IAAI,SAAgB;IACpB,IAAI,IAAI,IAAI;IAGZ,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CanvasContext, DisplayObject, GlobalRuntime } from '@antv/g-lite';
|
|
2
|
+
import { Shape } from '@antv/g-lite';
|
|
3
|
+
import type { ElementLifeCycleContribution } from './interfaces';
|
|
4
|
+
export declare const SHAPE2TAGS: Record<Shape | string, string>;
|
|
5
|
+
export declare const SHAPE_UPDATE_DEPS: Record<Shape | string, string[]>;
|
|
6
|
+
export declare class DefaultElementLifeCycleContribution implements ElementLifeCycleContribution {
|
|
7
|
+
private context;
|
|
8
|
+
private runtime;
|
|
9
|
+
constructor(context: CanvasContext, runtime: GlobalRuntime);
|
|
10
|
+
createElement(object: DisplayObject, svgElementMap: WeakMap<SVGElement, DisplayObject>): SVGElement;
|
|
11
|
+
destroyElement(object: DisplayObject, $el: SVGElement): void;
|
|
12
|
+
shouldUpdateElementAttribute(object: DisplayObject, attributeName: string): boolean;
|
|
13
|
+
updateElementAttribute(object: DisplayObject): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=DefaultElementLifeCycleContribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultElementLifeCycleContribution.d.ts","sourceRoot":"","sources":["../../../src/plugins/svg-renderer/DefaultElementLifeCycleContribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EAEd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASrC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAGjE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,EAAE,MAAM,CAYrD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,EAAE,MAAM,EAAE,CAmE9D,CAAC;AAEF,qBAAa,mCACX,YAAW,4BAA4B;IAGrC,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;gBADP,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,aAAa;IAGhC,aAAa,CACX,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,GAChD,UAAU;IAUb,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU;IAErD,4BAA4B,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM;IAKzE,sBAAsB,CAAC,MAAM,EAAE,aAAa;CAsC7C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { DisplayObject, LinearGradient, RadialGradient, RenderingPlugin, RenderingPluginContext } from '@antv/g-lite';
|
|
2
|
+
import { mat4 } from 'gl-matrix';
|
|
3
|
+
import { type DefElementManager } from './shapes/defs';
|
|
4
|
+
import type { SVGRendererPluginOptions } from './interfaces';
|
|
5
|
+
export declare const SVG_ATTR_MAP: Record<string, string>;
|
|
6
|
+
export declare const DEFAULT_VALUE_MAP: Record<string, string>;
|
|
7
|
+
export type GradientParams = LinearGradient | RadialGradient;
|
|
8
|
+
/**
|
|
9
|
+
* G_SVG_PREFIX + nodeName + entity
|
|
10
|
+
*
|
|
11
|
+
* eg. g_svg_circle_345
|
|
12
|
+
*/
|
|
13
|
+
export declare const G_SVG_PREFIX = "g-svg";
|
|
14
|
+
export declare const CLIP_PATH_PREFIX = "clip-path-";
|
|
15
|
+
export declare const TEXT_PATH_PREFIX = "text-path-";
|
|
16
|
+
export declare class SVGRendererPlugin implements RenderingPlugin {
|
|
17
|
+
private pluginOptions;
|
|
18
|
+
private defElementManager;
|
|
19
|
+
private context;
|
|
20
|
+
static tag: string;
|
|
21
|
+
constructor(pluginOptions: SVGRendererPluginOptions, defElementManager: DefElementManager, context: RenderingPluginContext);
|
|
22
|
+
/**
|
|
23
|
+
* Will be used in svg-picker for finding relative SVG element of current DisplayObject.
|
|
24
|
+
*/
|
|
25
|
+
private svgElementMap;
|
|
26
|
+
/**
|
|
27
|
+
* <camera>
|
|
28
|
+
*/
|
|
29
|
+
private $camera;
|
|
30
|
+
/**
|
|
31
|
+
* render at the end of frame
|
|
32
|
+
*/
|
|
33
|
+
private renderQueue;
|
|
34
|
+
/**
|
|
35
|
+
* dirty attributes at the end of frame
|
|
36
|
+
*/
|
|
37
|
+
private dirtyAttributes;
|
|
38
|
+
/**
|
|
39
|
+
* reorder after mounted
|
|
40
|
+
*/
|
|
41
|
+
private pendingReorderQueue;
|
|
42
|
+
/**
|
|
43
|
+
* <use> elements in <clipPath>, which should be sync with clipPath
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <clipPath transform="matrix(1,0,0,1,-100,-155)" id="clip-path-0-2">
|
|
47
|
+
* <use href="#g_svg_circle_0" transform="matrix(1.477115,0,0,1.477115,150,150)">
|
|
48
|
+
* </use>
|
|
49
|
+
* </clipPath>
|
|
50
|
+
*/
|
|
51
|
+
private clipPathUseMap;
|
|
52
|
+
apply(context: RenderingPluginContext): void;
|
|
53
|
+
private getId;
|
|
54
|
+
private reorderChildren;
|
|
55
|
+
applyTransform($el: SVGElement, rts: mat4): void;
|
|
56
|
+
private applyAttributes;
|
|
57
|
+
private updateAttribute;
|
|
58
|
+
createSVGDom(document: Document, object: DisplayObject, root: SVGElement, noWrapWithGroup?: boolean): void;
|
|
59
|
+
private removeSVGDom;
|
|
60
|
+
private createOrUpdateHitArea;
|
|
61
|
+
private createOrUpdateInnerHTML;
|
|
62
|
+
private createOrUpdateClipOrTextPath;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=SVGRendererPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVGRendererPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/svg-renderer/SVGRendererPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,cAAc,EAGd,cAAc,EACd,eAAe,EACf,sBAAsB,EAOvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAI7D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgD/C,CAAC;AAaF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoBpD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,cAAc,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,YAAY,UAAU,CAAC;AACpC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C,qBAAa,iBAAkB,YAAW,eAAe;IAIrD,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,OAAO;IALjB,MAAM,CAAC,GAAG,SAAiB;gBAGjB,aAAa,EAAE,wBAAwB,EACvC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,sBAAsB;IAGzC;;OAEG;IACH,OAAO,CAAC,aAAa,CAAqD;IAE1E;;OAEG;IACH,OAAO,CAAC,OAAO,CAAa;IAE5B;;OAEG;IACH,OAAO,CAAC,WAAW,CAAuB;IAE1C;;OAEG;IACH,OAAO,CAAC,eAAe,CAAmD;IAE1E;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAiC;IAE5D;;;;;;;;OAQG;IACH,OAAO,CAAC,cAAc,CACN;IAEhB,KAAK,CAAC,OAAO,EAAE,sBAAsB;IA4PrC,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,eAAe;IAwBvB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI;IAiBzC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,eAAe;IA0HvB,YAAY,CACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,UAAU,EAChB,eAAe,UAAQ;IAmEzB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,qBAAqB;IAyC7B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,4BAA4B;CA6ErC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class ElementSVG {
|
|
2
|
+
static tag: string;
|
|
3
|
+
/**
|
|
4
|
+
* basic element, eg. <circle>|<ellipse>
|
|
5
|
+
*/
|
|
6
|
+
$el: SVGElement | null;
|
|
7
|
+
/**
|
|
8
|
+
* group wrapper for basic element, eg. <g><circle /></g>.
|
|
9
|
+
* if current element is <g>, same as `$el`
|
|
10
|
+
*/
|
|
11
|
+
$groupEl: SVGElement | null;
|
|
12
|
+
/**
|
|
13
|
+
* hitArea:
|
|
14
|
+
* $groupEl -> $el
|
|
15
|
+
* -> $hitTestingEl
|
|
16
|
+
*/
|
|
17
|
+
$hitTestingEl: SVGElement | null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ElementSVG.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementSVG.d.ts","sourceRoot":"","sources":["../../../../src/plugins/svg-renderer/components/ElementSVG.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;IACrB,MAAM,CAAC,GAAG,SAAmB;IAE7B;;OAEG;IACH,GAAG,EAAE,UAAU,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAC;IAE5B;;;;OAIG;IACH,aAAa,EAAE,UAAU,GAAG,IAAI,CAAC;CAClC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AbstractRendererPlugin, GlobalRuntime } from '@antv/g-lite';
|
|
2
|
+
import { ElementSVG } from './components/ElementSVG';
|
|
3
|
+
import type { SVGRendererPluginOptions } from './interfaces';
|
|
4
|
+
export * from './DefaultElementLifeCycleContribution';
|
|
5
|
+
export * from './shapes/paths';
|
|
6
|
+
export * from './SVGRendererPlugin';
|
|
7
|
+
export * from './interfaces';
|
|
8
|
+
export * from './utils/dom';
|
|
9
|
+
export { ElementSVG };
|
|
10
|
+
export declare class Plugin extends AbstractRendererPlugin {
|
|
11
|
+
private options;
|
|
12
|
+
name: string;
|
|
13
|
+
constructor(options?: Partial<SVGRendererPluginOptions>);
|
|
14
|
+
init(runtime: GlobalRuntime): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/svg-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,qBAAa,MAAO,SAAQ,sBAAsB;IAGpC,OAAO,CAAC,OAAO;IAF3B,IAAI,SAAkB;gBAEF,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM;IAInE,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAiClC,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DisplayObject } from '@antv/g-lite';
|
|
2
|
+
export interface ElementLifeCycleContribution {
|
|
3
|
+
createElement: (object: DisplayObject, svgElementMap: WeakMap<SVGElement, DisplayObject>) => SVGElement;
|
|
4
|
+
shouldUpdateElementAttribute: (object: DisplayObject, attributeName: string) => boolean;
|
|
5
|
+
updateElementAttribute: (object: DisplayObject, $el: SVGElement, svgElementMap: WeakMap<SVGElement, DisplayObject>) => void;
|
|
6
|
+
destroyElement: (object: DisplayObject, $el: SVGElement) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SVGRendererPluginOptions {
|
|
9
|
+
outputSVGElementId: boolean;
|
|
10
|
+
outputSVGElementName: boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/plugins/svg-renderer/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,CACb,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,KAC9C,UAAU,CAAC;IAChB,4BAA4B,EAAE,CAC5B,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,KAClB,OAAO,CAAC;IACb,sBAAsB,EAAE,CACtB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,KAC9C,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;CAClE;AACD,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CanvasContext, CSSGradientValue, CSSRGB, DisplayObject, ParsedBaseStyleProps, Pattern } from '@antv/g-lite';
|
|
2
|
+
import { SVGRendererPlugin } from '../../SVGRendererPlugin';
|
|
3
|
+
export declare class DefElementManager {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: CanvasContext);
|
|
6
|
+
/**
|
|
7
|
+
* container for <gradient> <clipPath>...
|
|
8
|
+
*/
|
|
9
|
+
private $def;
|
|
10
|
+
private gradientCache;
|
|
11
|
+
getDefElement(): SVGDefsElement;
|
|
12
|
+
init(): void;
|
|
13
|
+
clear(entity: number): void;
|
|
14
|
+
private clearUnusedDefElement;
|
|
15
|
+
createOrUpdateGradientAndPattern(object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string, plugin: SVGRendererPlugin): void;
|
|
16
|
+
createOrUpdateShadow(object: DisplayObject, $el: SVGElement, name: string): void;
|
|
17
|
+
createOrUpdateFilter(object: DisplayObject, $el: SVGElement, filters: ParsedBaseStyleProps['filter']): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=DefElementManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefElementManager.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/defs/DefElementManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,OAAO,EAGR,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,qBAAa,iBAAiB;IAChB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAE1C;;OAEG;IACH,OAAO,CAAC,IAAI,CAAiB;IAE7B,OAAO,CAAC,aAAa,CAAmC;IAExD,aAAa;IAIb,IAAI;IASJ,KAAK,CAAC,MAAM,EAAE,MAAM;IAMpB,OAAO,CAAC,qBAAqB;IAa7B,gCAAgC,CAC9B,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,GAAG,OAAO,EAClD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,iBAAiB;IA0C3B,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM;IAKzE,oBAAoB,CAClB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC;CAK1C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DisplayObject, ParsedBaseStyleProps } from '@antv/g-lite';
|
|
2
|
+
export declare const FILTER_PREFIX = "g-filter-";
|
|
3
|
+
/**
|
|
4
|
+
* use SVG filters, eg. blur, brightness, contrast...
|
|
5
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/filter
|
|
6
|
+
*/
|
|
7
|
+
export declare function createOrUpdateFilter(document: Document, $def: SVGDefsElement, object: DisplayObject, $el: SVGElement, filters: ParsedBaseStyleProps['filter']): void;
|
|
8
|
+
//# sourceMappingURL=Filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/defs/Filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAItB,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,QAuDxC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSSRGB, Pattern } from '@antv/g-lite';
|
|
2
|
+
import { DisplayObject, CSSGradientValue } from '@antv/g-lite';
|
|
3
|
+
import { SVGRendererPlugin } from '../../SVGRendererPlugin';
|
|
4
|
+
export declare const PATTERN_PREFIX = "g-pattern-";
|
|
5
|
+
export declare function resetPatternCounter(): void;
|
|
6
|
+
export declare function createOrUpdateGradientAndPattern(document: Document, $def: SVGDefsElement, object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string, createImage: () => HTMLImageElement, plugin: SVGRendererPlugin): string;
|
|
7
|
+
//# sourceMappingURL=Pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pattern.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/defs/Pattern.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,aAAa,EAKb,gBAAgB,EAOjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,eAAO,MAAM,cAAc,eAAe,CAAC;AAI3C,wBAAgB,mBAAmB,SAGlC;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,GAAG,OAAO,EAClD,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,gBAAgB,EACnC,MAAM,EAAE,iBAAiB,UAyD1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DisplayObject } from '@antv/g-lite';
|
|
2
|
+
/**
|
|
3
|
+
* use SVG filters
|
|
4
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Element/filter
|
|
5
|
+
*/
|
|
6
|
+
export declare function createOrUpdateShadow(document: Document, $def: SVGDefsElement, object: DisplayObject, $el: SVGElement, name: string): void;
|
|
7
|
+
//# sourceMappingURL=Shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shadow.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/defs/Shadow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,MAAM,QAiIb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/defs/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1D,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,qBAAqB,QA6CnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzD,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,oBAAoB,QA2ClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAQ,MAAM,cAAc,CAAC;AAG/D,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,oBAAoB,QA0ClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Polyline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAG7D,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,wBAAwB,QAuDtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rect.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Rect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzD,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,oBAAoB,QAqClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/Text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAe9E,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,QA8GvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/svg-renderer/shapes/paths/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../../src/plugins/svg-renderer/utils/dom.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,UAAU,CAEzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/plugins/svg-renderer/utils/format.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,UAE3C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,UAiBtC"}
|