@visactor/vchart 1.13.14 → 1.13.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +7 -4
  3. package/build/index.js +7 -4
  4. package/build/index.min.js +1 -1
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/config.js +2 -1
  7. package/cjs/animation/utils.js +1 -2
  8. package/cjs/constant/scroll-bar.js +1 -1
  9. package/cjs/constant/sunburst.js +1 -1
  10. package/cjs/constant/waterfall.js +1 -1
  11. package/cjs/constant/word-cloud.js +1 -1
  12. package/cjs/core/index.d.ts +1 -1
  13. package/cjs/core/index.js +1 -1
  14. package/cjs/core/index.js.map +1 -1
  15. package/cjs/core/interface.js +1 -2
  16. package/cjs/core/vchart.js +2 -1
  17. package/cjs/event/event-dispatcher.js +1 -1
  18. package/cjs/event/event.js +1 -1
  19. package/cjs/event/index.js +1 -1
  20. package/cjs/event/interface.js +1 -1
  21. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  22. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +4 -3
  23. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  24. package/esm/animation/config.js +2 -1
  25. package/esm/animation/utils.js +1 -2
  26. package/esm/constant/scroll-bar.js +1 -1
  27. package/esm/constant/sunburst.js +1 -1
  28. package/esm/constant/waterfall.js +1 -1
  29. package/esm/constant/word-cloud.js +1 -1
  30. package/esm/core/index.d.ts +1 -1
  31. package/esm/core/index.js +1 -1
  32. package/esm/core/index.js.map +1 -1
  33. package/esm/core/interface.js +1 -2
  34. package/esm/core/vchart.js +2 -1
  35. package/esm/event/event-dispatcher.js +1 -1
  36. package/esm/event/event.js +1 -1
  37. package/esm/event/index.js +1 -1
  38. package/esm/event/interface.js +1 -1
  39. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  40. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +4 -3
  41. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  42. package/package.json +4 -4
@@ -166,4 +166,5 @@ const registerVGrammarPolygonAnimation = () => {
166
166
  vgrammar_core_1.View.useRegisters([ vgrammar_core_1.registerGrowPointsInAnimation, vgrammar_core_1.registerGrowPointsOutAnimation ]);
167
167
  };
168
168
 
169
- exports.registerVGrammarPolygonAnimation = registerVGrammarPolygonAnimation;
169
+ exports.registerVGrammarPolygonAnimation = registerVGrammarPolygonAnimation;
170
+ //# sourceMappingURL=config.js.map
@@ -130,5 +130,4 @@ exports.AnimationStates = [ ...Object.keys(config_1.DEFAULT_ANIMATION_CONFIG), "
130
130
  exports.animationConfig = animationConfig, exports.userAnimationConfig = userAnimationConfig,
131
131
  exports.shouldMarkDoMorph = shouldMarkDoMorph, exports.isTimeLineAnimation = isTimeLineAnimation,
132
132
  exports.isChannelAnimation = isChannelAnimation, exports.uniformAnimationConfig = uniformAnimationConfig,
133
- exports.isAnimationEnabledForSeries = isAnimationEnabledForSeries;
134
- //# sourceMappingURL=utils.js.map
133
+ exports.isAnimationEnabledForSeries = isAnimationEnabledForSeries;
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.SCROLL_BAR_DEFAULT_SIZE = void 0, exports.SCROLL_BAR_DEFAULT_SIZE = 12;
6
- //# sourceMappingURL=scroll-bar.js.map
6
+ //# sourceMappingURL=scroll-bar.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.SUNBURST_AUTO_VISIBLE_DEFAULT_THRESHOLD = void 0, exports.SUNBURST_AUTO_VISIBLE_DEFAULT_THRESHOLD = 10;
6
- //# sourceMappingURL=sunburst.js.map
6
+ //# sourceMappingURL=sunburst.js.map
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const base_1 = require("./base");
8
8
 
9
9
  exports.WaterfallDefaultSeriesField = `${base_1.PREFIX}_waterfall_default_seriesField`;
10
- //# sourceMappingURL=waterfall.js.map
10
+ //# sourceMappingURL=waterfall.js.map
@@ -10,4 +10,4 @@ exports.WORD_CLOUD_ANGLE = `${base_1.PREFIX}_WORD_CLOUD_ANGLE`, exports.WORD_CLO
10
10
  exports.WORD_CLOUD_WEIGHT = `${base_1.PREFIX}_WORD_CLOUD_WEIGHT`, exports.WORDCLOUD_COLOR = `${base_1.PREFIX}_WORDCLOUD_COLOR`,
11
11
  exports.WORDCLOUD_DATA_TOTAL = `${base_1.PREFIX}_WORDCLOUD_DATA_TOTAL`, exports.WORD_CLOUD_TEXT = `${base_1.PREFIX}_WORD_CLOUD_TEXT`,
12
12
  exports.WORDCLOUD_SHAPE_DATA_TOTAL = `${base_1.PREFIX}_WORDCLOUD_SHAPE_DATA_TOTAL`;
13
- //# sourceMappingURL=word-cloud.js.map
13
+ //# sourceMappingURL=word-cloud.js.map
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "1.13.14";
4
+ export declare const version = "1.13.15";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export type { IRegion } from '../region/interface';
package/cjs/core/index.js CHANGED
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "Factory", {
35
35
  get: function() {
36
36
  return factory_1.Factory;
37
37
  }
38
- }), exports.version = "1.13.14", __exportStar(require("../typings/spec/common"), exports),
38
+ }), exports.version = "1.13.15", __exportStar(require("../typings/spec/common"), exports),
39
39
  __exportStar(require("../event/interface"), exports), __exportStar(require("../theme/interface"), exports),
