@antv/g2 4.2.10 → 4.2.12
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/g2.min.js +2 -2
- package/dist/g2.min.js.map +1 -1
- package/esm/animate/animation/index.d.ts +1 -1
- package/esm/animate/animation/sector-path-update.js +1 -1
- package/esm/animate/animation/sector-path-update.js.map +1 -1
- package/esm/animate/index.js.map +1 -1
- package/esm/chart/controller/axis.d.ts +1 -1
- package/esm/chart/controller/base.d.ts +1 -1
- package/esm/chart/layout/constraint/types.d.ts +2 -2
- package/esm/chart/layout/index.d.ts +1 -1
- package/esm/chart/layout/padding-cal.d.ts +1 -1
- package/esm/component/update-label.d.ts +1 -1
- package/esm/component/update-label.js +2 -2
- package/esm/component/update-label.js.map +1 -1
- package/esm/core.d.ts +1 -1
- package/esm/core.js +1 -3
- package/esm/core.js.map +1 -1
- package/esm/dependents.d.ts +1 -1
- package/esm/geometry/label/base.d.ts +1 -1
- package/esm/geometry/label/index.d.ts +1 -1
- package/esm/geometry/label/interface.d.ts +2 -2
- package/esm/geometry/shape/area/index.js.map +1 -1
- package/esm/geometry/shape/area/line.js.map +1 -1
- package/esm/geometry/shape/area/smooth-line.js.map +1 -1
- package/esm/geometry/shape/area/smooth.js.map +1 -1
- package/esm/geometry/shape/base.js.map +1 -1
- package/esm/geometry/shape/edge/arc.js.map +1 -1
- package/esm/geometry/shape/edge/index.js.map +1 -1
- package/esm/geometry/shape/edge/smooth.js.map +1 -1
- package/esm/geometry/shape/edge/vhv.js.map +1 -1
- package/esm/geometry/shape/interval/funnel.js.map +1 -1
- package/esm/geometry/shape/interval/hollow-rect.js.map +1 -1
- package/esm/geometry/shape/interval/index.js.map +1 -1
- package/esm/geometry/shape/interval/line.js.map +1 -1
- package/esm/geometry/shape/interval/pyramid.js.map +1 -1
- package/esm/geometry/shape/interval/tick.js.map +1 -1
- package/esm/geometry/shape/line/index.js.map +1 -1
- package/esm/geometry/shape/line/step.js.map +1 -1
- package/esm/geometry/shape/point/hollow.js.map +1 -1
- package/esm/geometry/shape/point/image.js.map +1 -1
- package/esm/geometry/shape/point/index.js.map +1 -1
- package/esm/geometry/shape/point/solid.js.map +1 -1
- package/esm/geometry/shape/polygon/index.js.map +1 -1
- package/esm/geometry/shape/polygon/square.js.map +1 -1
- package/esm/geometry/shape/schema/box.js.map +1 -1
- package/esm/geometry/shape/schema/candle.js.map +1 -1
- package/esm/geometry/shape/violin/hollow.js.map +1 -1
- package/esm/geometry/shape/violin/index.js.map +1 -1
- package/esm/geometry/shape/violin/smooth.js.map +1 -1
- package/esm/interaction/action/component/tooltip/ellipsis-text.js +10 -0
- package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
- package/esm/interaction/action/element/highlight-util.d.ts +1 -1
- package/esm/interaction/action/element/highlight.d.ts +1 -1
- package/esm/interaction/action/element/link-by-color.d.ts +1 -1
- package/esm/interaction/action/register.d.ts +1 -1
- package/esm/interaction/action/util.js +7 -0
- package/esm/interaction/action/util.js.map +1 -1
- package/esm/interaction/interaction.d.ts +1 -1
- package/esm/interface.d.ts +59 -59
- package/esm/util/collision-detect.d.ts +1 -1
- package/esm/util/legend.d.ts +1 -1
- package/esm/util/text.d.ts +2 -2
- package/esm/util/types.d.ts +1 -1
- package/lib/animate/animation/index.d.ts +1 -1
- package/lib/animate/animation/sector-path-update.js +1 -1
- package/lib/animate/animation/sector-path-update.js.map +1 -1
- package/lib/animate/index.js.map +1 -1
- package/lib/chart/controller/axis.d.ts +1 -1
- package/lib/chart/controller/base.d.ts +1 -1
- package/lib/chart/layout/constraint/types.d.ts +2 -2
- package/lib/chart/layout/index.d.ts +1 -1
- package/lib/chart/layout/padding-cal.d.ts +1 -1
- package/lib/component/update-label.d.ts +1 -1
- package/lib/component/update-label.js +1 -1
- package/lib/component/update-label.js.map +1 -1
- package/lib/core.d.ts +1 -1
- package/lib/core.js +9 -9
- package/lib/core.js.map +1 -1
- package/lib/dependents.d.ts +1 -1
- package/lib/geometry/label/base.d.ts +1 -1
- package/lib/geometry/label/index.d.ts +1 -1
- package/lib/geometry/label/interface.d.ts +2 -2
- package/lib/geometry/shape/area/index.js.map +1 -1
- package/lib/geometry/shape/area/line.js.map +1 -1
- package/lib/geometry/shape/area/smooth-line.js.map +1 -1
- package/lib/geometry/shape/area/smooth.js.map +1 -1
- package/lib/geometry/shape/base.js.map +1 -1
- package/lib/geometry/shape/edge/arc.js.map +1 -1
- package/lib/geometry/shape/edge/index.js.map +1 -1
- package/lib/geometry/shape/edge/smooth.js.map +1 -1
- package/lib/geometry/shape/edge/vhv.js.map +1 -1
- package/lib/geometry/shape/interval/funnel.js.map +1 -1
- package/lib/geometry/shape/interval/hollow-rect.js.map +1 -1
- package/lib/geometry/shape/interval/index.js.map +1 -1
- package/lib/geometry/shape/interval/line.js.map +1 -1
- package/lib/geometry/shape/interval/pyramid.js.map +1 -1
- package/lib/geometry/shape/interval/tick.js.map +1 -1
- package/lib/geometry/shape/line/index.js.map +1 -1
- package/lib/geometry/shape/line/step.js.map +1 -1
- package/lib/geometry/shape/point/hollow.js.map +1 -1
- package/lib/geometry/shape/point/image.js.map +1 -1
- package/lib/geometry/shape/point/index.js.map +1 -1
- package/lib/geometry/shape/point/solid.js.map +1 -1
- package/lib/geometry/shape/polygon/index.js.map +1 -1
- package/lib/geometry/shape/polygon/square.js.map +1 -1
- package/lib/geometry/shape/schema/box.js.map +1 -1
- package/lib/geometry/shape/schema/candle.js.map +1 -1
- package/lib/geometry/shape/violin/hollow.js.map +1 -1
- package/lib/geometry/shape/violin/index.js.map +1 -1
- package/lib/geometry/shape/violin/smooth.js.map +1 -1
- package/lib/interaction/action/component/tooltip/ellipsis-text.js +10 -0
- package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
- package/lib/interaction/action/element/highlight-util.d.ts +1 -1
- package/lib/interaction/action/element/highlight.d.ts +1 -1
- package/lib/interaction/action/element/link-by-color.d.ts +1 -1
- package/lib/interaction/action/register.d.ts +1 -1
- package/lib/interaction/action/util.js +7 -0
- package/lib/interaction/action/util.js.map +1 -1
- package/lib/interaction/interaction.d.ts +1 -1
- package/lib/interface.d.ts +59 -59
- package/lib/util/collision-detect.d.ts +1 -1
- package/lib/util/legend.d.ts +1 -1
- package/lib/util/text.d.ts +2 -2
- package/lib/util/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/animate/animation/sector-path-update.ts +1 -1
- package/src/component/update-label.ts +2 -2
- package/src/core.ts +1 -1
- package/src/interaction/action/component/tooltip/ellipsis-text.ts +9 -0
- package/src/interaction/action/util.ts +6 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxisOption, ComponentOption } from '../../interface';
|
|
2
2
|
import View from '../view';
|
|
3
3
|
import { Controller } from './base';
|
|
4
|
-
|
|
4
|
+
type Option = Record<string, AxisOption> | boolean;
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
* G2 Axis controller, will:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentOption } from '../../interface';
|
|
2
2
|
import View from '../view';
|
|
3
3
|
/** Component controller class type define */
|
|
4
|
-
export
|
|
4
|
+
export type ControllerCtor<O = any> = new (view: View) => Controller<O>;
|
|
5
5
|
/**
|
|
6
6
|
* Component Controller 规范需要定义的基类
|
|
7
7
|
* 1. 规范的 option 输入
|
|
@@ -5,7 +5,7 @@ import type { Variable } from './variable';
|
|
|
5
5
|
export declare enum Operator {
|
|
6
6
|
EQ = "eq"
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type BoxObject = {
|
|
9
9
|
x: number;
|
|
10
10
|
y: number;
|
|
11
11
|
width: number;
|
|
@@ -18,4 +18,4 @@ export declare type BoxObject = {
|
|
|
18
18
|
* - [200, 2]
|
|
19
19
|
* - [2, variable]
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type Element = Variable | number | (Variable | number)[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DIRECTION } from '../../constant';
|
|
2
2
|
import { BBox } from '../../dependents';
|
|
3
3
|
import { Padding } from '../../interface';
|
|
4
|
-
export
|
|
4
|
+
export type PaddingCalCtor = {
|
|
5
5
|
readonly instance: (top?: number, right?: number, bottom?: number, left?: number) => PaddingCal;
|
|
6
6
|
};
|
|
7
7
|
/** @ignore */
|
|
@@ -50,7 +50,7 @@ function updateLabel(fromShape, toShape, cfg) {
|
|
|
50
50
|
});
|
|
51
51
|
// append
|
|
52
52
|
(0, util_1.each)(toShape.getChildren(), function (child, idx) {
|
|
53
|
-
if (idx >= fromShape.getCount()) {
|
|
53
|
+
if ((0, util_1.isArray)(fromShape.getChildren()) && idx >= fromShape.getCount()) {
|
|
54
54
|
if (!child.destroyed) {
|
|
55
55
|
fromShape.add(child);
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-label.js","sourceRoot":"","sources":["../../src/component/update-label.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"update-label.js","sourceRoot":"","sources":["../../src/component/update-label.ts"],"names":[],"mappings":";;;AAEA,mCAAgD;AAChD,sCAAuC;AACvC,6CAAmD;AAUnD;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAC,SAAiB,EAAE,OAAe,EAAE,GAAQ;IAC9D,IAAA,IAAI,GAAqC,GAAG,KAAxC,EAAE,MAAM,GAA6B,GAAG,OAAhC,EAAE,UAAU,GAAiB,GAAG,WAApB,EAAE,UAAU,GAAK,GAAG,WAAR,CAAS;IACrD,IAAM,gBAAgB,GAAG,IAAA,UAAG,EAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxC,SAAS,CAAC,GAAG,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AAW,EAAE,CAAC,IAAI,GAAG,IAAI,SAAS,CAAC,QAAQ,EAAE,EAAE;YACnE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACpB,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA5CD,kCA4CC","sourcesContent":["import { Coordinate } from '@antv/coord';\nimport { IGroup, IShape } from '@antv/g-base';\nimport { each, get, isArray } from '@antv/util';\nimport { doAnimate } from '../animate';\nimport { getReplaceAttrs } from '../util/graphics';\n\n/** label 的必要配置 */\ntype Cfg = {\n data: any;\n origin: any;\n animateCfg: any;\n coordinate: Coordinate;\n};\n\n/**\n * @desc 更新 label (目前没有根据 id 索引,还是会存在一点小问题的,只能根据 idx 索引)\n * @done shape 属性更新\n * @done shape delete\n * @done shape append\n *\n * @param fromShape old labelShape\n * @param toShape new labelShape\n * @param cfg\n */\nexport function updateLabel(fromShape: IGroup, toShape: IGroup, cfg: Cfg): void {\n const { data, origin, animateCfg, coordinate } = cfg;\n const updateAnimateCfg = get(animateCfg, 'update');\n\n fromShape.set('data', data);\n fromShape.set('origin', origin);\n fromShape.set('animateCfg', animateCfg);\n fromShape.set('coordinate', coordinate);\n fromShape.set('visible', toShape.get('visible'));\n\n (fromShape.getChildren() || []).forEach((fromChild, idx) => {\n const toChild = toShape.getChildByIndex(idx) as IShape;\n if (!toChild) {\n fromShape.removeChild(fromChild);\n fromChild.remove(true);\n } else {\n fromChild.set('data', data);\n fromChild.set('origin', origin);\n fromChild.set('animateCfg', animateCfg);\n fromChild.set('coordinate', coordinate);\n\n const newAttrs = getReplaceAttrs(fromChild as IShape, toChild);\n if (updateAnimateCfg) {\n doAnimate(fromChild as IShape, updateAnimateCfg, {\n toAttrs: newAttrs,\n coordinate,\n });\n } else {\n fromChild.attr(newAttrs);\n }\n if (toChild.isGroup()) {\n updateLabel(fromChild as any, toChild as any, cfg);\n }\n }\n });\n\n // append\n each(toShape.getChildren(), (child, idx) => {\n if (isArray(fromShape.getChildren()) && idx >= fromShape.getCount()) {\n if (!child.destroyed) {\n fromShape.add(child);\n }\n }\n });\n}\n"]}
|
package/lib/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "4.2.
|
|
1
|
+
export declare const VERSION = "4.2.12";
|
|
2
2
|
export { Chart, View, Event } from './chart';
|
|
3
3
|
export { Controller as ComponentController } from './chart/controller/base';
|
|
4
4
|
export { default as TooltipController } from './chart/controller/tooltip';
|
package/lib/core.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* G2 的一个壳子,不包含 Geometry,由开发者自己定义和引入 */
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
exports.Util = exports.Scale = exports.Coordinate = exports.DIRECTION = exports.LAYER = exports.getAnimation = exports.registerAnimation = exports.getEngine = exports.registerEngine = exports.registerTheme = exports.getTheme = exports.registerFacet = exports.getFacet = exports.getActionClass = exports.registerAction = exports.registerInteraction = exports.getInteraction = exports.getGeometryLabelLayout = exports.getGeometryLabel = exports.registerGeometryLabelLayout = exports.registerGeometryLabel = exports.getShapeFactory = exports.registerShapeFactory = exports.registerShape = exports.registerGeometry = exports.registerComponentController = exports.InteractionAction = exports.Facet = exports.Action = exports.Interaction = exports.GeometryLabel = exports.Element = exports.Geometry = exports.TooltipController = exports.ComponentController = exports.Event = exports.View = exports.Chart = exports.VERSION = void 0;
|
|
5
|
-
|
|
6
|
-
exports.VERSION = '4.2.10';
|
|
8
|
+
exports.VERSION = '4.2.12';
|
|
7
9
|
// 核心基类导出
|
|
8
10
|
var chart_1 = require("./chart"); // Chart, View 类
|
|
9
11
|
Object.defineProperty(exports, "Chart", { enumerable: true, get: function () { return chart_1.Chart; } });
|
|
@@ -12,20 +14,20 @@ Object.defineProperty(exports, "Event", { enumerable: true, get: function () { r
|
|
|
12
14
|
var base_1 = require("./chart/controller/base"); // G2 组件基类
|
|
13
15
|
Object.defineProperty(exports, "ComponentController", { enumerable: true, get: function () { return base_1.Controller; } });
|
|
14
16
|
var tooltip_1 = require("./chart/controller/tooltip"); // G2 tooltip 组件基类
|
|
15
|
-
Object.defineProperty(exports, "TooltipController", { enumerable: true, get: function () { return
|
|
17
|
+
Object.defineProperty(exports, "TooltipController", { enumerable: true, get: function () { return __importDefault(tooltip_1).default; } });
|
|
16
18
|
var base_2 = require("./geometry/base"); // Geometry 基类
|
|
17
|
-
Object.defineProperty(exports, "Geometry", { enumerable: true, get: function () { return
|
|
19
|
+
Object.defineProperty(exports, "Geometry", { enumerable: true, get: function () { return __importDefault(base_2).default; } });
|
|
18
20
|
var element_1 = require("./geometry/element"); // Element 类
|
|
19
|
-
Object.defineProperty(exports, "Element", { enumerable: true, get: function () { return
|
|
21
|
+
Object.defineProperty(exports, "Element", { enumerable: true, get: function () { return __importDefault(element_1).default; } });
|
|
20
22
|
var base_3 = require("./geometry/label/base"); // Geometry Label 基类
|
|
21
|
-
Object.defineProperty(exports, "GeometryLabel", { enumerable: true, get: function () { return
|
|
23
|
+
Object.defineProperty(exports, "GeometryLabel", { enumerable: true, get: function () { return __importDefault(base_3).default; } });
|
|
22
24
|
var interaction_1 = require("./interaction"); // Interaction, Action 基类
|
|
23
25
|
Object.defineProperty(exports, "Interaction", { enumerable: true, get: function () { return interaction_1.Interaction; } });
|
|
24
26
|
Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return interaction_1.Action; } });
|
|
25
27
|
var facet_1 = require("./facet"); // Facet 基类
|
|
26
28
|
Object.defineProperty(exports, "Facet", { enumerable: true, get: function () { return facet_1.Facet; } });
|
|
27
29
|
var base_4 = require("./interaction/action/base"); // Interaction Action 基类
|
|
28
|
-
Object.defineProperty(exports, "InteractionAction", { enumerable: true, get: function () { return
|
|
30
|
+
Object.defineProperty(exports, "InteractionAction", { enumerable: true, get: function () { return __importDefault(base_4).default; } });
|
|
29
31
|
// 注册 ComponentController
|
|
30
32
|
var chart_2 = require("./chart");
|
|
31
33
|
Object.defineProperty(exports, "registerComponentController", { enumerable: true, get: function () { return chart_2.registerComponentController; } });
|
|
@@ -68,8 +70,6 @@ Object.defineProperty(exports, "getAnimation", { enumerable: true, get: function
|
|
|
68
70
|
var constant_1 = require("./constant");
|
|
69
71
|
Object.defineProperty(exports, "LAYER", { enumerable: true, get: function () { return constant_1.LAYER; } });
|
|
70
72
|
Object.defineProperty(exports, "DIRECTION", { enumerable: true, get: function () { return constant_1.DIRECTION; } });
|
|
71
|
-
// 因为 typescript 部分版本不支持 export * as 语法。
|
|
72
|
-
var Types = tslib_1.__importStar(require("./interface"));
|
|
73
73
|
var dependents_1 = require("./dependents");
|
|
74
74
|
Object.defineProperty(exports, "Coordinate", { enumerable: true, get: function () { return dependents_1.Coordinate; } });
|
|
75
75
|
Object.defineProperty(exports, "Scale", { enumerable: true, get: function () { return dependents_1.Scale; } });
|
package/lib/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";AAAA,uCAAuC
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;AAE1B,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,SAAS;AACT,iCAA6C,CAAC,gBAAgB;AAArD,8FAAA,KAAK,OAAA;AAAE,6FAAA,IAAI,OAAA;AAAE,8FAAA,KAAK,OAAA;AAC3B,gDAA4E,CAAC,UAAU;AAA9E,2GAAA,UAAU,OAAuB;AAC1C,sDAA0E,CAAC,kBAAkB;AAApF,6HAAA,OAAO,OAAqB;AACrC,wCAAsD,CAAC,cAAc;AAA5D,iHAAA,OAAO,OAAY;AAC5B,8CAAwD,CAAC,YAAY;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WAAW;AACX,oCAA8C;AAC9C,wCAA+C;AAC/C,4CAA4E;AAC5E,8CAAsE;AACtE,0CAAiD;AACjD,kDAAgE;AAChE,yEAAsE;AACtE,8CAAgD;AAEnC,QAAA,IAAI,GAAG;IAClB,cAAc,yBAAA;IACd,SAAS,uBAAA;IACT,MAAM,oBAAA;IACN,IAAI,kBAAA;IACJ,SAAS,uBAAA;IACT,QAAQ,qBAAA;IACR,aAAa,0BAAA;IACb,gBAAgB,6BAAA;IAChB,mBAAmB,4BAAA;IACnB,eAAe,2BAAA;IACf,eAAe,wBAAA;IACf,gBAAgB;IAChB,OAAO,gBAAA;IACP,aAAa,iCAAA;CACd,CAAC","sourcesContent":["/* G2 的一个壳子,不包含 Geometry,由开发者自己定义和引入 */\n\nexport const VERSION = '4.2.12';\n\n// 核心基类导出\nexport { Chart, View, Event } from './chart'; // Chart, View 类\nexport { Controller as ComponentController } from './chart/controller/base'; // G2 组件基类\nexport { default as TooltipController } from './chart/controller/tooltip'; // G2 tooltip 组件基类\nexport { default as Geometry } from './geometry/base'; // Geometry 基类\nexport { default as Element } from './geometry/element'; // Element 类\nexport { default as GeometryLabel } from './geometry/label/base'; // Geometry Label 基类\nexport { Interaction, Action } from './interaction'; // Interaction, Action 基类\nexport { Facet } from './facet'; // Facet 基类\nexport { default as InteractionAction } from './interaction/action/base'; // Interaction Action 基类\n\n// 注册 ComponentController\nexport { registerComponentController } from './chart';\n\n// 注册 Geometry\nexport { registerGeometry } from './chart';\n\n// 注册 Geometry Shape\nexport { registerShape, registerShapeFactory, getShapeFactory } from './geometry/shape/base';\n\n// 注册 Geometry label 以及 Geometry Label 布局函数\nexport {\n registerGeometryLabel,\n registerGeometryLabelLayout,\n getGeometryLabel,\n getGeometryLabelLayout,\n} from './geometry/label';\n\n// 注册 interaction\nexport { getInteraction, registerInteraction, registerAction, getActionClass } from './interaction';\n\n// 注册 facet\nexport { getFacet, registerFacet } from './facet';\n\n// 注册主题\nexport { getTheme, registerTheme } from './theme';\n\n// G engine 管理相关\nexport { registerEngine, getEngine } from './engine';\n\n// 注册动画函数\nexport { registerAnimation, getAnimation } from './animate/animation';\n\nexport { LAYER, DIRECTION } from './constant';\n\n// 因为 typescript 部分版本不支持 export * as 语法。\nimport * as Types from './interface';\nexport type { Types };\n\nexport { IGroup, ShapeAttrs, Coordinate, Scale, ScaleConfig } from './dependents';\n\n// 一些工具方法导出\nimport { getMappingValue } from './util/attr';\nimport { getLegendItems } from './util/legend';\nimport { getAngle, getSectorPath, polarToCartesian } from './util/graphics';\nimport { rotate, transform, translate, zoom } from './util/transform';\nimport { getTooltipItems } from './util/tooltip';\nimport { getDelegationObject } from './interaction/action/util';\nimport { getPathPoints } from './geometry/shape/util/get-path-points';\nimport { getPath } from './geometry/shape/line';\n\nexport const Util = {\n getLegendItems,\n translate,\n rotate,\n zoom,\n transform,\n getAngle,\n getSectorPath,\n polarToCartesian,\n getDelegationObject,\n getTooltipItems,\n getMappingValue,\n // shape 的一些操作方法\n getPath,\n getPathPoints,\n};\n"]}
|
package/lib/dependents.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ICanvas, IElement, IGroup, IShape, PathCommand, BBox, Point, ShapeAttrs, Event, AbstractGroup, AbstractShape, } from '@antv/g-base';
|
|
2
|
-
export
|
|
2
|
+
export type IG = any;
|
|
3
3
|
export { registerAdjust, getAdjust, Adjust } from '@antv/adjust';
|
|
4
4
|
export { getAttribute, Attribute } from '@antv/attr';
|
|
5
5
|
export { Color } from '@antv/attr';
|
|
@@ -2,7 +2,7 @@ import { MappingDatum, Point } from '../../interface';
|
|
|
2
2
|
import { LabelCfg, LabelItem, LabelPointCfg, TextAlign } from './interface';
|
|
3
3
|
import Labels from '../../component/labels';
|
|
4
4
|
import Geometry from '../base';
|
|
5
|
-
export
|
|
5
|
+
export type GeometryLabelConstructor = new (cfg: any) => GeometryLabel;
|
|
6
6
|
/**
|
|
7
7
|
* Geometry Label 基类,用于生成 Geometry 下所有 label 的配置项信息
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ import { LabelItem } from './interface';
|
|
|
10
10
|
* @param region 画布区域
|
|
11
11
|
* @param cfg 用于存储各个布局函数开放给用户的配置数据
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
type GeometryLabelsLayoutFn = (items: LabelItem[], labels: IGroup[], shapes: IShape[] | IGroup[], region: BBox, cfg?: LooseObject) => void;
|
|
14
14
|
/**
|
|
15
15
|
* 获取 `type` 对应的 [[GeometryLabel]] 类
|
|
16
16
|
* @param type
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Coordinate } from '../../dependents';
|
|
2
2
|
import { Datum, GeometryLabelCfg, MappingDatum, Point } from '../../interface';
|
|
3
|
-
export
|
|
3
|
+
export type TextAlign = 'start' | 'center' | 'end' | 'left' | 'right';
|
|
4
4
|
/**
|
|
5
5
|
* @title 去除 readonly 修饰
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type Writeable<T> = {
|
|
8
8
|
-readonly [P in keyof T]: T[P];
|
|
9
9
|
};
|
|
10
10
|
export interface LabelCfg extends Omit<GeometryLabelCfg, 'offset'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/index.ts"],"names":[],"mappings":";;AAAA,mCAAqC;AAGrC,gCAA8D;AAC9D,+BAAuC;AAEvC,IAAM,gBAAgB,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE;IACpD,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/index.ts"],"names":[],"mappings":";;AAAA,mCAAqC;AAGrC,gCAA8D;AAC9D,+BAAuC;AAEvC,IAAM,gBAAgB,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE;IACpD,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,YAAC,SAAqB;QACpC,0BAA0B;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,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACrG,CAAC;YACD,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,IAAI,EAAE,KAAK;gBACX,WAAW,EAAE,CAAC;aACf;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC","sourcesContent":["import { isArray } from '@antv/util';\nimport { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\nimport { registerShape, registerShapeFactory } from '../base';\nimport { getShapeAttrs } from './util';\n\nconst AreaShapeFactory = registerShapeFactory('area', {\n defaultShapeType: 'area',\n getDefaultPoints(pointInfo: ShapePoint): Point[] {\n // area 基本标记的绘制需要获取上下两边的顶点\n const { x, y0 } = pointInfo;\n const y = isArray(pointInfo.y) ? pointInfo.y : [y0, pointInfo.y];\n\n return y.map((yItem: number) => {\n return {\n x: x as number,\n y: yItem,\n };\n });\n },\n});\n\n// Area 几何标记默认的 shape:填充的区域图\nregisterShape('area', 'area', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const attrs = getShapeAttrs(cfg, false, false, this);\n const shape = container.addShape({\n type: 'path',\n attrs,\n name: 'area',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number = 5.5) => {\n return [['M', x - r, y - 4], ['L', x + r, y - 4], ['L', x + r, y + 4], ['L', x - r, y + 4], ['Z']];\n },\n style: {\n r: 5,\n fill: color,\n fillOpacity: 1,\n },\n };\n },\n});\n\nexport default AreaShapeFactory;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/line.ts"],"names":[],"mappings":";;AAEA,gCAAwC;AACxC,+BAAuC;AAEvC;;GAEG;AACH,IAAA,oBAAa,EAAC,MAAM,EAAE,MAAM,EAAE;IAC5B,IAAI,
|
|
1
|
+
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/line.ts"],"names":[],"mappings":";;AAEA,gCAAwC;AACxC,+BAAuC;AAEvC;;GAEG;AACH,IAAA,oBAAa,EAAC,MAAM,EAAE,MAAM,EAAE;IAC5B,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAa,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACpD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC;YAC/B,IAAI,EAAE,MAAM;YACZ,KAAK,OAAA;YACL,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,UAAC,CAAS,EAAE,CAAS,EAAE,CAAe;gBAAf,kBAAA,EAAA,OAAe;gBAC5C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACrG,CAAC;YACD,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { ShapeInfo, ShapeMarkerCfg } from '../../../interface';\nimport { registerShape } from '../base';\nimport { getShapeAttrs } from './util';\n\n/**\n * 描边但不填充的区域图\n */\nregisterShape('area', 'line', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const attrs = getShapeAttrs(cfg, true, false, this);\n const shape = container.addShape({\n type: 'path',\n attrs,\n name: 'area',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number = 5.5) => {\n return [['M', x - r, y - 4], ['L', x + r, y - 4], ['L', x + r, y + 4], ['L', x - r, y + 4], ['Z']];\n },\n style: {\n r: 5,\n stroke: color,\n fill: null,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/smooth-line.ts"],"names":[],"mappings":";;AAGA,gCAAwC;AACxC,+BAAsD;AAEtD,eAAe;AACf,IAAA,oBAAa,EAAC,MAAM,EAAE,aAAa,EAAE;IACnC,IAAI,
|
|
1
|
+
{"version":3,"file":"smooth-line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/smooth-line.ts"],"names":[],"mappings":";;AAGA,gCAAwC;AACxC,+BAAsD;AAEtD,eAAe;AACf,IAAA,oBAAa,EAAC,MAAM,EAAE,aAAa,EAAE;IACnC,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,IAAM,KAAK,GAAG,IAAA,oBAAa,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAA,oBAAa,EAAC,UAAU,CAAC,CAAC,CAAC;QAC9E,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC;YAC/B,IAAI,EAAE,MAAM;YACZ,KAAK,OAAA;YACL,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,UAAC,CAAS,EAAE,CAAS,EAAE,CAAe;gBAAf,kBAAA,EAAA,OAAe;gBAC5C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACrG,CAAC;YACD,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getConstraint, getShapeAttrs } from './util';\n\n/** 描边的平滑曲面图 */\nregisterShape('area', 'smooth-line', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const coordinate = this.coordinate;\n const attrs = getShapeAttrs(cfg, true, true, this, getConstraint(coordinate));\n const shape = container.addShape({\n type: 'path',\n attrs,\n name: 'area',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number = 5.5) => {\n return [['M', x - r, y - 4], ['L', x + r, y - 4], ['L', x + r, y + 4], ['L', x - r, y + 4], ['Z']];\n },\n style: {\n r: 5,\n stroke: color,\n fill: null,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth.js","sourceRoot":"","sources":["../../../../src/geometry/shape/area/smooth.ts"],"names":[],"mappings":";;AAGA,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AAI,EAAE,KAAK;gBACX,WAAW,EAAE,CAAC;aACf;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getConstraint, getShapeAttrs } from './util';\n\n/**\n * 填充的平滑曲面图\n */\nregisterShape('area', 'smooth', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const coordinate = this.coordinate;\n const attrs = getShapeAttrs(cfg, false, true, this, getConstraint(coordinate));\n const shape = container.addShape({\n type: 'path',\n attrs,\n name: 'area',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number = 5.5) => {\n return [['M', x - r, y - 4], ['L', x + r, y - 4], ['L', x + r, y + 4], ['L', x - r, y + 4], ['Z']];\n },\n style: {\n r: 5,\n fill: color,\n fillOpacity: 1,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/geometry/shape/base.ts"],"names":[],"mappings":";;;;AACA,6CAAkD;AAClD,mCAAsD;AActD,oCAAkE;AAElE,sBAAsB;AACtB,IAAM,gBAAgB,GAAG;IACvB,YAAY;IACZ,UAAU,EAAE,IAAI;IAChB,qBAAqB;IACrB,gBAAgB,EAAE,IAAI;IACtB,WAAW;IACX,KAAK,EAAE,IAAI;IACX;;;;;OAKG;IACH,cAAc,
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/geometry/shape/base.ts"],"names":[],"mappings":";;;;AACA,6CAAkD;AAClD,mCAAsD;AActD,oCAAkE;AAElE,sBAAsB;AACtB,IAAM,gBAAgB,GAAG;IACvB,YAAY;IACZ,UAAU,EAAE,IAAI;IAChB,qBAAqB;IACrB,gBAAgB,EAAE,IAAI;IACtB,WAAW;IACX,KAAK,EAAE,IAAI;IACX;;;;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M,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,WAAmB,EAAE,GAAyB;IACjF,IAAM,SAAS,GAAG,IAAA,iBAAU,EAAC,WAAW,CAAC,CAAC;IAC1C,IAAM,OAAO,0DACR,gBAAgB,GAChB,GAAG,KACN,YAAY,EAAE,WAAW,GAC1B,CAAC;IACF,eAAe,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC;AATD,oDASC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,WAAmB,EAAE,SAAiB,EAAE,GAAkB;IACtF,IAAM,SAAS,GAAG,IAAA,iBAAU,EAAC,WAAW,CAAC,CAAC;IAC1C,IAAM,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAM,QAAQ,yCACT,SAAS,GACT,GAAG,CACP,CAAC;IACF,OAAO,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;IAC9B,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,sCASC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,WAAmB;IACjD,IAAM,SAAS,GAAG,IAAA,iBAAU,EAAC,WAAW,CAAC,CAAC;IAC1C,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC;AAHD,0CAGC","sourcesContent":["import { LooseObject } from '@antv/g-svg';\nimport { parsePathString } from '@antv/path-util';\nimport { deepMix, get, upperFirst } from '@antv/util';\nimport { IGroup, IShape, PathCommand } from '../../dependents';\nimport {\n Point,\n RegisterShape,\n RegisterShapeFactory,\n Shape,\n ShapeFactory,\n ShapeInfo,\n ShapeMarkerAttrs,\n ShapeMarkerCfg,\n ShapePoint,\n} from '../../interface';\n\nimport { convertNormalPath, convertPolarPath } from './util/path';\n\n/** ShapeFactory 基类 */\nconst ShapeFactoryBase = {\n /** 坐标系对象 */\n coordinate: null,\n /** 默认绘制的 Shape 类型 */\n defaultShapeType: null,\n /** 主题样式 */\n theme: null,\n /**\n * 获取 shape 绘制需要的关键点\n * @param shapeType shape 类型\n * @param shapePoint 每条数据映射后的坐标点以及 size 数值\n * @returns 图形关键点信息\n */\n getShapePoints(shapeType: string, shapePoint: ShapePoint) {\n const shape = this.getShape(shapeType);\n if (shape.getPoints) {\n return shape.getPoints(shapePoint);\n }\n\n return this.getDefaultPoints(shapePoint);\n },\n /**\n * 根据 shape 类型获取具体的 shape 实例\n * @param shapeType string shape 的类型\n * @returns\n */\n getShape(shapeType: string): Shape {\n const shape = this[shapeType] || this[this.defaultShapeType];\n shape.coordinate = this.coordinate;\n\n return shape;\n },\n /**\n * 获取 shape 的默认关键点\n * @override\n */\n getDefaultPoints() {\n return [];\n },\n /**\n * 获取 shape 的默认绘制样式 (内置的 shapeFactory 均有注册默认样式)\n */\n getDefaultStyle(geometryTheme: LooseObject): LooseObject {\n return get(geometryTheme, [this.defaultShapeType, 'default', 'style'], {});\n },\n /**\n * 获取 shape 对应的缩略图配置信息。\n * @param shapeType shape 类型\n * @param color 颜色\n * @param isInPolar 是否在极坐标系下\n * @returns 返回缩略图 marker 配置。\n */\n getMarker(shapeType: string, markerCfg: ShapeMarkerCfg): ShapeMarkerAttrs {\n let shape = this.getShape(shapeType);\n\n if (!shape.getMarker) {\n const defaultShapeType = this.defaultShapeType;\n shape = this.getShape(defaultShapeType);\n }\n\n const theme = this.theme;\n const shapeStyle = get(theme, [shapeType, 'default'], {});\n const markerStyle = shape.getMarker(markerCfg);\n\n return deepMix({}, shapeStyle, markerStyle);\n },\n /**\n * 绘制 shape\n * @override\n * @param shapeType 绘制的 shape 类型\n * @param cfg 绘制 shape 需要的信息\n * @param element Element 实例\n * @returns\n */\n drawShape(shapeType: string, cfg: ShapeInfo, container: IGroup): IShape | IGroup {\n const shape = this.getShape(shapeType);\n return shape.draw(cfg, container);\n },\n};\n\n/** Shape 基类 */\nconst ShapeBase = {\n /** 坐标系对象 */\n coordinate: null,\n /**\n * 将归一化的 path 转换成坐标系下的 path\n * @param path 归一化的路径\n * @returns\n */\n parsePath(path: string): PathCommand[] {\n const coordinate = this.coordinate;\n let parsedPath = parsePathString(path);\n if (coordinate.isPolar) {\n parsedPath = convertPolarPath(coordinate, parsedPath);\n } else {\n parsedPath = convertNormalPath(coordinate, parsedPath);\n }\n return parsedPath;\n },\n /**\n * 将归一化的坐标转换成画布坐标\n * @param point 归一化的坐标点数据\n * @returns\n */\n parsePoint(point: Point): Point {\n const coordinate = this.coordinate;\n return coordinate.convert(point);\n },\n /**\n * 0~1 points 转 画布 points\n * @param points 节点集合\n * @returns\n */\n parsePoints(points: Point[]): Point[] {\n const coordinate = this.coordinate;\n return points.map((point) => {\n return coordinate.convert(point);\n });\n },\n /**\n * 绘制 shape\n * @override\n */\n draw(cfg: ShapeInfo, container: IGroup) {},\n};\n\nconst ShapeFactoryMap = {};\n\n/**\n * 注册 ShapeFactory。\n * @param factoryName ShapeFactory 名称,对应 Geometry 几何标记名称。\n * @param cfg 注册 ShapeFactory 需要覆写定义的属性。\n * @returns 返回 ShapeFactory 对象。\n */\nexport function registerShapeFactory(factoryName: string, cfg: RegisterShapeFactory): ShapeFactory {\n const className = upperFirst(factoryName);\n const geomObj = {\n ...ShapeFactoryBase,\n ...cfg,\n geometryType: factoryName,\n };\n ShapeFactoryMap[className] = geomObj;\n return geomObj;\n}\n\n/**\n * 注册 Shape。\n * @param factoryName 对应的 ShapeFactory 名称。\n * @param shapeType 注册的 shape 名称。\n * @param cfg 注册 Shape 需要覆写定义的属性。\n * @returns shape 返回注册的 shape 对象。\n */\nexport function registerShape(factoryName: string, shapeType: string, cfg: RegisterShape): Shape {\n const className = upperFirst(factoryName);\n const factory = ShapeFactoryMap[className];\n const shapeObj = {\n ...ShapeBase,\n ...cfg,\n };\n factory[shapeType] = shapeObj;\n return shapeObj;\n}\n\n/**\n * 获取 factoryName 对应的 shapeFactory\n * @param factoryName\n * @returns shape factory\n */\nexport function getShapeFactory(factoryName: string): ShapeFactory {\n const className = upperFirst(factoryName);\n return ShapeFactoryMap[className];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arc.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/arc.ts"],"names":[],"mappings":";;;AAGA,mDAAoD;AACpD,gCAAwC;AACxC,+CAA6C;AAC7C,+BAA4C;AAE5C,SAAS,eAAe,CAAC,IAAW,EAAE,EAAS,EAAE,MAAa;IAC5D,IAAM,GAAG,GAAG,IAAA,eAAQ,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACjC,IAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAe,EAAE,MAAa;IAC3D,IAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACzC,IAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACzC,IAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,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up } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { getArcPath } from '../../../util/graphics';\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getCPath, getQPath } from './util';\n\nfunction getArcShapePath(from: Point, to: Point, center: Point) {\n const sub = getQPath(to, center);\n const path = [['M', from.x, from.y]];\n path.push(sub);\n return path;\n}\n\nfunction getArcShapeWeightPath(points: Point[], center: Point) {\n const arc1 = getQPath(points[1], center);\n const arc2 = getQPath(points[3], center);\n const path = [['M', points[0].x, points[0].y]];\n path.push(arc2);\n path.push(['L', points[3].x, points[3].y]);\n path.push(['L', points[2].x, points[2].y]);\n path.push(arc1);\n path.push(['L', points[1].x, points[1].y]);\n path.push(['L', points[0].x, points[0].y]);\n path.push(['Z']);\n return path;\n}\n\n// 弧线包括笛卡尔坐标系下的半圆弧线、极坐标系下以圆心为控制点的二阶曲线、笛卡尔坐标系下带权重的三阶曲线、极坐标系下带权重的以圆心为控制点的二阶曲线\nregisterShape('edge', 'arc', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n\n let points = cfg.points as Point[];\n const type = points.length > 2 ? 'weight' : 'normal';\n let path;\n if (cfg.isInCircle) {\n const center = { x: 0, y: 1 };\n if (type === 'normal') {\n path = getArcShapePath(points[0], points[1], center);\n } else {\n style.fill = style.stroke;\n path = getArcShapeWeightPath(points, center);\n }\n path = this.parsePath(path);\n\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n } else {\n if (type === 'normal') {\n points = this.parsePoints(points);\n path = getArcPath(\n (points[1].x + points[0].x) / 2,\n points[0].y,\n Math.abs(points[1].x - points[0].x) / 2,\n Math.PI,\n Math.PI * 2\n );\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n } else {\n const c1 = getCPath(points[1], points[3]);\n const c2 = getCPath(points[2], points[0]);\n\n path = [\n ['M', points[0].x, points[0].y],\n ['L', points[1].x, points[1].y],\n c1,\n ['L', points[3].x, points[3].y],\n ['L', points[2].x, points[2].y],\n c2,\n ['Z'],\n ];\n path = this.parsePath(path);\n style.fill = style.stroke;\n\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n }\n }\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: markerCfg.color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/index.ts"],"names":[],"mappings":";;;AAGA,gCAA8D;AAC9D,+CAA6C;AAC7C,qCAA2C;AAC3C,qDAAmD;AAEnD,IAAM,gBAAgB,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE;IACpD,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/index.ts"],"names":[],"mappings":";;;AAGA,gCAA8D;AAC9D,+CAA6C;AAC7C,qCAA2C;AAC3C,qDAAmD;AAEnD,IAAM,gBAAgB,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE;IACpD,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,YAAC,SAAqB;QACpC,OAAO,IAAA,0BAAW,EAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACF,CAAC,CAAC;AAEH,IAAA,oBAAa,EAAC,MAAM,EAAE,MAAM,EAAE;IAC5B,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QACtD,IAAM,IAAI,GAAG,IAAA,kBAAW,EAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAChF,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;YAChC,KAAK,wCACA,KAAK,KACR,IAAI,MAAA,GACL;SACF,CAAC,CAAC;IACL,CAAC;IACD,SAAS,YAAC,SAAyB;QACjC,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,GAAG;gBACN,IAAI,EAAE,SAAS,CAAC,KAAK;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape, registerShapeFactory } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getLinePath } from '../util/path';\nimport { splitPoints } from '../util/split-points';\n\nconst EdgeShapeFactory = registerShapeFactory('edge', {\n defaultShapeType: 'line',\n getDefaultPoints(pointInfo: ShapePoint): Point[] {\n return splitPoints(pointInfo);\n },\n});\n\nregisterShape('edge', 'line', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n const path = getLinePath(this.parsePoints(cfg.points), this.coordinate.isPolar);\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: markerCfg.color,\n },\n };\n },\n});\n\nexport default EdgeShapeFactory;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/smooth.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAkC;AAElC,SAAS,aAAa,CAAC,IAAW,EAAE,EAAS;IAC3C,IAAM,GAAG,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/B,IAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,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AAG;gBACN,IAAI,EAAE,SAAS,CAAC,KAAK;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getCPath } from './util';\n\nfunction getSmoothPath(from: Point, to: Point) {\n const sub = getCPath(from, to);\n const path = [['M', from.x, from.y]];\n\n path.push(sub);\n return path;\n}\n\nregisterShape('edge', 'smooth', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n const points = cfg.points;\n const path = this.parsePath(getSmoothPath(points[0] as Point, points[1] as Point));\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: markerCfg.color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vhv.js","sourceRoot":"","sources":["../../../../src/geometry/shape/edge/vhv.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAIlC,gCAAwC;AACxC,+CAA6C;AAE7C,IAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;AAE7B,SAAS,UAAU,CAAC,IAAW,EAAE,EAAS;IACxC,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC;QACV,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,cAAc;KACzD,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC;QACV,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC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AE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,IAAA,WAAI,EAAC,MAAM,EAAE,UAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAA,oBAAa,EAAC,MAAM,EAAE,KAAK,EAAE;IAC3B,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QACtD,IAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC1B,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAU,EAAE,MAAM,CAAC,CAAC,CAAU,CAAC,CAAC,CAAC;QAChF,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;YAChC,KAAK,wCACA,KAAK,KACR,IAAI,MAAA,GACL;SACF,CAAC,CAAC;IACL,CAAC;IACD,SAAS,YAAC,SAAyB;QACjC,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,GAAG;gBACN,IAAI,EAAE,SAAS,CAAC,KAAK;aACtB;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { each } from '@antv/util';\nimport { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\n\nconst CORNER_PERCENT = 1 / 3;\n\nfunction getVHVPath(from: Point, to: Point) {\n const points = [];\n points.push({\n x: from.x,\n y: from.y * (1 - CORNER_PERCENT) + to.y * CORNER_PERCENT,\n });\n points.push({\n x: to.x,\n y: from.y * (1 - CORNER_PERCENT) + to.y * CORNER_PERCENT,\n });\n points.push(to);\n\n const path = [['M', from.x, from.y]];\n each(points, (point) => {\n path.push(['L', point.x, point.y]);\n });\n\n return path;\n}\n\nregisterShape('edge', 'vhv', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n const points = cfg.points;\n const path = this.parsePath(getVHVPath(points[0] as Point, points[1] as Point));\n return container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n });\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: markerCfg.color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"funnel.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/funnel.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAsD;AAEtD,UAAU;AACV,IAAA,oBAAa,EAAC,UAAU,EAAE,QAAQ,EAAE;IAClC,SAAS,
|
|
1
|
+
{"version":3,"file":"funnel.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/funnel.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAsD;AAEtD,UAAU;AACV,IAAA,oBAAa,EAAC,UAAU,EAAE,QAAQ,EAAE;IAClC,SAAS,YAAC,UAAsB;QAC9B,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAoB;QAC3D,OAAO,IAAA,oBAAa,EAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,MAAiB,EAAE,GAAG,CAAC,UAAqB,EAAE,KAAK,CAAC,CAAC,CAAC;QACpG,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;YACvC,KAAK,wCACA,KAAK,KACR,IAAI,MAAA,GACL;YACD,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,IAAI,EAAE,KAAK;aACZ;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getFunnelPath, getRectPoints } from './util';\n\n/** 漏斗图 */\nregisterShape('interval', 'funnel', {\n getPoints(shapePoint: ShapePoint) {\n shapePoint.size = shapePoint.size * 2; // 漏斗图的 size 是柱状图的两倍\n return getRectPoints(shapePoint);\n },\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, false, true);\n const path = this.parsePath(getFunnelPath(cfg.points as Point[], cfg.nextPoints as Point[], false));\n const shape = container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n name: 'interval',\n });\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: 'square',\n style: {\n r: 4,\n fill: color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hollow-rect.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/hollow-rect.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,wCAA+C;AAC/C,+CAAqE;AACrE,+BAA4D;AAE5D,YAAY;AACZ,IAAA,oBAAa,EAAC,UAA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,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACvC,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAgB,SAAS,MAAzB,EAAE,SAAS,GAAK,SAAS,UAAd,CAAe;QACvC,IAAI,SAAS,EAAE;YACb,OAAO;gBACL,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE;oBACL,CAAC,EAAE,GAAG;oBACN,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,IAAI;iBACX;aACF,CAAC;SACH;QAED,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { BACKGROUND_SHAPE } from '../constant';\nimport { getBackgroundRectStyle, getStyle } from '../util/get-style';\nimport { getBackgroundRectPath, getRectPath } from './util';\n\n/** 描边柱状图 */\nregisterShape('interval', 'hollow-rect', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false);\n let group = container;\n const backgroundCfg = cfg?.background;\n if (backgroundCfg) {\n group = container.addGroup();\n const backgroundStyle = getBackgroundRectStyle(cfg);\n const backgroundPath = getBackgroundRectPath(cfg, this.parsePoints(cfg.points) as Point[], this.coordinate);\n group.addShape('path', {\n attrs: {\n ...backgroundStyle,\n path: backgroundPath,\n },\n capture: false,\n zIndex: -1,\n name: BACKGROUND_SHAPE,\n });\n }\n\n const path = this.parsePath(getRectPath(cfg.points as Point[]));\n const shape = group.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n name: 'interval',\n });\n\n return backgroundCfg ? group : shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color, isInPolar } = markerCfg;\n if (isInPolar) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n stroke: color,\n fill: null,\n },\n };\n }\n\n return {\n symbol: 'square',\n style: {\n r: 4,\n stroke: color,\n fill: null,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/index.ts"],"names":[],"mappings":";;;AAGA,gCAA8D;AAC9D,wCAA+C;AAC/C,+CAAqE;AACrE,+BAA4G;AAE5G,0BAA0B;AAC1B,IAAM,oBAAoB,GAAG,IAAA,2BAAoB,EAAC,UAAU,EAAE;IAC5D,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/index.ts"],"names":[],"mappings":";;;AAGA,gCAA8D;AAC9D,wCAA+C;AAC/C,+CAAqE;AACrE,+BAA4G;AAE5G,0BAA0B;AAC1B,IAAM,oBAAoB,GAAG,IAAA,2BAAoB,EAAC,UAAU,EAAE;IAC5D,gBAAgB,EAAE,MAAM;IACxB,gBAAgB,YAAC,SAAqB;QACpC,OAAO,IAAA,oBAAa,EAAC,SAAS,CAAC,CAAC;IAClC,CAAC;CACF,CAAC,CAAC;AAEH,6BAA6B;AAC7B,IAAA,oBAAa,EAAC,UAAU,EAAE,MAAM,EAAE;IAChC,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,GAAG,SAAS,CAAC;QAEtB,IAAM,aAAa,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,CAAC;QACtC,IAAI,aAAa,EAAE;YACjB,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC;gBACzB,IAAI,EAAE,gBAAgB;aACvB,CAAC,CAAC;YACH,IAAM,eAAe,GAAG,IA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I,EAAE,KAAK;iBACZ;aACF,CAAC;SACH;QAED,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,IAAI,EAAE,KAAK;aACZ;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,oBAAoB,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape, registerShapeFactory } from '../base';\nimport { BACKGROUND_SHAPE } from '../constant';\nimport { getBackgroundRectStyle, getStyle } from '../util/get-style';\nimport { getBackgroundRectPath, getIntervalRectPath, getRectPoints, getRectWithCornerRadius } from './util';\n\n/** Interval 的 shape 工厂 */\nconst IntervalShapeFactory = registerShapeFactory('interval', {\n defaultShapeType: 'rect',\n getDefaultPoints(pointInfo: ShapePoint): Point[] {\n return getRectPoints(pointInfo);\n },\n});\n\n/** Inerval 默认 shape,填充的矩形 */\nregisterShape('interval', 'rect', {\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, false, true);\n let group = container;\n\n const backgroundCfg = cfg?.background;\n if (backgroundCfg) {\n group = container.addGroup({\n name: 'interval-group',\n });\n const backgroundStyle = getBackgroundRectStyle(cfg);\n const backgroundPath = getBackgroundRectPath(cfg, this.parsePoints(cfg.points) as Point[], this.coordinate);\n group.addShape('path', {\n attrs: {\n ...backgroundStyle,\n path: backgroundPath,\n },\n capture: false,\n zIndex: -1,\n name: BACKGROUND_SHAPE,\n });\n }\n\n let path;\n if (style.radius && this.coordinate.isRect) {\n path = getRectWithCornerRadius(this.parsePoints(cfg.points), this.coordinate, style.radius);\n } else {\n path = this.parsePath(getIntervalRectPath(cfg.points as Point[], style.lineCap, this.coordinate));\n }\n\n const shape = group.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n name: 'interval',\n });\n\n return backgroundCfg ? group : shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color, isInPolar } = markerCfg;\n if (isInPolar) {\n return {\n symbol: 'circle',\n style: {\n r: 4.5,\n fill: color,\n },\n };\n }\n\n return {\n symbol: 'square',\n style: {\n r: 4,\n fill: color,\n },\n };\n },\n});\n\nexport default IntervalShapeFactory;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/line.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAIrC,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAqC;AACrC,+CAA4C;AAE5C,sBAAsB;AACtB,SAAS,aAAa,CAAC,SAAqB;IAClC,IAAA,CAAC,GAAY,SAAS,EAArB,EAAE,CAAC,GAAS,SAAS,EAAlB,EAAE,EAAE,GAAK,SAAS,GAAd,CAAe;IAE/B,IAAI,IAAA,cAAO,EAAC,CAAC,CAAC,EAAE;QACd,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,GAAG;YACtB,OAAO;gBACL,CAAC,EAAE,IAAA,cAAO,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1B,CAAC,EAAE,KAAK;aACT,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,aAAa;IACb,OAAO;QACL,EAAE,CAAC,EAAE,CAAW,EAAE,CAAC,EAAE,EAAE,EAAE;QACzB,EAAE,CAAC,EAAE,CAAW,EAAE,CAAC,GAAA,EAAE;KACtB,CAAC;AACJ,CAAC;AAED,IAAA,oBAAa,EAAC,UAAU,EAAE,MAAM,EAAE;IAChC,SAAS,
|
|
1
|
+
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/line.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAIrC,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAqC;AACrC,+CAA4C;AAE5C,sBAAsB;AACtB,SAAS,aAAa,CAAC,SA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YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,UAAC,CAAS,EAAE,CAAS,EAAE,CAAS;gBACtC,OAAO;oBACL,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACf,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;iBAChB,CAAC;YACJ,CAAC;YACD,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { isArray } from '@antv/util';\nimport { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getRectPath } from './util';\nimport { omit } from '../../../util/helper';\n\n// 根据数据点生成 Line 的两个关键点\nfunction getLinePoints(pointInfo: ShapePoint): Point[] {\n const { x, y, y0 } = pointInfo;\n\n if (isArray(y)) {\n return y.map((yItem, idx) => {\n return {\n x: isArray(x) ? x[idx] : x,\n y: yItem,\n };\n });\n }\n\n // 起始点从 y0 开始\n return [\n { x: x as number, y: y0 },\n { x: x as number, y },\n ];\n}\n\nregisterShape('interval', 'line', {\n getPoints(shapePoint: ShapePoint) {\n return getLinePoints(shapePoint);\n },\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false, 'lineWidth');\n const newStyle = omit({ ...style }, ['fill']);\n const path = this.parsePath(getRectPath(cfg.points as Point[], false));\n const shape = container.addShape('path', {\n attrs: {\n ...newStyle,\n path,\n },\n name: 'interval',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number) => {\n return [\n ['M', x, y - r],\n ['L', x, y + r],\n ];\n },\n style: {\n r: 5,\n stroke: color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pyramid.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/pyramid.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAsD;AAEtD,iBAAiB;AACjB,IAAA,oBAAa,EAAC,UAAU,EAAE,SAAS,EAAE;IACnC,SAAS,
|
|
1
|
+
{"version":3,"file":"pyramid.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/pyramid.ts"],"names":[],"mappings":";;;AAGA,gCAAwC;AACxC,+CAA6C;AAC7C,+BAAsD;AAEtD,iBAAiB;AACjB,IAAA,oBAAa,EAAC,UAAU,EAAE,SAAS,EAAE;IACnC,SAAS,YAAC,UAAsB;QAC9B,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,oBAAoB;QAC3D,OAAO,IAAA,oBAAa,EAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,YAAC,GAAc,EAAE,SAAiB;QACpC,IAAM,KAAK,GAAG,IAAA,oBAAQ,EAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,MAAiB,EAAE,GAAG,CAAC,UAAqB,EAAE,IAAI,CAAC,CAAC,CAAC;QACnG,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;YACvC,KAAK,wCACA,KAAK,KACR,IAAI,MAAA,GACL;YACD,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,IAAI,EAAE,KAAK;aACZ;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\nimport { getFunnelPath, getRectPoints } from './util';\n\n/** 金字塔图,尖底漏斗图 */\nregisterShape('interval', 'pyramid', {\n getPoints(shapePoint: ShapePoint) {\n shapePoint.size = shapePoint.size * 2; // 漏斗图的 size 是柱状图的两倍\n return getRectPoints(shapePoint);\n },\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, false, true);\n const path = this.parsePath(getFunnelPath(cfg.points as Point[], cfg.nextPoints as Point[], true));\n const shape = container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n name: 'interval',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: 'square',\n style: {\n r: 4,\n fill: color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tick.js","sourceRoot":"","sources":["../../../../src/geometry/shape/interval/tick.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAIrC,gCAAwC;AACxC,+CAA6C;AAE7C,8BAA8B;AAC9B,SAAS,aAAa,CAAC,SAAqB;;IAClC,IAAA,CAAC,GAAkB,SAAS,EAA3B,EAAE,CAAC,GAAe,SAAS,EAAxB,EAAE,EAAE,GAAW,SAAS,GAApB,EAAE,IAAI,GAAK,SAAS,KAAd,CAAe;IACrC,IAAI,IAAI,CAAC;IACT,IAAI,IAAI,CAAC;IACT,IAAI,IAAA,cAAO,EAAC,CAAC,CAAC,EAAE;QACd,KAAA,eAAe,CAAC,IAAA,EAAf,IAAI,QAAA,EAAE,IAAI,QAAA,CAAM;KAClB;SAAM;QACL,IAAI,GAAG,EAAE,CAAC;QACV,IAAI,GAAG,CAAC,CAAC;KACV;IAED,IAAM,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,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS,YAAC,SAAyB;QACzB,IAAA,KAAK,GAAK,SAAS,MAAd,CAAe;QAC5B,OAAO;YACL,MAAM,EAAE,UAAC,CAAS,EAAE,CAAS,EAAE,CAAS;gBACtC,OAAO;oBACL,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACvB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACvB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACf,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACf,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;oBACvB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;iBACxB,CAAC;YACJ,CAAC;YACD,KAAK,EAAE;gBACL,CAAC,EAAE,CAAC;gBACJ,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { isArray } from '@antv/util';\nimport { IGroup } from '../../../dependents';\nimport { Point, ShapeInfo, ShapeMarkerCfg, ShapePoint } from '../../../interface';\n\nimport { registerShape } from '../base';\nimport { getStyle } from '../util/get-style';\n\n// 根据数据点生成 tick shape 的 6 个关键点\nfunction getTickPoints(pointInfo: ShapePoint): Point[] {\n const { x, y, y0, size } = pointInfo;\n let yMin;\n let yMax;\n if (isArray(y)) {\n [yMin, yMax] = y;\n } else {\n yMin = y0;\n yMax = y;\n }\n\n const xMax = (x as number) + size / 2;\n const xMin = (x as number) - size / 2;\n\n // tick 关键点顺序\n // 4 - 1 - 5\n // |\n // 2 - 0 - 3\n return [\n { x: x as number, y: yMin },\n { x: x as number, y: yMax },\n { x: xMin, y: yMin },\n { x: xMax, y: yMin },\n { x: xMin, y: yMax },\n { x: xMax, y: yMax },\n ];\n}\n\n// 根据 tick 关键点绘制 path\nfunction getTickPath(points: Point[]) {\n return [\n ['M', points[0].x, points[0].y],\n ['L', points[1].x, points[1].y],\n ['M', points[2].x, points[2].y],\n ['L', points[3].x, points[3].y],\n ['M', points[4].x, points[4].y],\n ['L', points[5].x, points[5].y],\n ];\n}\n\n/** I 形状柱状图,常用于 error bar chart */\nregisterShape('interval', 'tick', {\n getPoints(shapePoint: ShapePoint) {\n return getTickPoints(shapePoint);\n },\n draw(cfg: ShapeInfo, container: IGroup) {\n const style = getStyle(cfg, true, false);\n const path = this.parsePath(getTickPath(cfg.points as Point[]));\n const shape = container.addShape('path', {\n attrs: {\n ...style,\n path,\n },\n name: 'interval',\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n const { color } = markerCfg;\n return {\n symbol: (x: number, y: number, r: number) => {\n return [\n ['M', x - r / 2, y - r],\n ['L', x + r / 2, y - r],\n ['M', x, y - r],\n ['L', x, y + r],\n ['M', x - r / 2, y + r],\n ['L', x + r / 2, y + r],\n ];\n },\n style: {\n r: 5,\n stroke: color,\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/geometry/shape/line/index.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAI3C,gCAA8D;AAC9D,2DAAwD;AACxD,+CAA6C;AAC7C,qCAA0D;AAC1D,qDAAmD;AACnD,+BAAuC;AAEvC,SAAS,aAAa,CAAC,GAAc,EAAE,MAAgB,EAAE,UAAuB;IACtE,IAAA,OAAO,GAAgD,GAAG,QAAnD,EAAE,YAAY,GAAkC,GAAG,aAArC,EAAE,UAAU,GAAsB,GAAG,WAAzB,EAAE,eAAe,GAAK,GAAG,gBAAR,CAAS;IACnE,IAAM,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AC,CAAC;oBAChB,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;iBACjB,CAAC;aACH;YAED,IAAM,KAAK,GAAG,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;YACrD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC;gBAC/B,IAAI,EAAE,MAAM;gBACZ,KAAK,OAAA;gBACL,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,CAAC,MAAM;aACjB,CAAC,CAAC;YAEH,OAAO,KAAK,CAAC;QACf,CAAC;QACD,SAAS,YAAC,SAAyB;YACjC,OAAO,IAAA,oBAAa,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC","sourcesContent":["import { each, isArray } from '@antv/util';\nimport { IGroup, ShapeAttrs } from '../../../dependents';\nimport { Point, Position, RangePoint, ShapeInfo, ShapeMarkerCfg } from '../../../interface';\n\nimport { registerShape, registerShapeFactory } from '../base';\nimport { getPathPoints } from '../util/get-path-points';\nimport { getStyle } from '../util/get-style';\nimport { getLinePath, getSplinePath } from '../util/path';\nimport { splitPoints } from '../util/split-points';\nimport { getLineMarker } from './util';\n\nfunction getShapeAttrs(cfg: ShapeInfo, smooth?: boolean, constraint?: Position[]) {\n const { isStack, connectNulls, isInCircle, showSinglePoint } = cfg;\n const shapeAttrs = getStyle(cfg, true, false, 'lineWidth');\n\n const points = getPathPoints(cfg.points, connectNulls, showSinglePoint); // 根据 connectNulls 值处理 points\n let path = [];\n for (let i = 0, len = points.length; i < len; i++) {\n const eachLinePoints = points[i];\n path = path.concat(getPath(eachLinePoints, isInCircle, isStack, smooth, constraint, shapeAttrs));\n }\n shapeAttrs.path = path;\n\n return shapeAttrs;\n}\n\n// 单条 path\nfunction getSinglePath(\n points: Point[],\n isInCircle: boolean,\n smooth?: boolean,\n constraint?: Position[],\n style?: ShapeAttrs\n) {\n if (points.length === 1) {\n // 只有一个点时\n return [\n ['M', points[0].x, points[0].y - style.lineWidth / 2],\n ['L', points[0].x, points[0].y],\n ['L', points[0].x, points[0].y + style.lineWidth / 2],\n ];\n }\n\n let path;\n if (!smooth) {\n path = getLinePath(points, false);\n if (isInCircle) {\n path.push(['Z']);\n }\n } else {\n // 直角坐标系下绘制曲线时限制最大值、最小值\n if (isInCircle && points.length) {\n points.push({ x: points[0].x, y: points[0].y });\n }\n path = getSplinePath(points, false, constraint);\n }\n\n return path;\n}\n\nfunction getRangePath(\n points: RangePoint[],\n isInCircle: boolean,\n isStack?: boolean,\n smooth?: boolean,\n constraint?: Position[],\n style?: ShapeAttrs\n) {\n const topPoints = [];\n const bottomPoints = [];\n each(points, (point: RangePoint) => {\n const result = splitPoints(point);\n topPoints.push(result[1]); // 上边\n bottomPoints.push(result[0]); // 底边\n });\n\n const topPath = getSinglePath(topPoints, isInCircle, smooth, constraint, style);\n const bottomPath = getSinglePath(bottomPoints, isInCircle, smooth, constraint, style);\n if (isStack) {\n return topPath;\n }\n return topPath.concat(bottomPath);\n}\n\n/**\n * 获取折线图 path\n */\nexport function getPath(\n points: Point[] | RangePoint[],\n isInCircle: boolean,\n isStack?: boolean,\n smooth?: boolean,\n constraint?: Position[],\n style?: ShapeAttrs\n) {\n if (points.length) {\n const first = points[0];\n\n return isArray(first.y)\n ? getRangePath(points as RangePoint[], isInCircle, isStack, smooth, constraint, style)\n : getSinglePath(points as Point[], isInCircle, smooth, constraint, style);\n }\n return [];\n}\n\nconst LineShapeFactory = registerShapeFactory('line', {\n defaultShapeType: 'line',\n});\n\n// 这里因为代码公用,所以直接全部注册\n// 'line' 默认折线;'dot' 点线 ···;'dash' 断线 - - -\neach(['line', 'dot', 'dash', 'smooth'], (shapeType) => {\n registerShape('line', shapeType, {\n draw(cfg: ShapeInfo, container: IGroup) {\n const smooth = shapeType === 'smooth';\n let constraint;\n if (smooth) {\n const { start, end } = this.coordinate;\n constraint = [\n [start.x, end.y],\n [end.x, start.y],\n ];\n }\n\n const attrs = getShapeAttrs(cfg, smooth, constraint);\n const shape = container.addShape({\n type: 'path',\n attrs,\n name: 'line',\n capture: !smooth,\n });\n\n return shape;\n },\n getMarker(markerCfg: ShapeMarkerCfg) {\n return getLineMarker(markerCfg, shapeType);\n },\n });\n});\n\nexport default LineShapeFactory;\n"]}
|