@visactor/vchart 2.0.12 → 2.0.13-alpha.1
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/build/es5/index.js +1 -1
- package/build/index.es.js +45 -39
- package/build/index.js +45 -39
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.js +1 -1
- package/cjs/animation/callback-disappear.js.map +1 -1
- package/cjs/animation/interface.d.ts +1 -1
- package/cjs/animation/interface.js.map +1 -1
- package/cjs/component/brush/brush.js +13 -12
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +2 -1
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +22 -20
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/constant/gradient.js +2 -1
- package/cjs/constant/scroll-bar.js +1 -2
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -1
- package/cjs/constant/word-cloud.js +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- package/esm/animation/callback-disappear.js +1 -1
- package/esm/animation/callback-disappear.js.map +1 -1
- package/esm/animation/interface.d.ts +1 -1
- package/esm/animation/interface.js.map +1 -1
- package/esm/component/brush/brush.js +13 -12
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +2 -1
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +22 -20
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/constant/gradient.js +2 -1
- package/esm/constant/scroll-bar.js +1 -2
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -1
- package/esm/constant/word-cloud.js +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- package/package.json +7 -7
|
@@ -29,39 +29,41 @@ export class BaseMarkPoint extends BaseMarker {
|
|
|
29
29
|
return "polar" === markerSpec.coordinateType || doPolarProcess ? "polar" : "geo" === markerSpec.coordinateType || doGeoProcess ? "geo" : "cartesian";
|
|
30
30
|
}
|
|
31
31
|
_createMarkerComponent() {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
33
|
-
const {itemContent: itemContent = {}, itemLine: itemLine = {}, targetSymbol: targetSymbol = {}} = this._spec,
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
33
|
+
const {itemContent: itemContent = {}, itemLine: itemLine = {}, targetSymbol: targetSymbol = {}} = this._spec, _9 = itemContent, {type: type = "text", text: label, symbol: symbol, image: image, richText: richText, customMark: customMark, textStyle: textStyle, symbolStyle: symbolStyle, imageStyle: imageStyle, richTextStyle: richTextStyle, customMarkStyle: customMarkStyle, style: style = {}, state: state = {}} = _9, restItemContent = __rest(_9, [ "type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state" ]);
|
|
34
34
|
let itemContentState = null, itemContentStyle = null, defaultStyle = {};
|
|
35
35
|
"text" === type ? (itemContentState = null !== (_a = null == label ? void 0 : label.state) && void 0 !== _a ? _a : state,
|
|
36
36
|
defaultStyle = {
|
|
37
37
|
dx: 0,
|
|
38
38
|
dy: 0
|
|
39
|
-
}, itemContentStyle = transformLabelAttributes(
|
|
39
|
+
}, itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), {
|
|
40
|
+
style: merge(defaultStyle, null !== (_c = null !== (_b = null == label ? void 0 : label.textStyle) && void 0 !== _b ? _b : textStyle) && void 0 !== _c ? _c : style)
|
|
41
|
+
}), this._markerData, this._markAttributeContext)) : "richText" === type ? (itemContentState = null !== (_d = null == richText ? void 0 : richText.state) && void 0 !== _d ? _d : state,
|
|
40
42
|
defaultStyle = {
|
|
41
43
|
width: 100,
|
|
42
44
|
height: 100
|
|
43
|
-
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (
|
|
45
|
+
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (_f = null !== (_e = null == richText ? void 0 : richText.style) && void 0 !== _e ? _e : richTextStyle) && void 0 !== _f ? _f : style), this._markerData, this._markAttributeContext)) : "symbol" === type ? (itemContentState = null !== (_g = null == symbol ? void 0 : symbol.state) && void 0 !== _g ? _g : state,
|
|
44
46
|
defaultStyle = {
|
|
45
47
|
symbolType: "star",
|
|
46
48
|
fill: "rgb(48, 115, 242)",
|
|
47
49
|
fillOpacity: .8,
|
|
48
50
|
size: 20
|
|
49
|
-
}, itemContentStyle = transformToGraphic(transformStyle(merge(defaultStyle, null !== (
|
|
51
|
+
}, itemContentStyle = transformToGraphic(transformStyle(merge(defaultStyle, null !== (_j = null !== (_h = null == symbol ? void 0 : symbol.style) && void 0 !== _h ? _h : symbolStyle) && void 0 !== _j ? _j : style), this._markerData, this._markAttributeContext))) : "image" === type ? (itemContentState = null !== (_k = null == image ? void 0 : image.state) && void 0 !== _k ? _k : state,
|
|
50
52
|
defaultStyle = {
|
|
51
53
|
width: 80,
|
|
52
54
|
height: 80
|
|
53
|
-
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (
|
|
54
|
-
itemContentStyle = transformStyle(null !== (
|
|
55
|
+
}, itemContentStyle = transformStyle(merge(defaultStyle, null !== (_m = null !== (_l = null == image ? void 0 : image.style) && void 0 !== _l ? _l : imageStyle) && void 0 !== _m ? _m : style), this._markerData, this._markAttributeContext)) : "custom" === type && (itemContentState = null !== (_o = null == customMark ? void 0 : customMark.state) && void 0 !== _o ? _o : state,
|
|
56
|
+
itemContentStyle = transformStyle(null !== (_q = null !== (_p = null == customMark ? void 0 : customMark.style) && void 0 !== _p ? _p : customMarkStyle) && void 0 !== _q ? _q : style, this._markerData, this._markAttributeContext));
|
|
55
57
|
const markPointAttrs = {
|
|
56
58
|
zIndex: this.layoutZIndex,
|
|
57
|
-
interactive: null === (
|
|
58
|
-
hover: null === (
|
|
59
|
-
select: null === (
|
|
59
|
+
interactive: null === (_r = this._spec.interactive) || void 0 === _r || _r,
|
|
60
|
+
hover: null === (_s = this._spec.interactive) || void 0 === _s || _s,
|
|
61
|
+
select: null === (_t = this._spec.interactive) || void 0 === _t || _t,
|
|
60
62
|
position: {
|
|
61
63
|
x: 0,
|
|
62
64
|
y: 0
|
|
63
65
|
},
|
|
64
|
-
clipInRange: null !== (
|
|
66
|
+
clipInRange: null !== (_u = this._spec.clip) && void 0 !== _u && _u,
|
|
65
67
|
itemContent: Object.assign(Object.assign({
|
|
66
68
|
type: type,
|
|
67
69
|
offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),
|
|
@@ -70,20 +72,20 @@ export class BaseMarkPoint extends BaseMarker {
|
|
|
70
72
|
style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)
|
|
71
73
|
}),
|
|
72
74
|
targetSymbol: {
|
|
73
|
-
offset: null !== (
|
|
74
|
-
visible: null !== (
|
|
75
|
-
size: null !== (
|
|
75
|
+
offset: null !== (_v = targetSymbol.offset) && void 0 !== _v ? _v : 0,
|
|
76
|
+
visible: null !== (_w = targetSymbol.visible) && void 0 !== _w && _w,
|
|
77
|
+
size: null !== (_x = targetSymbol.size) && void 0 !== _x ? _x : 20,
|
|
76
78
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
77
79
|
},
|
|
78
80
|
state: {
|
|
79
|
-
line: transformState(null !== (
|
|
80
|
-
lineStartSymbol: transformState(null !== (
|
|
81
|
-
lineEndSymbol: transformState(null !== (
|
|
81
|
+
line: transformState(null !== (_z = null === (_y = this._spec.itemLine.line) || void 0 === _y ? void 0 : _y.state) && void 0 !== _z ? _z : {}, this._markerData, this._markAttributeContext),
|
|
82
|
+
lineStartSymbol: transformState(null !== (_1 = null === (_0 = this._spec.itemLine.startSymbol) || void 0 === _0 ? void 0 : _0.state) && void 0 !== _1 ? _1 : {}, this._markerData, this._markAttributeContext),
|
|
83
|
+
lineEndSymbol: transformState(null !== (_3 = null === (_2 = this._spec.itemLine.endSymbol) || void 0 === _2 ? void 0 : _2.state) && void 0 !== _3 ? _3 : {}, this._markerData, this._markAttributeContext),
|
|
82
84
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
83
|
-
textBackground: transformState(null === (
|
|
84
|
-
targetItem: transformState(null !== (
|
|
85
|
+
textBackground: transformState(null === (_5 = null === (_4 = this._spec.itemContent.text) || void 0 === _4 ? void 0 : _4.labelBackground) || void 0 === _5 ? void 0 : _5.state, this._markerData, this._markAttributeContext),
|
|
86
|
+
targetItem: transformState(null !== (_7 = null === (_6 = this._spec.targetSymbol) || void 0 === _6 ? void 0 : _6.state) && void 0 !== _7 ? _7 : {}, this._markerData, this._markAttributeContext)
|
|
85
87
|
},
|
|
86
|
-
animation: null !== (
|
|
88
|
+
animation: null !== (_8 = this._spec.animation) && void 0 !== _8 && _8,
|
|
87
89
|
animationEnter: this._spec.animationEnter,
|
|
88
90
|
animationExit: this._spec.animationExit,
|
|
89
91
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/marker/mark-point/base-mark-point.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClD,O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CAAE,YAAY;4BAC7C,CAAC;gCACE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAS;4BAC3E,CAAC,CAAC,SAAS,CAAC,IAAI,KAEpB,OAAO,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,EACxG,OAAO,EAAE,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,GAClG;gBACR,SAAS;gBACT,EAAE,EAAE,IAAI,CAAC,cAAc;gBACvB,EAAE,EAAE,IAAI,CAAC,cAAc;aACxB,CAAC,CAAC;SACJ;IACH,CAAC;IAES,aAAa;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QAC/B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACpF,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,mBAAmB,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,EAAE;YAC5E,OAAO;SACR;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;;AA9NM,qBAAO,GAAG,WAAW,CAAC","file":"base-mark-point.js","sourcesContent":["import type { IMarkPoint, IMarkPointSpec } from './interface';\nimport {\n computeClipRange,\n computeOffsetFromRegion,\n getMarkPointProcessInfo,\n transformLabelAttributes,\n transformOffset,\n transformState,\n transformStyle\n} from '../utils';\nimport type { MarkPointAttrs } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';\nimport { isValid, merge } from '@visactor/vutils';\nimport { transformToGraphic } from '../../../util/style';\nimport { BaseMarker } from '../base-marker';\nimport { LayoutZIndex } from '../../../constant/layout';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { IMarkerLabelSpec } from '../interface';\n\nexport abstract class BaseMarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {\n static specKey = 'markPoint';\n specKey = 'markPoint';\n\n layoutZIndex: number = LayoutZIndex.MarkPoint;\n declare protected _markerComponent: MarkPointComponent;\n\n protected abstract _computePointsAttr(): any;\n\n static _getMarkerCoordinateType(markerSpec: any): string {\n const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);\n if (markerSpec.coordinateType === 'polar' || doPolarProcess) {\n return 'polar';\n } else if (markerSpec.coordinateType === 'geo' || doGeoProcess) {\n return 'geo';\n }\n return 'cartesian';\n }\n\n protected _createMarkerComponent() {\n const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;\n const {\n type = 'text',\n\n // 老写法\n text: label,\n symbol,\n image,\n richText,\n customMark,\n textStyle,\n symbolStyle,\n imageStyle,\n richTextStyle,\n customMarkStyle,\n\n // 新写法\n style = {},\n state = {},\n\n ...restItemContent\n } = itemContent as any;\n\n let itemContentState = null;\n let itemContentStyle = null;\n let defaultStyle = {};\n\n if (type === 'text') {\n itemContentState = label?.state ?? state;\n defaultStyle = {\n dx: 0,\n dy: 0\n };\n itemContentStyle = transformLabelAttributes(\n merge(defaultStyle, label ?? textStyle ?? (style as IMarkerLabelSpec)),\n this._markerData,\n this._markAttributeContext\n );\n } else if ((type as any) === 'richText') {\n itemContentState = richText?.state ?? state;\n defaultStyle = {\n width: 100,\n height: 100\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, richText?.style ?? richTextStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'symbol') {\n itemContentState = symbol?.state ?? state;\n defaultStyle = {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n };\n itemContentStyle = transformToGraphic(\n transformStyle(\n merge(defaultStyle, symbol?.style ?? symbolStyle ?? style),\n this._markerData,\n this._markAttributeContext\n )\n );\n } else if (type === 'image') {\n itemContentState = image?.state ?? state;\n defaultStyle = {\n width: 80,\n height: 80\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, image?.style ?? imageStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'custom') {\n itemContentState = customMark?.state ?? state;\n itemContentStyle = transformStyle(\n customMark?.style ?? customMarkStyle ?? style,\n this._markerData,\n this._markAttributeContext\n );\n }\n const markPointAttrs: MarkPointAttrs = {\n zIndex: this.layoutZIndex,\n interactive: this._spec.interactive ?? true,\n hover: this._spec.interactive ?? true,\n select: this._spec.interactive ?? true,\n position: { x: 0, y: 0 },\n clipInRange: this._spec.clip ?? false,\n itemContent: {\n type,\n offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n ...restItemContent, // Tips: 因为网站 demo 上已经透出了 imageStyle richTextStyle 的写法,为了兼容所以这个需要在后面覆盖\n style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)\n },\n targetSymbol: {\n offset: targetSymbol.offset ?? 0,\n visible: targetSymbol.visible ?? false,\n size: targetSymbol.size ?? 20,\n style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)\n },\n state: {\n line: transformState(this._spec.itemLine.line?.state ?? {}, this._markerData, this._markAttributeContext),\n lineStartSymbol: transformState(\n this._spec.itemLine.startSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n lineEndSymbol: transformState(\n this._spec.itemLine.endSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),\n textBackground: transformState(\n this._spec.itemContent.text?.labelBackground?.state,\n this._markerData,\n this._markAttributeContext\n ),\n targetItem: transformState(this._spec.targetSymbol?.state ?? {}, this._markerData, this._markAttributeContext)\n },\n animation: this._spec.animation ?? false,\n animationEnter: this._spec.animationEnter,\n animationExit: this._spec.animationExit,\n animationUpdate: this._spec.animationUpdate\n };\n\n const { visible, line = {}, ...restItemLine } = itemLine;\n if (visible !== false) {\n markPointAttrs.itemLine = {\n ...restItemLine,\n visible: true,\n lineStyle: transformToGraphic(line.style)\n } as any;\n } else {\n markPointAttrs.itemLine = {\n visible: false\n };\n }\n\n const markPoint = new MarkPointComponent(markPointAttrs);\n return markPoint as unknown as IGroup;\n }\n\n protected _markerLayout() {\n const spec = this._spec;\n const data = this._markerData;\n const relativeSeries = this._relativeSeries;\n\n const { point } = this._computePointsAttr();\n\n const seriesData = this._getRelativeDataView().latestData;\n const dataPoints = data\n ? data.latestData[0] && data.latestData[0].latestData\n ? data.latestData[0].latestData\n : data.latestData\n : seriesData;\n\n let limitRect;\n if (spec.clip || spec.itemContent?.confine) {\n const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);\n limitRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }\n if (this._markerComponent) {\n const attribute = this._markerComponent.attribute ?? {};\n const textStyle = (attribute.itemContent as any)?.textStyle ?? {};\n this._markerComponent.setAttributes({\n position: point === undefined ? { x: null, y: null } : point, // setAttrs时merge时undefined会被忽略, 所以这里做转换\n itemContent: {\n ...attribute.itemContent,\n textStyle: {\n ...textStyle,\n text: this._spec.itemContent.text?.formatMethod\n ? // type error here will be fixed in components\n (this._spec.itemContent.text.formatMethod(dataPoints, seriesData) as any)\n : textStyle.text\n },\n offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())\n } as any,\n limitRect,\n dx: this._layoutOffsetX,\n dy: this._layoutOffsetY\n });\n }\n }\n\n protected _initDataView(): void {\n const spec = this._spec as any;\n const { doXYProcess, doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(spec);\n const isCoordinateProcess = isValid(spec.coordinate);\n if (!isCoordinateProcess && !doXYProcess && !doPolarProcess && !doGeoProcess) {\n return;\n }\n\n this._initCommonDataView();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/component/marker/mark-point/base-mark-point.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,MAAM,OAAgB,aAAc,SAAQ,UAA0B;IAAtE;;QAEE,YAAO,GAAG,WAAW,CAAC;QAEtB,iBAAY,GAAW,YAAY,CAAC,SAAS,CAAC;IA+NhD,CAAC;IA1NC,MAAM,CAAC,wBAAwB,CAAC,UAAe;QAC7C,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,UAAU,CAAC,cAAc,KAAK,OAAO,IAAI,cAAc,EAAE;YAC3D,OAAO,OAAO,CAAC;SAChB;aAAM,IAAI,UAAU,CAAC,cAAc,KAAK,KAAK,IAAI,YAAY,EAAE;YAC9D,OAAO,KAAK,CAAC;SACd;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAES,sBAAsB;;QAC9B,MAAM,EAAE,WAAW,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;Q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C,IAAI,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,mBAAmB,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,EAAE;YAC5E,OAAO;SACR;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;;AAjOM,qBAAO,GAAG,WAAW,CAAC","file":"base-mark-point.js","sourcesContent":["import type { IMarkPoint, IMarkPointSpec } from './interface';\nimport {\n computeClipRange,\n computeOffsetFromRegion,\n getMarkPointProcessInfo,\n transformLabelAttributes,\n transformOffset,\n transformState,\n transformStyle\n} from '../utils';\nimport type { MarkPointAttrs } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkPoint as MarkPointComponent } from '@visactor/vrender-components';\nimport { isValid, merge } from '@visactor/vutils';\nimport { transformToGraphic } from '../../../util/style';\nimport { BaseMarker } from '../base-marker';\nimport { LayoutZIndex } from '../../../constant/layout';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { IMarkerLabelSpec, IMarkerLabelWithoutRefSpec } from '../interface';\n\nexport abstract class BaseMarkPoint extends BaseMarker<IMarkPointSpec> implements IMarkPoint {\n static specKey = 'markPoint';\n specKey = 'markPoint';\n\n layoutZIndex: number = LayoutZIndex.MarkPoint;\n declare protected _markerComponent: MarkPointComponent;\n\n protected abstract _computePointsAttr(): any;\n\n static _getMarkerCoordinateType(markerSpec: any): string {\n const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);\n if (markerSpec.coordinateType === 'polar' || doPolarProcess) {\n return 'polar';\n } else if (markerSpec.coordinateType === 'geo' || doGeoProcess) {\n return 'geo';\n }\n return 'cartesian';\n }\n\n protected _createMarkerComponent() {\n const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;\n const {\n type = 'text',\n\n // 老写法\n text: label,\n symbol,\n image,\n richText,\n customMark,\n textStyle,\n symbolStyle,\n imageStyle,\n richTextStyle,\n customMarkStyle,\n\n // 新写法\n style = {},\n state = {},\n\n ...restItemContent\n } = itemContent as any;\n\n let itemContentState = null;\n let itemContentStyle = null;\n let defaultStyle = {};\n\n if (type === 'text') {\n itemContentState = label?.state ?? state;\n defaultStyle = {\n dx: 0,\n dy: 0\n };\n itemContentStyle = transformLabelAttributes(\n {\n ...label,\n style: merge(defaultStyle, label?.textStyle ?? textStyle ?? (style as Pick<IMarkerLabelSpec, 'style'>))\n },\n this._markerData,\n this._markAttributeContext\n );\n } else if ((type as any) === 'richText') {\n itemContentState = richText?.state ?? state;\n defaultStyle = {\n width: 100,\n height: 100\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, richText?.style ?? richTextStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'symbol') {\n itemContentState = symbol?.state ?? state;\n defaultStyle = {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n };\n itemContentStyle = transformToGraphic(\n transformStyle(\n merge(defaultStyle, symbol?.style ?? symbolStyle ?? style),\n this._markerData,\n this._markAttributeContext\n )\n );\n } else if (type === 'image') {\n itemContentState = image?.state ?? state;\n defaultStyle = {\n width: 80,\n height: 80\n };\n itemContentStyle = transformStyle(\n merge(defaultStyle, image?.style ?? imageStyle ?? style),\n this._markerData,\n this._markAttributeContext\n );\n } else if (type === 'custom') {\n itemContentState = customMark?.state ?? state;\n itemContentStyle = transformStyle(\n customMark?.style ?? customMarkStyle ?? style,\n this._markerData,\n this._markAttributeContext\n );\n }\n const markPointAttrs: MarkPointAttrs = {\n zIndex: this.layoutZIndex,\n interactive: this._spec.interactive ?? true,\n hover: this._spec.interactive ?? true,\n select: this._spec.interactive ?? true,\n position: { x: 0, y: 0 },\n clipInRange: this._spec.clip ?? false,\n itemContent: {\n type,\n offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()),\n ...restItemContent, // Tips: 因为网站 demo 上已经透出了 imageStyle richTextStyle 的写法,为了兼容所以这个需要在后面覆盖\n style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext)\n },\n targetSymbol: {\n offset: targetSymbol.offset ?? 0,\n visible: targetSymbol.visible ?? false,\n size: targetSymbol.size ?? 20,\n style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)\n },\n state: {\n line: transformState(this._spec.itemLine.line?.state ?? {}, this._markerData, this._markAttributeContext),\n lineStartSymbol: transformState(\n this._spec.itemLine.startSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n lineEndSymbol: transformState(\n this._spec.itemLine.endSymbol?.state ?? {},\n this._markerData,\n this._markAttributeContext\n ),\n itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),\n textBackground: transformState(\n this._spec.itemContent.text?.labelBackground?.state,\n this._markerData,\n this._markAttributeContext\n ),\n targetItem: transformState(this._spec.targetSymbol?.state ?? {}, this._markerData, this._markAttributeContext)\n },\n animation: this._spec.animation ?? false,\n animationEnter: this._spec.animationEnter,\n animationExit: this._spec.animationExit,\n animationUpdate: this._spec.animationUpdate\n };\n\n const { visible, line = {}, ...restItemLine } = itemLine;\n if (visible !== false) {\n markPointAttrs.itemLine = {\n ...restItemLine,\n visible: true,\n lineStyle: transformToGraphic(line.style)\n } as any;\n } else {\n markPointAttrs.itemLine = {\n visible: false\n };\n }\n\n const markPoint = new MarkPointComponent(markPointAttrs);\n return markPoint as unknown as IGroup;\n }\n\n protected _markerLayout() {\n const spec = this._spec;\n const data = this._markerData;\n const relativeSeries = this._relativeSeries;\n\n const { point } = this._computePointsAttr();\n\n const seriesData = this._getRelativeDataView().latestData;\n const dataPoints = data\n ? data.latestData[0] && data.latestData[0].latestData\n ? data.latestData[0].latestData\n : data.latestData\n : seriesData;\n\n let limitRect;\n if (spec.clip || spec.itemContent?.confine) {\n const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);\n limitRect = {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }\n if (this._markerComponent) {\n const attribute = this._markerComponent.attribute ?? {};\n const textStyle = (attribute.itemContent as any)?.textStyle ?? {};\n this._markerComponent.setAttributes({\n position: point === undefined ? { x: null, y: null } : point, // setAttrs时merge时undefined会被忽略, 所以这里做转换\n itemContent: {\n ...attribute.itemContent,\n textStyle: {\n ...textStyle,\n text: this._spec.itemContent.text?.formatMethod\n ? // type error here will be fixed in components\n (this._spec.itemContent.text.formatMethod(dataPoints, seriesData) as any)\n : textStyle.text\n },\n offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),\n offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())\n } as any,\n limitRect,\n dx: this._layoutOffsetX,\n dy: this._layoutOffsetY\n });\n }\n }\n\n protected _initDataView(): void {\n const spec = this._spec as any;\n const { doXYProcess, doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(spec);\n const isCoordinateProcess = isValid(spec.coordinate);\n if (!isCoordinateProcess && !doXYProcess && !doPolarProcess && !doGeoProcess) {\n return;\n }\n\n this._initCommonDataView();\n }\n}\n"]}
|
package/esm/constant/gradient.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export const SCROLL_BAR_DEFAULT_SIZE = 12;
|
|
2
|
-
//# sourceMappingURL=scroll-bar.js.map
|
|
1
|
+
export const SCROLL_BAR_DEFAULT_SIZE = 12;
|
package/esm/constant/sunburst.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const SUNBURST_AUTO_VISIBLE_DEFAULT_THRESHOLD = 10;
|
|
2
|
-
//# sourceMappingURL=sunburst.js.map
|
|
2
|
+
//# sourceMappingURL=sunburst.js.map
|
|
@@ -13,4 +13,4 @@ export const WORDCLOUD_DATA_TOTAL = `${PREFIX}_WORDCLOUD_DATA_TOTAL`;
|
|
|
13
13
|
export const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
14
14
|
|
|
15
15
|
export const WORDCLOUD_SHAPE_DATA_TOTAL = `${PREFIX}_WORDCLOUD_SHAPE_DATA_TOTAL`;
|
|
16
|
-
//# sourceMappingURL=word-cloud.js.map
|
|
16
|
+
//# sourceMappingURL=word-cloud.js.map
|
package/esm/core/interface.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=interface.js.map
|
|
2
|
+
//# sourceMappingURL=interface.js.map
|
package/esm/core/util.js
CHANGED
package/esm/core/vchart.js
CHANGED
|
@@ -1010,4 +1010,4 @@ export const registerVChartCore = () => {
|
|
|
1010
1010
|
Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
|
|
1011
1011
|
registerGroupMark(), registerGesturePlugin(), registerElementHighlight(), registerElementSelect(),
|
|
1012
1012
|
registerTheme(darkTheme.name, darkTheme);
|
|
1013
|
-
//# sourceMappingURL=vchart.js.map
|
|
1013
|
+
//# sourceMappingURL=vchart.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vchart",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13-alpha.1",
|
|
4
4
|
"description": "charts lib based @visactor/VGrammar",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"@size-limit/file": "9.0.0",
|
|
82
82
|
"rimraf": "3.0.2",
|
|
83
83
|
"cross-env": "^7.0.3",
|
|
84
|
+
"@internal/bundler": "0.0.1",
|
|
84
85
|
"@internal/eslint-config": "0.0.1",
|
|
85
86
|
"@internal/typescript-json-schema": "0.0.1",
|
|
86
|
-
"@internal/bundler": "0.0.1",
|
|
87
87
|
"@internal/ts-config": "0.0.1"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"@visactor/vdataset": "~1.0.12",
|
|
92
92
|
"@visactor/vscale": "~1.0.12",
|
|
93
93
|
"@visactor/vlayouts": "~1.0.12",
|
|
94
|
-
"@visactor/vrender-core": "
|
|
95
|
-
"@visactor/vrender-kits": "
|
|
96
|
-
"@visactor/vrender-components": "
|
|
97
|
-
"@visactor/vrender-animate": "
|
|
98
|
-
"@visactor/vutils-extension": "2.0.
|
|
94
|
+
"@visactor/vrender-core": "1.0.37-alpha.0",
|
|
95
|
+
"@visactor/vrender-kits": "1.0.37-alpha.0",
|
|
96
|
+
"@visactor/vrender-components": "1.0.37-alpha.0",
|
|
97
|
+
"@visactor/vrender-animate": "1.0.37-alpha.0",
|
|
98
|
+
"@visactor/vutils-extension": "2.0.13-alpha.1"
|
|
99
99
|
},
|
|
100
100
|
"publishConfig": {
|
|
101
101
|
"access": "public",
|