40
40
  __exportStar(require("./interface"), exports), __exportStar(require("../constant/base"), exports),
41
41
  __exportStar(require("../constant/data"), exports), __exportStar(require("../typings/spec/index"), exports),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,SAAS,CAAC;AAOjC,yDAAuC;AACvC,qDAAmC;AACnC,qDAAmC;AACnC,8CAA4B;AAG5B,mDAAiC;AACjC,mDAAiC;AAKjC,wDAAsC;AAGtC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAYgC;AAX9B,uGAAA,OAAO,OAAA;AACP,2GAAA,WAAW,OAAA;AACX,8GAAA,cAAc,OAAA;AACd,0GAAA,UAAU,OAAA;AACV,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,4GAAA,YAAY,OAAA;AACZ,4GAAA,YAAY,OAAA;AACZ,2GAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.13.14\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from './interface';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol,\n ManualTicker,\n StreamLight\n} from '@visactor/vrender-core';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,SAAS,CAAC;AAOjC,yDAAuC;AACvC,qDAAmC;AACnC,qDAAmC;AACnC,8CAA4B;AAG5B,mDAAiC;AACjC,mDAAiC;AAKjC,wDAAsC;AAGtC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAYgC;AAX9B,uGAAA,OAAO,OAAA;AACP,2GAAA,WAAW,OAAA;AACX,8GAAA,cAAc,OAAA;AACd,0GAAA,UAAU,OAAA;AACV,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,0GAAA,UAAU,OAAA;AACV,4GAAA,YAAY,OAAA;AACZ,4GAAA,YAAY,OAAA;AACZ,2GAAA,WAAW,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.13.15\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from './interface';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol,\n ManualTicker,\n StreamLight\n} from '@visactor/vrender-core';\n"]}
@@ -2,5 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- });
6
- //# sourceMappingURL=interface.js.map
5
+ });
@@ -917,4 +917,5 @@ const registerVChartCore = () => {
917
917
  (0, builtin_1.registerTheme)(builtin_1.darkTheme.name, builtin_1.darkTheme), vutils_1.Logger.getInstance(vutils_1.LoggerLevel.Error);
918
918
  };
919
919
 
920
- exports.registerVChartCore = registerVChartCore, (0, exports.registerVChartCore)();
920
+ exports.registerVChartCore = registerVChartCore, (0, exports.registerVChartCore)();
921
+ //# sourceMappingURL=vchart.js.map
@@ -230,4 +230,4 @@ class EventDispatcher {
230
230
  }
231
231
 
232
232
  exports.EventDispatcher = EventDispatcher;
233
- //# sourceMappingURL=event-dispatcher.js.map
233
+ //# sourceMappingURL=event-dispatcher.js.map
@@ -68,4 +68,4 @@ class Event {
68
68
  }
69
69
 
70
70
  exports.Event = Event;
71
- //# sourceMappingURL=event.js.map
71
+ //# sourceMappingURL=event.js.map
@@ -33,4 +33,4 @@ Object.defineProperty(exports, "getCartesianDimensionInfo", {
33
33
  return util_1.getPolarDimensionInfo;
34
34
  }
35
35
  });
36
- //# sourceMappingURL=index.js.map
36
+ //# sourceMappingURL=index.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=interface.js.map
6
+ //# sourceMappingURL=interface.js.map
@@ -34,7 +34,7 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
34
34
  protected _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
35
35
  protected _initStyle(): void;
36
36
  protected _updateDomStringByCol(actualTooltip?: ITooltipActual): void;
37
- protected _updateDomStyle(sizeKey?: 'width' | 'height'): void;
37
+ protected _updateDomStyle(sizeKey: 'width' | 'height', refreshSize: boolean): void;
38
38
  protected _getParentElement(spec: ITooltipSpec): HTMLElement;
39
39
  isTooltipShown(): boolean;
40
40
  reInit(): void;
@@ -61,7 +61,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
61
61
  _getTooltipBoxSize(actualTooltip, changePositionOnly) {
62
62
  var _a;
63
63
  this._rootDom || this.initRootDom(), changePositionOnly || this._updateDomStringByCol(actualTooltip),
64
- this._updateDomStyle("height");
64
+ this._updateDomStyle("height", changePositionOnly);
65
65
  const rect = null === (_a = this._rootDom) || void 0 === _a ? void 0 : _a.getBoundingClientRect();
66
66
  return {
67
67
  width: null == rect ? void 0 : rect.width,
@@ -154,7 +154,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
154
154
  }));
155
155
  } else contentDom && !hasContent && contentDom.parentNode.removeChild(contentDom);
156
156
  }
