@visactor/vrender-components 0.14.1-alpha.3 → 0.14.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/marker/base.d.ts +3 -0
- package/cjs/marker/base.js +25 -10
- package/cjs/marker/base.js.map +1 -1
- package/dist/index.js +31 -14
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/marker/base.d.ts +3 -0
- package/es/marker/base.js +25 -10
- package/es/marker/base.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.version = void 0, exports.version = "0.14.1-alpha.
|
|
20
|
+
}), exports.version = void 0, exports.version = "0.14.1-alpha.5", __exportStar(require("./core/base"), exports),
|
|
21
21
|
__exportStar(require("./scrollbar"), exports), __exportStar(require("./tag"), exports),
|
|
22
22
|
__exportStar(require("./poptip"), exports), __exportStar(require("./crosshair"), exports),
|
|
23
23
|
__exportStar(require("./label"), exports), __exportStar(require("./axis"), exports),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.1-alpha.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.1-alpha.5\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
|
package/cjs/marker/base.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import { AbstractComponent } from '../core/base';
|
|
|
3
3
|
import type { Tag } from '../tag';
|
|
4
4
|
import type { MarkerAttrs } from './type';
|
|
5
5
|
export declare abstract class Marker<T extends MarkerAttrs> extends AbstractComponent<Required<T>> {
|
|
6
|
+
private _containerClip;
|
|
6
7
|
private _container;
|
|
7
8
|
protected _label: Tag;
|
|
8
9
|
protected abstract setLabelPos(): any;
|
|
9
10
|
protected abstract initMarker(container: IGroup): any;
|
|
10
11
|
protected abstract updateMarker(): any;
|
|
12
|
+
private _initContainer;
|
|
13
|
+
private _updateContainer;
|
|
11
14
|
protected render(): void;
|
|
12
15
|
}
|
package/cjs/marker/base.js
CHANGED
|
@@ -7,18 +7,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base");
|
|
8
8
|
|
|
9
9
|
class Marker extends base_1.AbstractComponent {
|
|
10
|
+
_initContainer() {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
12
|
+
const groupClip = (0, vrender_1.createGroup)(Object.assign(Object.assign({}, null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.clipRange), {
|
|
13
|
+
clip: null !== (_c = (0, vutils_1.isValid)(null === (_b = this.attribute) || void 0 === _b ? void 0 : _b.clipRange)) && void 0 !== _c && _c
|
|
14
|
+
}));
|
|
15
|
+
groupClip.name = "marker-container";
|
|
16
|
+
const group = (0, vrender_1.createGroup)({
|
|
17
|
+
x: null !== (_f = -(null === (_e = null === (_d = this.attribute) || void 0 === _d ? void 0 : _d.clipRange) || void 0 === _e ? void 0 : _e.x)) && void 0 !== _f ? _f : 0,
|
|
18
|
+
y: null !== (_j = -(null === (_h = null === (_g = this.attribute) || void 0 === _g ? void 0 : _g.clipRange) || void 0 === _h ? void 0 : _h.y)) && void 0 !== _j ? _j : 0
|
|
19
|
+
});
|
|
20
|
+
groupClip.add(group), this._containerClip = groupClip, this.add(groupClip), this._container = group;
|
|
21
|
+
}
|
|
22
|
+
_updateContainer() {
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
24
|
+
this._containerClip.setAttributes(Object.assign(Object.assign({}, null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.clipRange), {
|
|
25
|
+
clip: null !== (_c = (0, vutils_1.isValid)(null === (_b = this.attribute) || void 0 === _b ? void 0 : _b.clipRange)) && void 0 !== _c && _c
|
|
26
|
+
})), this._container.setAttributes({
|
|
27
|
+
x: null !== (_f = -(null === (_e = null === (_d = this.attribute) || void 0 === _d ? void 0 : _d.clipRange) || void 0 === _e ? void 0 : _e.x)) && void 0 !== _f ? _f : 0,
|
|
28
|
+
y: null !== (_j = -(null === (_h = null === (_g = this.attribute) || void 0 === _g ? void 0 : _g.clipRange) || void 0 === _h ? void 0 : _h.y)) && void 0 !== _j ? _j : 0
|
|
29
|
+
});
|
|
30
|
+
}
|
|
10
31
|
render() {
|
|
11
|
-
var _a, _b
|
|
32
|
+
var _a, _b;
|
|
12
33
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
13
|
-
|
|
14
|
-
this.setAttribute("childrenPickable", !1)), markerVisible
|
|
15
|
-
|
|
16
|
-
})), this.updateMarker(); else {
|
|
17
|
-
const group = (0, vrender_1.createGroup)(Object.assign(Object.assign({}, null === (_c = this.attribute) || void 0 === _c ? void 0 : _c.clipRange), {
|
|
18
|
-
clip: null !== (_e = (0, vutils_1.isValid)(null === (_d = this.attribute) || void 0 === _d ? void 0 : _d.clipRange)) && void 0 !== _e && _e
|
|
19
|
-
}));
|
|
20
|
-
group.name = "marker-container", this.add(group), this._container = group, this.initMarker(group);
|
|
21
|
-
}
|
|
34
|
+
null !== (_b = this.attribute.interactive) && void 0 !== _b && _b || (this.setAttribute("pickable", !1),
|
|
35
|
+
this.setAttribute("childrenPickable", !1)), markerVisible && (this._containerClip ? (this._updateContainer(),
|
|
36
|
+
this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)));
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
|
package/cjs/marker/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["marker/base.ts"],"names":[],"mappings":";;;AACA,+CAAgD;AAChD,6CAA2C;AAC3C,uCAAiD;AAIjD,MAAsB,MAA8B,SAAQ,wBAA8B;
|
|
1
|
+
{"version":3,"sources":["marker/base.ts"],"names":[],"mappings":";;;AACA,+CAAgD;AAChD,6CAA2C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AE,CAAC,CAAA,mCAAI,CAAC;SACtC,CAAC,CAAC;IACL,CAAC;IAES,MAAM;;QACd,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,SAAS,CAAC,OAAO,mCAAI,IAAI,CAAC;QACrD,MAAM,iBAAiB,GAAG,MAAA,IAAI,CAAC,SAAS,CAAC,WAAW,mCAAI,KAAK,CAAC;QAE9D,IAAI,CAAC,iBAAiB,EAAE;YACtB,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YACrC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;SAC9C;QAED,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;gBACxB,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aAClC;iBAAM;gBACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB;SACF;IACH,CAAC;CACF;AAxDD,wBAwDC","file":"base.js","sourcesContent":["import type { IGroup } from '@visactor/vrender';\nimport { createGroup } from '@visactor/vrender';\nimport { isValid } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { Tag } from '../tag';\nimport type { MarkerAttrs } from './type';\n\nexport abstract class Marker<T extends MarkerAttrs> extends AbstractComponent<Required<T>> {\n private _containerClip!: IGroup;\n private _container!: IGroup;\n\n protected _label!: Tag;\n\n protected abstract setLabelPos(): any;\n protected abstract initMarker(container: IGroup): any;\n protected abstract updateMarker(): any;\n\n private _initContainer() {\n const groupClip = createGroup({\n ...this.attribute?.clipRange,\n clip: isValid(this.attribute?.clipRange) ?? false\n });\n groupClip.name = 'marker-container';\n const group = createGroup({\n x: -this.attribute?.clipRange?.x ?? 0,\n y: -this.attribute?.clipRange?.y ?? 0\n });\n groupClip.add(group);\n this._containerClip = groupClip;\n this.add(groupClip);\n this._container = group;\n }\n\n private _updateContainer() {\n this._containerClip.setAttributes({\n ...this.attribute?.clipRange,\n clip: isValid(this.attribute?.clipRange) ?? false\n });\n this._container.setAttributes({\n x: -this.attribute?.clipRange?.x ?? 0,\n y: -this.attribute?.clipRange?.y ?? 0\n });\n }\n\n protected render() {\n const markerVisible = this.attribute.visible ?? true;\n const markerInteractive = this.attribute.interactive ?? false;\n\n if (!markerInteractive) {\n this.setAttribute('pickable', false);\n this.setAttribute('childrenPickable', false);\n }\n\n if (markerVisible) {\n if (!this._containerClip) {\n this._initContainer();\n this.initMarker(this._container);\n } else {\n this._updateContainer();\n this.updateMarker();\n }\n }\n }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -6045,8 +6045,34 @@
|
|
|
6045
6045
|
})(exports.IMarkPointItemPosition || (exports.IMarkPointItemPosition = {}));
|
|
6046
6046
|
|
|
6047
6047
|
class Marker extends AbstractComponent {
|
|
6048
|
+
_containerClip;
|
|
6048
6049
|
_container;
|
|
6049
6050
|
_label;
|
|
6051
|
+
_initContainer() {
|
|
6052
|
+
const groupClip = vrender.createGroup({
|
|
6053
|
+
...this.attribute?.clipRange,
|
|
6054
|
+
clip: vutils.isValid(this.attribute?.clipRange) ?? false
|
|
6055
|
+
});
|
|
6056
|
+
groupClip.name = 'marker-container';
|
|
6057
|
+
const group = vrender.createGroup({
|
|
6058
|
+
x: -this.attribute?.clipRange?.x ?? 0,
|
|
6059
|
+
y: -this.attribute?.clipRange?.y ?? 0
|
|
6060
|
+
});
|
|
6061
|
+
groupClip.add(group);
|
|
6062
|
+
this._containerClip = groupClip;
|
|
6063
|
+
this.add(groupClip);
|
|
6064
|
+
this._container = group;
|
|
6065
|
+
}
|
|
6066
|
+
_updateContainer() {
|
|
6067
|
+
this._containerClip.setAttributes({
|
|
6068
|
+
...this.attribute?.clipRange,
|
|
6069
|
+
clip: vutils.isValid(this.attribute?.clipRange) ?? false
|
|
6070
|
+
});
|
|
6071
|
+
this._container.setAttributes({
|
|
6072
|
+
x: -this.attribute?.clipRange?.x ?? 0,
|
|
6073
|
+
y: -this.attribute?.clipRange?.y ?? 0
|
|
6074
|
+
});
|
|
6075
|
+
}
|
|
6050
6076
|
render() {
|
|
6051
6077
|
const markerVisible = this.attribute.visible ?? true;
|
|
6052
6078
|
const markerInteractive = this.attribute.interactive ?? false;
|
|
@@ -6055,21 +6081,12 @@
|
|
|
6055
6081
|
this.setAttribute('childrenPickable', false);
|
|
6056
6082
|
}
|
|
6057
6083
|
if (markerVisible) {
|
|
6058
|
-
if (!this.
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
clip: vutils.isValid(this.attribute?.clipRange) ?? false
|
|
6062
|
-
});
|
|
6063
|
-
group.name = 'marker-container';
|
|
6064
|
-
this.add(group);
|
|
6065
|
-
this._container = group;
|
|
6066
|
-
this.initMarker(group);
|
|
6084
|
+
if (!this._containerClip) {
|
|
6085
|
+
this._initContainer();
|
|
6086
|
+
this.initMarker(this._container);
|
|
6067
6087
|
}
|
|
6068
6088
|
else {
|
|
6069
|
-
this.
|
|
6070
|
-
...this.attribute?.clipRange,
|
|
6071
|
-
clip: vutils.isValid(this.attribute?.clipRange) ?? false
|
|
6072
|
-
});
|
|
6089
|
+
this._updateContainer();
|
|
6073
6090
|
this.updateMarker();
|
|
6074
6091
|
}
|
|
6075
6092
|
}
|
|
@@ -10645,7 +10662,7 @@
|
|
|
10645
10662
|
}
|
|
10646
10663
|
}
|
|
10647
10664
|
|
|
10648
|
-
const version = "0.14.1-alpha.
|
|
10665
|
+
const version = "0.14.1-alpha.5";
|
|
10649
10666
|
|
|
10650
10667
|
exports.AbstractComponent = AbstractComponent;
|
|
10651
10668
|
exports.ArcInfo = ArcInfo;
|