157
- _updateDomStyle(sizeKey = "width") {
157
+ _updateDomStyle(sizeKey = "width", refreshSize) {
158
158
  var _a, _b, _c, _d, _e;
159
159
  const rootDom = this._rootDom, contentDom = [ ...rootDom.children ].find((child => child.className.includes(constants_1.TOOLTIP_CONTENT_BOX_CLASS_NAME))), titleDom = [ ...rootDom.children ].find((child => child.className.includes(constants_1.TOOLTIP_TITLE_CLASS_NAME)));
160
160
  if (contentDom) {
@@ -175,6 +175,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
175
175
  for (let i = 0; i < rows.length; i++) {
176
176
  const cols = null !== (_d = rows[i].children) && void 0 !== _d ? _d : [];
177
177
  for (let j = 0; j < cols.length; j++) {
178
+ refreshSize && (cols[j].style[sizeKey] = "initial");
178
179
  const width = cols[j].getBoundingClientRect()[sizeKey];
179
180
  (void 0 === widthByCol[j] || widthByCol[j] < width) && (widthByCol[j] = width);
180
181
  }
@@ -195,7 +196,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
195
196
  }
196
197
  reInit() {
197
198
  super.reInit(), this._initStyle(), this._rootDom && (0, style_1.setStyleToDom)(this._rootDom, this._domStyle.panel),
198
- this.getVisibility() && (this._updateDomStringByCol(this._tooltipActual), this._updateDomStyle("height"));
199
+ this.getVisibility() && (this._updateDomStringByCol(this._tooltipActual), this._updateDomStyle("height", !1));
199
200
  }
200
201
  _updatePosition({x: x, y: y}) {
201
202
  this._rootDom && (this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../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C;SAChC;IACH,CAAC;IAES,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAA0B;QACxD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAEjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;SAClE;IACH,CAAC;;AA1YH,8CA2YC;AA1YiB,sBAAI,GAAG,6BAAkB,CAAC,GAAG,CAAC;AA4YzC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,kCAAuB,EAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","file":"dom-tooltip-handler.js","sourcesContent":["import type { ITooltipActual, ITooltipPositionActual } from '../../../typings/tooltip';\nimport { BaseTooltipHandler } from './base';\nimport { getDomStyle, getTextStyle, setStyleToDom } from './utils/style';\nimport {\n TOOLTIP_CONTAINER_EL_CLASS_NAME,\n DEFAULT_TOOLTIP_Z_INDEX,\n TOOLTIP_PREFIX,\n TOOLTIP_CONTENT_BOX_CLASS_NAME,\n TOOLTIP_TITLE_CLASS_NAME\n} from './constants';\nimport { type Maybe, isValid } from '@visactor/vutils';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { domDocument } from '../../../util/env';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../../component/tooltip';\nimport type { IComponentPluginService } from '../interface';\nimport { registerComponentPlugin } from '../register';\nimport type { ILayoutPoint } from '../../../typings';\nimport { TooltipHandlerType } from '../../../component/tooltip/constant';\nimport { getSvgHtml } from './utils/svg';\nimport { formatContent } from './utils/common';\nimport { token } from '../../../theme/token';\nimport { calcLayoutNumber } from '../../../util/space';\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.dom;\n readonly type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: {\n panelPadding?: number[];\n panel: Partial<CSSStyleDeclaration>;\n row: Partial<CSSStyleDeclaration>;\n title: Partial<CSSStyleDeclaration>;\n shape: Partial<CSSStyleDeclaration>;\n key: Partial<CSSStyleDeclaration>;\n value: Partial<CSSStyleDeclaration>;\n };\n protected _rootDom?: HTMLElement;\n protected _tooltipActual?: ITooltipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n /** 自定义 tooltip 的位置缓存 */\n protected _cacheCustomTooltipPosition: ILayoutPoint;\n\n getVisibility() {\n return this._rootDom ? this._rootDom.style.visibility === 'visible' : false;\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility() && this._rootDom) {\n this._rootDom.style.visibility = _value ? 'visible' : 'hidden';\n }\n }\n\n getRootDom() {\n return this._rootDom;\n }\n\n constructor() {\n super(DomTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement && parentElement.children && parentElement.children.length) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX;\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n }\n }\n\n initRootDom() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const tooltipElement = document.createElement('div');\n const globalTheme = this._chartOption?.getTheme() ?? {};\n\n setStyleToDom(tooltipElement, {\n left: '0',\n top: '0',\n pointerEvents: 'none',\n padding: '12px',\n position: 'absolute',\n zIndex: DEFAULT_TOOLTIP_Z_INDEX,\n fontFamily: (globalTheme?.fontFamily ?? token.fontFamily) as string,\n fontSize: '11px',\n borderRadius: '3px',\n borderStyle: 'solid',\n lineHeight: 'initial',\n background: '#fff',\n boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.1)',\n maxWidth: '100wh',\n maxHeight: '100vh',\n visibility: 'hidden',\n ...this._domStyle.panel\n } as CSSStyleDeclaration);\n tooltipElement.classList.add(tooltipSpec.className);\n tooltipElement.setAttribute('vchart-tooltip-id', `${this.id}`);\n this._container.appendChild(tooltipElement);\n this._rootDom = tooltipElement;\n }\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!this._rootDom) {\n this.initRootDom();\n }\n if (!changePositionOnly) {\n this._updateDomStringByCol(actualTooltip);\n }\n\n this._updateDomStyle('height');\n\n const rect = this._rootDom?.getBoundingClientRect();\n\n return {\n width: rect?.width,\n height: rect?.height\n };\n }\n\n protected _removeTooltip() {\n if (this._rootDom && this._rootDom.parentNode) {\n this._rootDom.parentNode.removeChild(this._rootDom);\n this._rootDom = null;\n }\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n if (!visible || !this._rootDom) {\n this.setVisibility(visible);\n this._cacheCustomTooltipPosition = undefined;\n } else {\n const { tooltipSpec, activeTooltipSpec } = params;\n\n if (!params.changePositionOnly) {\n this._tooltipActual = activeTooltipSpec;\n }\n const currentVisible = this.getVisibility();\n\n // 位置\n const el = this._rootDom;\n if (el) {\n const { x = 0, y = 0 } = activeTooltipSpec.position ?? {};\n if (tooltipSpec.updateElement) {\n // 此处先设定一次位置,防止页面暂时出现滚动条(优先设置上次的位置)\n this._updatePosition(this._cacheCustomTooltipPosition ?? { x, y });\n // 更新 tooltip dom\n tooltipSpec.updateElement(el, activeTooltipSpec, params);\n // 重新计算 tooltip 位置\n const position = this._getActualTooltipPosition(activeTooltipSpec, params, {\n width: el.offsetWidth,\n height: el.offsetHeight\n });\n // 更新位置\n this._updatePosition(position);\n // 更新缓存\n this._cacheCustomTooltipPosition = position;\n } else {\n if (!currentVisible) {\n // 当从隐藏切换到显示的时候,需要先设置一次 transition 为 0ms,防止出现从一个非常远的初始位置进行动画\n this._rootDom.style.transitionDuration = '0ms';\n } else {\n this._rootDom.style.transitionDuration = this._domStyle.panel.transitionDuration ?? 'initial';\n }\n this._updatePosition({ x, y });\n }\n }\n this.setVisibility(visible);\n }\n }\n\n protected _initStyle() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n\n this._domStyle = getDomStyle(tooltipSpec);\n }\n\n protected _updateDomStringByCol(actualTooltip?: ITooltipActual) {\n const { title = {}, content } = actualTooltip;\n const hasContent = content && content.length;\n const rowStyle = this._domStyle.row;\n const chilren = [...(this._rootDom.children as any)] as HTMLElement[];\n let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));\n\n if (!titleDom && title.visible !== false) {\n titleDom = document.createElement('h2');\n const span = document.createElement('span');\n titleDom.appendChild(span);\n\n titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);\n\n // 将 titleDom 插入到 this._rootDom 中作为第一个节点\n if (this._rootDom.firstChild) {\n this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);\n } else {\n this._rootDom.appendChild(titleDom);\n }\n }\n\n if (titleDom && title.visible !== false) {\n setStyleToDom(titleDom, {\n ...this._domStyle.title,\n ...(hasContent ? rowStyle : { marginBottom: '0px' }),\n marginTop: '0px'\n });\n (titleDom.firstChild as HTMLElement).innerHTML = `${title.value ?? ''}`;\n } else if (titleDom && title.visible === false) {\n titleDom.parentNode.removeChild(titleDom);\n }\n\n const columns = ['shape', 'key', 'value'];\n\n if (!contentDom && hasContent) {\n contentDom = document.createElement('div');\n\n columns.forEach(col => {\n const colDiv = document.createElement('div');\n\n colDiv.classList.add(`${TOOLTIP_PREFIX}-column`);\n colDiv.classList.add(`${TOOLTIP_PREFIX}-${col}-column`);\n colDiv.setAttribute('data-col', col);\n contentDom.appendChild(colDiv);\n });\n\n contentDom.classList.add(TOOLTIP_CONTENT_BOX_CLASS_NAME);\n this._rootDom.appendChild(contentDom);\n }\n\n if (contentDom && hasContent) {\n const columnDivs = [...(contentDom.children as any)] as HTMLElement[];\n setStyleToDom(contentDom, { whiteSpace: 'nowrap' });\n\n columnDivs.forEach((colDiv, index) => {\n const colName = colDiv.getAttribute('data-col');\n\n if (colName && columns.includes(colName)) {\n const hideColumn = colName === 'shape' && content.every(c => !c.hasShape || !c.shapeType);\n\n setStyleToDom(colDiv, {\n ...(this._domStyle as any)[colName],\n display: hideColumn ? 'none' : 'inline-block',\n verticalAlign: 'top'\n });\n const rows = [...(colDiv.children as any)] as HTMLElement[];\n\n // 删除多余的行\n rows.slice(content.length).forEach(extraRow => {\n extraRow.parentNode.removeChild(extraRow);\n });\n\n content.forEach((entry, index) => {\n let row = rows[index];\n\n if (!row) {\n row = document.createElement('div');\n row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);\n colDiv.appendChild(row);\n }\n const styleByRow = {\n ...rowStyle\n };\n\n if (index === content.length - 1) {\n styleByRow.marginBottom = '0px';\n }\n\n styleByRow.display = entry.visible === false ? 'none' : 'block';\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n styleByRow.height = 'initial';\n\n if (colName === 'key') {\n row.innerHTML = formatContent(entry.key);\n if (entry.keyStyle) {\n getTextStyle(entry.keyStyle, styleByRow);\n }\n } else if (colName === 'value') {\n row.innerHTML = formatContent(entry.value);\n if (entry.valueStyle) {\n getTextStyle(entry.valueStyle, styleByRow);\n }\n } else if (colName === 'shape') {\n row.innerHTML = getSvgHtml(entry, `${this.id}_${index}`);\n }\n\n setStyleToDom(row, styleByRow);\n });\n }\n });\n } else if (contentDom && !hasContent) {\n contentDom.parentNode.removeChild(contentDom);\n }\n }\n protected _updateDomStyle(sizeKey: 'width' | 'height' = 'width') {\n const rootDom = this._rootDom;\n const contentDom = [...(rootDom.children as any)].find(child =>\n child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME)\n );\n const titleDom = [...(rootDom.children as any)].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n\n if (contentDom) {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const contentStyle: Partial<CSSStyleDeclaration> = {};\n const titleLabel = tooltipSpec.style?.titleLabel;\n const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;\n\n if (autoFixTitleWidth && titleDom) {\n const maxWidth = [...(contentDom.children as any)].reduce((res, col) => {\n return sizeKey === 'height'\n ? res + col.getBoundingClientRect().width\n : Math.max(res, col.getBoundingClientRect().width);\n }, 0);\n\n if (maxWidth > 0) {\n titleDom.style.maxWidth = `${maxWidth}px`;\n // 需要再计算一次,因为之前可能因为没有设置maxWidth, content的dom被撑宽了\n titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;\n }\n }\n\n if (isValid(tooltipSpec?.style?.maxContentHeight)) {\n const titleHeight =\n titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)\n ? titleDom.getBoundingClientRect().height + (tooltipSpec.style.spaceRow ?? 0)\n : 0;\n const viewRect = (this._chartOption as any).getChartViewRect();\n const maxHeight = calcLayoutNumber(\n tooltipSpec.style.maxContentHeight,\n Math.min(viewRect.height, document.body.clientHeight) -\n titleHeight -\n (this._domStyle.panelPadding ? this._domStyle.panelPadding[0] + this._domStyle.panelPadding[1] : 0)\n );\n\n if (maxHeight > 0) {\n contentStyle.maxHeight = `${maxHeight}px`;\n contentStyle.overflowY = 'auto';\n // todo 让内容宽度往外阔一点,给滚动条留出位置\n contentStyle.width = `calc(100% + ${\n this._domStyle.panelPadding ? this._domStyle.panelPadding[1] + 'px' : '10px'\n })`;\n\n setStyleToDom(contentDom as HTMLElement, contentStyle);\n }\n }\n\n const rows = contentDom.children;\n const widthByCol: number[] = [];\n if (rows) {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n const width = cols[j].getBoundingClientRect()[sizeKey];\n if (widthByCol[j] === undefined || widthByCol[j] < width) {\n widthByCol[j] = width;\n }\n }\n }\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n (cols[j] as HTMLElement).style[sizeKey] = `${widthByCol[j]}px`;\n }\n }\n }\n }\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n if (this._rootDom) {\n setStyleToDom(this._rootDom, this._domStyle.panel);\n }\n\n if (this.getVisibility()) {\n this._updateDomStringByCol(this._tooltipActual);\n this._updateDomStyle('height');\n }\n }\n\n protected _updatePosition({ x, y }: ITooltipPositionActual) {\n if (this._rootDom) {\n // translate3d 性能较好:https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n }\n }\n}\n\nexport const registerDomTooltipHandler = () => {\n registerComponentPlugin(DomTooltipHandler);\n};\n"]}
1
+ {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom-tooltip-handler.ts"],"names":[],"mappings":";;;AACA,iCAA4C;AAC5C,yCAAyE;AACzE,2CAMqB;AACrB,6CAAuD;AAEvD,2CAAgD;AAGhD,0CAAsD;AAEtD,kEAAyE;AACzE,qCAAyC;AACzC,2CAA+C;AAC/C,gDAA6C;AAC7C,+CAAuD;AAIvD,MAAa,iBAAkB,SAAQ,yBAAkB;IAqBvD,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU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AAC;;AA/YH,8CAgZC;AA/YiB,sBAAI,GAAG,6BAAkB,CAAC,GAAG,CAAC;AAiZzC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,kCAAuB,EAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","file":"dom-tooltip-handler.js","sourcesContent":["import type { ITooltipActual, ITooltipPositionActual } from '../../../typings/tooltip';\nimport { BaseTooltipHandler } from './base';\nimport { getDomStyle, getTextStyle, setStyleToDom } from './utils/style';\nimport {\n TOOLTIP_CONTAINER_EL_CLASS_NAME,\n DEFAULT_TOOLTIP_Z_INDEX,\n TOOLTIP_PREFIX,\n TOOLTIP_CONTENT_BOX_CLASS_NAME,\n TOOLTIP_TITLE_CLASS_NAME\n} from './constants';\nimport { type Maybe, isValid } from '@visactor/vutils';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { domDocument } from '../../../util/env';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../../component/tooltip';\nimport type { IComponentPluginService } from '../interface';\nimport { registerComponentPlugin } from '../register';\nimport type { ILayoutPoint } from '../../../typings';\nimport { TooltipHandlerType } from '../../../component/tooltip/constant';\nimport { getSvgHtml } from './utils/svg';\nimport { formatContent } from './utils/common';\nimport { token } from '../../../theme/token';\nimport { calcLayoutNumber } from '../../../util/space';\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.dom;\n readonly type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: {\n panelPadding?: number[];\n panel: Partial<CSSStyleDeclaration>;\n row: Partial<CSSStyleDeclaration>;\n title: Partial<CSSStyleDeclaration>;\n shape: Partial<CSSStyleDeclaration>;\n key: Partial<CSSStyleDeclaration>;\n value: Partial<CSSStyleDeclaration>;\n };\n protected _rootDom?: HTMLElement;\n protected _tooltipActual?: ITooltipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n /** 自定义 tooltip 的位置缓存 */\n protected _cacheCustomTooltipPosition: ILayoutPoint;\n\n getVisibility() {\n return this._rootDom ? this._rootDom.style.visibility === 'visible' : false;\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility() && this._rootDom) {\n this._rootDom.style.visibility = _value ? 'visible' : 'hidden';\n }\n }\n\n getRootDom() {\n return this._rootDom;\n }\n\n constructor() {\n super(DomTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement && parentElement.children && parentElement.children.length) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX;\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n }\n }\n\n initRootDom() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const tooltipElement = document.createElement('div');\n const globalTheme = this._chartOption?.getTheme() ?? {};\n\n setStyleToDom(tooltipElement, {\n left: '0',\n top: '0',\n pointerEvents: 'none',\n padding: '12px',\n position: 'absolute',\n zIndex: DEFAULT_TOOLTIP_Z_INDEX,\n fontFamily: (globalTheme?.fontFamily ?? token.fontFamily) as string,\n fontSize: '11px',\n borderRadius: '3px',\n borderStyle: 'solid',\n lineHeight: 'initial',\n background: '#fff',\n boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.1)',\n maxWidth: '100wh',\n maxHeight: '100vh',\n visibility: 'hidden',\n ...this._domStyle.panel\n } as CSSStyleDeclaration);\n tooltipElement.classList.add(tooltipSpec.className);\n tooltipElement.setAttribute('vchart-tooltip-id', `${this.id}`);\n this._container.appendChild(tooltipElement);\n this._rootDom = tooltipElement;\n }\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!this._rootDom) {\n this.initRootDom();\n }\n if (!changePositionOnly) {\n this._updateDomStringByCol(actualTooltip);\n }\n\n this._updateDomStyle('height', changePositionOnly);\n\n const rect = this._rootDom?.getBoundingClientRect();\n\n return {\n width: rect?.width,\n height: rect?.height\n };\n }\n\n protected _removeTooltip() {\n if (this._rootDom && this._rootDom.parentNode) {\n this._rootDom.parentNode.removeChild(this._rootDom);\n this._rootDom = null;\n }\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n if (!visible || !this._rootDom) {\n this.setVisibility(visible);\n this._cacheCustomTooltipPosition = undefined;\n } else {\n const { tooltipSpec, activeTooltipSpec } = params;\n\n if (!params.changePositionOnly) {\n this._tooltipActual = activeTooltipSpec;\n }\n const currentVisible = this.getVisibility();\n\n // 位置\n const el = this._rootDom;\n if (el) {\n const { x = 0, y = 0 } = activeTooltipSpec.position ?? {};\n if (tooltipSpec.updateElement) {\n // 此处先设定一次位置,防止页面暂时出现滚动条(优先设置上次的位置)\n this._updatePosition(this._cacheCustomTooltipPosition ?? { x, y });\n // 更新 tooltip dom\n tooltipSpec.updateElement(el, activeTooltipSpec, params);\n // 重新计算 tooltip 位置\n const position = this._getActualTooltipPosition(activeTooltipSpec, params, {\n width: el.offsetWidth,\n height: el.offsetHeight\n });\n // 更新位置\n this._updatePosition(position);\n // 更新缓存\n this._cacheCustomTooltipPosition = position;\n } else {\n if (!currentVisible) {\n // 当从隐藏切换到显示的时候,需要先设置一次 transition 为 0ms,防止出现从一个非常远的初始位置进行动画\n this._rootDom.style.transitionDuration = '0ms';\n } else {\n this._rootDom.style.transitionDuration = this._domStyle.panel.transitionDuration ?? 'initial';\n }\n this._updatePosition({ x, y });\n }\n }\n this.setVisibility(visible);\n }\n }\n\n protected _initStyle() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n\n this._domStyle = getDomStyle(tooltipSpec);\n }\n\n protected _updateDomStringByCol(actualTooltip?: ITooltipActual) {\n const { title = {}, content } = actualTooltip;\n const hasContent = content && content.length;\n const rowStyle = this._domStyle.row;\n const chilren = [...(this._rootDom.children as any)] as HTMLElement[];\n let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));\n\n if (!titleDom && title.visible !== false) {\n titleDom = document.createElement('h2');\n const span = document.createElement('span');\n titleDom.appendChild(span);\n\n titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);\n\n // 将 titleDom 插入到 this._rootDom 中作为第一个节点\n if (this._rootDom.firstChild) {\n this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);\n } else {\n this._rootDom.appendChild(titleDom);\n }\n }\n\n if (titleDom && title.visible !== false) {\n setStyleToDom(titleDom, {\n ...this._domStyle.title,\n ...(hasContent ? rowStyle : { marginBottom: '0px' }),\n marginTop: '0px'\n });\n (titleDom.firstChild as HTMLElement).innerHTML = `${title.value ?? ''}`;\n } else if (titleDom && title.visible === false) {\n titleDom.parentNode.removeChild(titleDom);\n }\n\n const columns = ['shape', 'key', 'value'];\n\n if (!contentDom && hasContent) {\n contentDom = document.createElement('div');\n\n columns.forEach(col => {\n const colDiv = document.createElement('div');\n\n colDiv.classList.add(`${TOOLTIP_PREFIX}-column`);\n colDiv.classList.add(`${TOOLTIP_PREFIX}-${col}-column`);\n colDiv.setAttribute('data-col', col);\n contentDom.appendChild(colDiv);\n });\n\n contentDom.classList.add(TOOLTIP_CONTENT_BOX_CLASS_NAME);\n this._rootDom.appendChild(contentDom);\n }\n\n if (contentDom && hasContent) {\n const columnDivs = [...(contentDom.children as any)] as HTMLElement[];\n setStyleToDom(contentDom, { whiteSpace: 'nowrap' });\n\n columnDivs.forEach((colDiv, index) => {\n const colName = colDiv.getAttribute('data-col');\n\n if (colName && columns.includes(colName)) {\n const hideColumn = colName === 'shape' && content.every(c => !c.hasShape || !c.shapeType);\n\n setStyleToDom(colDiv, {\n ...(this._domStyle as any)[colName],\n display: hideColumn ? 'none' : 'inline-block',\n verticalAlign: 'top'\n });\n const rows = [...(colDiv.children as any)] as HTMLElement[];\n\n // 删除多余的行\n rows.slice(content.length).forEach(extraRow => {\n extraRow.parentNode.removeChild(extraRow);\n });\n\n content.forEach((entry, index) => {\n let row = rows[index];\n\n if (!row) {\n row = document.createElement('div');\n row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);\n colDiv.appendChild(row);\n }\n const styleByRow = {\n ...rowStyle\n };\n\n if (index === content.length - 1) {\n styleByRow.marginBottom = '0px';\n }\n\n styleByRow.display = entry.visible === false ? 'none' : 'block';\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n styleByRow.height = 'initial';\n\n if (colName === 'key') {\n row.innerHTML = formatContent(entry.key);\n if (entry.keyStyle) {\n getTextStyle(entry.keyStyle, styleByRow);\n }\n } else if (colName === 'value') {\n row.innerHTML = formatContent(entry.value);\n if (entry.valueStyle) {\n getTextStyle(entry.valueStyle, styleByRow);\n }\n } else if (colName === 'shape') {\n row.innerHTML = getSvgHtml(entry, `${this.id}_${index}`);\n }\n\n setStyleToDom(row, styleByRow);\n });\n }\n });\n } else if (contentDom && !hasContent) {\n contentDom.parentNode.removeChild(contentDom);\n }\n }\n protected _updateDomStyle(sizeKey: 'width' | 'height' = 'width', refreshSize: boolean) {\n const rootDom = this._rootDom;\n const contentDom = [...(rootDom.children as any)].find(child =>\n child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME)\n );\n const titleDom = [...(rootDom.children as any)].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n\n if (contentDom) {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const contentStyle: Partial<CSSStyleDeclaration> = {};\n const titleLabel = tooltipSpec.style?.titleLabel;\n const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;\n\n if (autoFixTitleWidth && titleDom) {\n const maxWidth = [...(contentDom.children as any)].reduce((res, col) => {\n return sizeKey === 'height'\n ? res + col.getBoundingClientRect().width\n : Math.max(res, col.getBoundingClientRect().width);\n }, 0);\n\n if (maxWidth > 0) {\n titleDom.style.maxWidth = `${maxWidth}px`;\n // 需要再计算一次,因为之前可能因为没有设置maxWidth, content的dom被撑宽了\n titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;\n }\n }\n\n if (isValid(tooltipSpec?.style?.maxContentHeight)) {\n const titleHeight =\n titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)\n ? titleDom.getBoundingClientRect().height + (tooltipSpec.style.spaceRow ?? 0)\n : 0;\n const viewRect = (this._chartOption as any).getChartViewRect();\n const maxHeight = calcLayoutNumber(\n tooltipSpec.style.maxContentHeight,\n Math.min(viewRect.height, document.body.clientHeight) -\n titleHeight -\n (this._domStyle.panelPadding ? this._domStyle.panelPadding[0] + this._domStyle.panelPadding[1] : 0)\n );\n\n if (maxHeight > 0) {\n contentStyle.maxHeight = `${maxHeight}px`;\n contentStyle.overflowY = 'auto';\n // todo 让内容宽度往外阔一点,给滚动条留出位置\n contentStyle.width = `calc(100% + ${\n this._domStyle.panelPadding ? this._domStyle.panelPadding[1] + 'px' : '10px'\n })`;\n\n setStyleToDom(contentDom as HTMLElement, contentStyle);\n }\n }\n\n const rows = contentDom.children;\n const widthByCol: number[] = [];\n if (rows) {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n if (refreshSize) {\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n cols[j].style[sizeKey] = 'initial';\n }\n\n const width = cols[j].getBoundingClientRect()[sizeKey];\n if (widthByCol[j] === undefined || widthByCol[j] < width) {\n widthByCol[j] = width;\n }\n }\n }\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n (cols[j] as HTMLElement).style[sizeKey] = `${widthByCol[j]}px`;\n }\n }\n }\n }\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n if (this._rootDom) {\n setStyleToDom(this._rootDom, this._domStyle.panel);\n }\n\n if (this.getVisibility()) {\n this._updateDomStringByCol(this._tooltipActual);\n this._updateDomStyle('height', false);\n }\n }\n\n protected _updatePosition({ x, y }: ITooltipPositionActual) {\n if (this._rootDom) {\n // translate3d 性能较好:https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n }\n }\n}\n\nexport const registerDomTooltipHandler = () => {\n registerComponentPlugin(DomTooltipHandler);\n};\n"]}
@@ -152,4 +152,5 @@ export const registerVGrammarLineOrAreaAnimation = () => {
152
152
 
153
153
  export const registerVGrammarPolygonAnimation = () => {
154
154
  View.useRegisters([ registerGrowPointsInAnimation, registerGrowPointsOutAnimation ]);
155
- };
155
+ };
156
+ //# sourceMappingURL=config.js.map
@@ -124,5 +124,4 @@ export function isAnimationEnabledForSeries(series) {
124
124
  config && (config.large && config.largeThreshold && (animationThreshold = Math.min(animationThreshold, config.largeThreshold)),
125
125
  config.progressiveThreshold && (animationThreshold = Math.min(animationThreshold, config.progressiveThreshold)));
126
126
  })), !((null === (_d = null === (_c = series.getRawData()) || void 0 === _c ? void 0 : _c.latestData) || void 0 === _d ? void 0 : _d.length) >= animationThreshold);
127
- }
128
- //# sourceMappingURL=utils.js.map
127
+ }
@@ -1,2 +1,2 @@
1
1
  export const SCROLL_BAR_DEFAULT_SIZE = 12;
2
- //# sourceMappingURL=scroll-bar.js.map
2
+ //# sourceMappingURL=scroll-bar.js.map
@@ -1,2 +1,2 @@
1
1
  export const SUNBURST_AUTO_VISIBLE_DEFAULT_THRESHOLD = 10;
2
- //# sourceMappingURL=sunburst.js.map
2
+ //# sourceMappingURL=sunburst.js.map
@@ -1,4 +1,4 @@
1
1
  import { PREFIX } from "./base";
2
2
 
3
3
  export const WaterfallDefaultSeriesField = `${PREFIX}_waterfall_default_seriesField`;
4
- //# sourceMappingURL=waterfall.js.map
4
+ //# sourceMappingURL=waterfall.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
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "1.13.14";
4
+ export declare const version = "1.13.15";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export type { IRegion } from '../region/interface';
package/esm/core/index.js CHANGED
@@ -4,7 +4,7 @@ import { Factory } from "./factory";
4
4
 
5
5
  export { VChart, Factory };
6
6
 
7
- export const version = "1.13.14";
7
+ export const version = "1.13.15";
8
8
 
9
9
  export * from "../typings/spec/common";
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAOjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAG5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAKjC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACZ,MAAM,wBAAwB,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.13.14\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from './interface';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol,\n ManualTicker,\n StreamLight\n} from '@visactor/vrender-core';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAG3B,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAOjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAG5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAKjC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACZ,MAAM,wBAAwB,CAAC","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.13.15\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\nexport type { IRegion } from '../region/interface';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from './interface';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport {\n vglobal,\n createGroup,\n createRichText,\n createText,\n createArc,\n createArea,\n createRect,\n createLine,\n createSymbol,\n ManualTicker,\n StreamLight\n} from '@visactor/vrender-core';\n"]}
@@ -1,2 +1 @@
1
- export { };
2
- //# sourceMappingURL=interface.js.map
1
+ export { };
@@ -976,4 +976,5 @@ export const registerVChartCore = () => {
976
976
 
977
977
  Factory.registerRegion("region", Region), Factory.registerLayout("base", Layout),
978
978
  registerGroupMark(), View.useRegisters([ registerGesturePlugin ]), registerHoverInteraction(),
979
- registerSelectInteraction(), registerTheme(darkTheme.name, darkTheme), Logger.getInstance(LoggerLevel.Error);
979
+ registerSelectInteraction(), registerTheme(darkTheme.name, darkTheme), Logger.getInstance(LoggerLevel.Error);
980
+ //# sourceMappingURL=vchart.js.map
@@ -226,4 +226,4 @@ export class EventDispatcher {
226
226
  return eType && (interactionType = eType.split(":")[0], interactionType) && VGrammarFactory.hasInteraction(interactionType);
227
227
  }
228
228
  }
229
- //# sourceMappingURL=event-dispatcher.js.map
229
+ //# sourceMappingURL=event-dispatcher.js.map
@@ -60,4 +60,4 @@ export class Event {
60
60
  this._eventDispatcher.clear(), this._composedEventMap.clear();
61
61
  }
62
62
  }
63
- //# sourceMappingURL=event.js.map
63
+ //# sourceMappingURL=event.js.map
@@ -3,4 +3,4 @@ export * from "./event";
3
3
  export * from "./events";
4
4
 
5
5
  export { getCartesianDimensionInfo, getPolarDimensionInfo } from "./events/dimension/util";
6
- //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=interface.js.map
2
+ //# sourceMappingURL=interface.js.map
@@ -34,7 +34,7 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
34
34
  protected _updateTooltip(visible: boolean, params: TooltipHandlerParams): void;
35
35
  protected _initStyle(): void;
36
36
  protected _updateDomStringByCol(actualTooltip?: ITooltipActual): void;
37
- protected _updateDomStyle(sizeKey?: 'width' | 'height'): void;
37
+ protected _updateDomStyle(sizeKey: 'width' | 'height', refreshSize: boolean): void;
38
38
  protected _getParentElement(spec: ITooltipSpec): HTMLElement;
39
39
  isTooltipShown(): boolean;
40
40
  reInit(): void;
@@ -75,7 +75,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {
75
75
  _getTooltipBoxSize(actualTooltip, changePositionOnly) {
76
76
  var _a;
77
77
  this._rootDom || this.initRootDom(), changePositionOnly || this._updateDomStringByCol(actualTooltip),
78
- this._updateDomStyle("height");
78
+ this._updateDomStyle("height", changePositionOnly);
79
79
  const rect = null === (_a = this._rootDom) || void 0 === _a ? void 0 : _a.getBoundingClientRect();
80
80
  return {
81
81
  width: null == rect ? void 0 : rect.width,
@@ -167,7 +167,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {
167
167
  }));
168
168
  } else contentDom && !hasContent && contentDom.parentNode.removeChild(contentDom);
169
169
  }
170
- _updateDomStyle(sizeKey = "width") {
170
+ _updateDomStyle(sizeKey = "width", refreshSize) {
171
171
  var _a, _b, _c, _d, _e;
172
172
  const rootDom = this._rootDom, contentDom = [ ...rootDom.children ].find((child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME))), titleDom = [ ...rootDom.children ].find((child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME)));
173
173
  if (contentDom) {
@@ -187,6 +187,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {
187
187
  for (let i = 0; i < rows.length; i++) {
188
188
  const cols = null !== (_d = rows[i].children) && void 0 !== _d ? _d : [];
189
189
  for (let j = 0; j < cols.length; j++) {
190
+ refreshSize && (cols[j].style[sizeKey] = "initial");
190
191
  const width = cols[j].getBoundingClientRect()[sizeKey];
191
192
  (void 0 === widthByCol[j] || widthByCol[j] < width) && (widthByCol[j] = width);
192
193
  }
@@ -207,7 +208,7 @@ export class DomTooltipHandler extends BaseTooltipHandler {
207
208
  }
208
209
  reInit() {
209
210
  super.reInit(), this._initStyle(), this._rootDom && setStyleToDom(this._rootDom, this._domStyle.panel),
210
- this.getVisibility() && (this._updateDomStringByCol(this._tooltipActual), this._updateDomStyle("height"));
211
+ this.getVisibility() && (this._updateDomStringByCol(this._tooltipActual), this._updateDomStyle("height", !1));
211
212
  }
212
213
  _updatePosition({x: x, y: y}) {
213
214
  this._rootDom && (this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`);