@visactor/vchart 1.10.2 → 1.10.3

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 (75) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +7178 -7239
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/map/map-transformer.js +2 -1
  6. package/cjs/chart/map/map-transformer.js.map +1 -1
  7. package/cjs/compile/mark/compilable-mark.d.ts +2 -1
  8. package/cjs/compile/mark/compilable-mark.js +4 -0
  9. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  10. package/cjs/compile/mark/interface.d.ts +1 -0
  11. package/cjs/compile/mark/interface.js.map +1 -1
  12. package/cjs/component/axis/polar/axis.js +2 -1
  13. package/cjs/component/axis/polar/axis.js.map +1 -1
  14. package/cjs/component/label/total-label.js +8 -5
  15. package/cjs/component/label/total-label.js.map +1 -1
  16. package/cjs/core/index.d.ts +1 -1
  17. package/cjs/core/index.js +1 -1
  18. package/cjs/core/index.js.map +1 -1
  19. package/cjs/core/vchart.js +1 -1
  20. package/cjs/core/vchart.js.map +1 -1
  21. package/cjs/data/transforms/map.js +4 -2
  22. package/cjs/data/transforms/map.js.map +1 -1
  23. package/cjs/plugin/components/tooltip-handler/base.js +3 -3
  24. package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
  25. package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  26. package/cjs/series/base/base-series.d.ts +1 -0
  27. package/cjs/series/base/base-series.js +3 -0
  28. package/cjs/series/base/base-series.js.map +1 -1
  29. package/cjs/series/interface/series.d.ts +1 -0
  30. package/cjs/series/interface/series.js.map +1 -1
  31. package/cjs/series/map/interface.d.ts +1 -0
  32. package/cjs/series/map/interface.js.map +1 -1
  33. package/cjs/series/map/map.js +8 -2
  34. package/cjs/series/map/map.js.map +1 -1
  35. package/cjs/series/sankey/sankey.d.ts +2 -1
  36. package/cjs/series/sankey/sankey.js +50 -118
  37. package/cjs/series/sankey/sankey.js.map +1 -1
  38. package/cjs/series/word-cloud/base.js +3 -13
  39. package/cjs/series/word-cloud/base.js.map +1 -1
  40. package/esm/chart/map/map-transformer.js +2 -1
  41. package/esm/chart/map/map-transformer.js.map +1 -1
  42. package/esm/compile/mark/compilable-mark.d.ts +2 -1
  43. package/esm/compile/mark/compilable-mark.js +4 -0
  44. package/esm/compile/mark/compilable-mark.js.map +1 -1
  45. package/esm/compile/mark/interface.d.ts +1 -0
  46. package/esm/compile/mark/interface.js.map +1 -1
  47. package/esm/component/axis/polar/axis.js +2 -1
  48. package/esm/component/axis/polar/axis.js.map +1 -1
  49. package/esm/component/label/total-label.js +8 -5
  50. package/esm/component/label/total-label.js.map +1 -1
  51. package/esm/core/index.d.ts +1 -1
  52. package/esm/core/index.js +1 -1
  53. package/esm/core/index.js.map +1 -1
  54. package/esm/core/vchart.js +1 -1
  55. package/esm/core/vchart.js.map +1 -1
  56. package/esm/data/transforms/map.js +4 -2
  57. package/esm/data/transforms/map.js.map +1 -1
  58. package/esm/plugin/components/tooltip-handler/base.js +3 -3
  59. package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
  60. package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
  61. package/esm/series/base/base-series.d.ts +1 -0
  62. package/esm/series/base/base-series.js +3 -0
  63. package/esm/series/base/base-series.js.map +1 -1
  64. package/esm/series/interface/series.d.ts +1 -0
  65. package/esm/series/interface/series.js.map +1 -1
  66. package/esm/series/map/interface.d.ts +1 -0
  67. package/esm/series/map/interface.js.map +1 -1
  68. package/esm/series/map/map.js +8 -2
  69. package/esm/series/map/map.js.map +1 -1
  70. package/esm/series/sankey/sankey.d.ts +2 -1
  71. package/esm/series/sankey/sankey.js +51 -119
  72. package/esm/series/sankey/sankey.js.map +1 -1
  73. package/esm/series/word-cloud/base.js +4 -14
  74. package/esm/series/word-cloud/base.js.map +1 -1
  75. package/package.json +14 -14
@@ -1 +1 @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CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC;QAE1C,OAAO,CACL,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAClD,CAAC;IACJ,CAAC;IAES,iBAAiB,CAAC,IAAkB;QAC5C,OAAO,IAAI,CAAC,aAAoB,CAAC;IACnC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAES,aAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAExC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAQ,CAAC;QAChE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAQ,CAAC;IAClF,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;;AAz0BH,gDA00BC;AAx0BiB,0BAAO,GAAG,SAAS,CAAC","file":"base.js","sourcesContent":["import { DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT } from '../../../constant/base';\nimport type { Options } from './constants';\n// eslint-disable-next-line no-duplicate-imports\nimport { DEFAULT_OPTIONS } from './constants';\nimport type { Maybe, IPoint, ILayoutPoint, RenderMode } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ITooltipPositionFixedValue } from '../../../typings/tooltip/position';\n// eslint-disable-next-line no-duplicate-imports\nimport { isTrueBrowser } from '../../../util/env';\nimport type {\n TooltipData,\n ITooltipActual,\n TooltipActiveType,\n ITooltipHandler,\n ITooltipPattern,\n ITooltipPositionActual,\n IGlobalTooltipPositionPattern\n} from '../../../typings/tooltip';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TooltipFixedPosition } from '../../../typings/tooltip';\nimport type { BaseEventParams } from '../../../event/interface';\nimport { getTooltipPatternValue, getScale } from './utils/common';\nimport {\n getActualTooltipPositionValue,\n getCartesianCrosshairRect,\n getHorizontalPositionType,\n getVerticalPositionType,\n isFixedTooltipPositionPattern,\n isGlobalTooltipPositionPattern\n} from './utils/position';\nimport { getShowContent } from './utils/compose';\nimport { getTooltipSpecForShow } from './utils/get-spec';\nimport type { ICartesianSeries, ISeries } from '../../../series/interface';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { AABBBounds } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n isNumber,\n isObject,\n isValidNumber,\n isValid,\n throttle,\n isNil,\n polygonContainPoint,\n pointInRect,\n isFunction\n} from '@visactor/vutils';\nimport type { IElement } from '@visactor/vgrammar-core';\nimport type { ILayoutModel } from '../../../model/interface';\nimport type { Compiler } from '../../../compile/compiler';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { getTooltipAttributes } from './utils/attribute';\nimport type { DimensionEventParams } from '../../../event/events/dimension/interface';\nimport type { IChartOption } from '../../../chart/interface';\nimport type {\n ITooltipSpec,\n Tooltip,\n TooltipActualTitleContent,\n TooltipHandlerParams\n} from '../../../component/tooltip';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipResult } from '../../../component/tooltip';\nimport type { IComponentPlugin, IComponentPluginService } from '../interface';\nimport { BasePlugin } from '../../base/base-plugin';\nimport type { ITooltipAttributes } from './interface';\nimport { getFirstSeries } from '../../../util';\n\ntype ChangeTooltipFunc = (\n visible: boolean,\n params: TooltipHandlerParams,\n changePositionOnly?: boolean,\n activeType?: TooltipActiveType,\n data?: TooltipData\n) => TooltipResult;\n\ntype ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n data: TooltipData,\n params: TooltipHandlerParams\n) => TooltipResult;\n\n/**\n * The tooltip handler class.\n */\nexport abstract class BaseTooltipHandler extends BasePlugin implements ITooltipHandler, IComponentPlugin {\n static readonly pluginType: 'component';\n static readonly specKey = 'tooltip';\n\n readonly type: string;\n\n /** 是否可见 */\n protected _visible = true;\n\n // protected _style: ITooltipStyle = {};\n\n protected _option: Options;\n\n protected _chartOption: IChartOption;\n\n protected _env: RenderMode;\n public get env() {\n return this._env;\n }\n\n protected _component: Tooltip;\n protected _attributes?: ITooltipAttributes | null = null;\n\n protected _chartContainer: Maybe<HTMLElement>;\n protected _compiler: Compiler;\n\n protected _cacheViewSpec: ITooltipSpec | undefined;\n protected _cacheActualTooltip: ITooltipActual | undefined;\n\n protected _isTooltipPaused: boolean;\n protected _isPointerEscaped: boolean;\n protected _cachePointerTimer: number;\n protected _cachePointerPosition: ILayoutPoint;\n protected _cacheTooltipPosition: ILayoutPoint;\n protected _cacheTooltipSize: IContainerSize;\n\n // tooltip 容器\n protected _container!: Maybe<IGroup | HTMLElement>;\n\n protected _isReleased: boolean = false;\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n const component = service.component as Tooltip;\n this._component = component;\n this._chartOption = component.getOption() as any;\n this._env = this._chartOption.mode;\n this._chartContainer = this._chartOption.globalInstance.getContainer();\n this._compiler = component.getCompiler();\n this._initFromSpec();\n }\n\n showTooltip = (activeType: TooltipActiveType, data: TooltipData, params: TooltipHandlerParams) => {\n let changePositionOnly = !!params.changePositionOnly;\n if (!params.changePositionOnly || this._cacheActualTooltip?.activeType !== activeType) {\n changePositionOnly = false;\n this._clearCacheOfContent();\n }\n\n if (changePositionOnly && this._cacheViewSpec && this._cacheActualTooltip) {\n return this.changeTooltipPosition(changePositionOnly, data, params);\n }\n return this.changeTooltip(true, params, changePositionOnly, activeType, data);\n };\n\n /** 改变 tooltip 内容和位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltip: ChangeTooltipFunc;\n\n /** 改变 tooltip 内容和位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltip: ChangeTooltipFunc = (\n visible: boolean,\n params: TooltipHandlerParams,\n changePositionOnly?: boolean,\n activeType?: TooltipActiveType,\n data?: TooltipData\n ) => {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n if (this._isReleased || !tooltipSpec) {\n return TooltipResult.failed;\n }\n\n /** 关闭 tooltip */\n if (!visible) {\n this._clearAllCache();\n\n /** 用户自定义逻辑 */\n if (tooltipSpec.handler) {\n return tooltipSpec.handler.hideTooltip?.(params) ?? TooltipResult.success;\n }\n /** 默认逻辑 */\n this._updateTooltip(false, params);\n return TooltipResult.success;\n }\n\n if (isNil(activeType) || isNil(data)) {\n return TooltipResult.failed;\n }\n\n /** spec 预处理 */\n let spec: ITooltipSpec | undefined;\n if (changePositionOnly && this._cacheViewSpec) {\n spec = this._cacheViewSpec;\n } else {\n spec = getTooltipSpecForShow(\n activeType!,\n tooltipSpec,\n (params as BaseEventParams).model as ISeries,\n (params as DimensionEventParams).dimensionInfo\n );\n this._cacheViewSpec = spec;\n }\n\n if (spec.visible === false) {\n return TooltipResult.failed;\n }\n\n /** 用户自定义逻辑 */\n if (spec.handler) {\n return spec.handler.showTooltip?.(activeType!, data!, params) ?? TooltipResult.success;\n }\n\n /** 默认逻辑 */\n const pattern = spec[activeType!] as ITooltipPattern;\n if (!pattern) {\n return TooltipResult.failed;\n }\n\n // 合成 tooltip 内容\n let actualTooltip: ITooltipActual | undefined;\n if (changePositionOnly && this._cacheActualTooltip) {\n actualTooltip = this._cacheActualTooltip;\n } else {\n actualTooltip = this._getActualTooltipContent(pattern, data!, params);\n actualTooltip.title = pattern.updateTitle?.(actualTooltip.title, data, params) ?? actualTooltip.title;\n actualTooltip.content = pattern.updateContent?.(actualTooltip.content, data, params) ?? actualTooltip.content;\n }\n\n // 判断 tooltip 是否为空\n if (isNil(actualTooltip.title?.key) && isNil(actualTooltip.title?.value) && !actualTooltip.content?.length) {\n return TooltipResult.failed;\n }\n\n this._cacheActualTooltip = actualTooltip;\n return this._changeTooltipPosition(!!changePositionOnly, data!, params);\n };\n\n /** 改变 tooltip 位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltipPosition: ChangeTooltipPositionFunc;\n\n /** 改变 tooltip 位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltipPosition: ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n data: TooltipData,\n params: TooltipHandlerParams\n ) => {\n if (this._isReleased) {\n return TooltipResult.failed;\n }\n\n const event = params.event as MouseEvent;\n const spec = this._cacheViewSpec;\n const actualTooltip = this._cacheActualTooltip;\n if (!spec || !actualTooltip) {\n return TooltipResult.failed;\n }\n\n if (spec.enterable) {\n if (!this._isPointerEscaped && this._isPointerMovingToTooltip(params)) {\n if (!this._isTooltipPaused) {\n this._isTooltipPaused = true;\n this._cachePointerTimer = setTimeout(() => {\n this._isPointerEscaped = true;\n }, 300) as unknown as number;\n }\n return TooltipResult.success;\n }\n this._isTooltipPaused = false;\n this._isPointerEscaped = false;\n clearTimeout(this._cachePointerTimer);\n this._cachePointerPosition = this._getPointerPositionRelativeToTooltipParent(params);\n }\n\n const activeType = actualTooltip.activeType;\n\n /** 用户自定义逻辑 */\n if (spec.handler) {\n return spec.handler.showTooltip?.(activeType, data, params) ?? TooltipResult.success;\n }\n\n /** 默认逻辑 */\n const pattern = spec[activeType];\n if (!pattern) {\n return TooltipResult.failed;\n }\n\n // 计算 tooltip 位置\n const position = this._getActualTooltipPosition(\n actualTooltip,\n params,\n this._getTooltipBoxSize(actualTooltip, changePositionOnly)\n );\n actualTooltip.position = position;\n if (pattern.updatePosition) {\n actualTooltip.position = pattern.updatePosition(actualTooltip.position, data, params);\n }\n\n // 判断 tooltip 可见性\n let tooltipVisible = pattern?.visible !== false;\n if (\n !data ||\n event.type === 'pointerout' ||\n !actualTooltip.visible ||\n (!actualTooltip.title && !actualTooltip.content)\n ) {\n tooltipVisible = false;\n }\n\n this._updateTooltip(\n tooltipVisible,\n {\n ...params,\n changePositionOnly\n },\n actualTooltip\n );\n return TooltipResult.success;\n };\n\n hideTooltip(params: TooltipHandlerParams): TooltipResult {\n return this.changeTooltip(false, params);\n }\n\n release(): void {\n this._clearAllCache();\n const spec = this._component.getSpec() ?? {};\n /** 用户自定义逻辑 */\n if (spec.handler) {\n spec.handler.release?.();\n return;\n }\n /** 默认逻辑 */\n this._removeTooltip();\n\n this._isReleased = true;\n }\n\n protected _clearAllCache() {\n this._clearCacheOfContent();\n this._clearCacheOfPosition();\n }\n\n protected _clearCacheOfContent() {\n this._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n }\n\n protected _clearCacheOfPosition() {\n this._isTooltipPaused = false;\n this._isPointerEscaped = false;\n clearTimeout(this._cachePointerTimer);\n this._cachePointerTimer = -1;\n this._cachePointerPosition = undefined;\n this._cacheTooltipPosition = undefined;\n this._cacheTooltipSize = undefined;\n }\n\n /* -----需要子类继承的方法开始----- */\n\n protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: ITooltipActual): void;\n protected abstract _removeTooltip(): void;\n\n /* -----需要子类继承的方法结束----- */\n\n protected _throttle(callback: any) {\n const tooltipSpec = this._component.getSpec();\n let wait: number;\n if (isNumber(tooltipSpec.throttleInterval)) {\n wait = tooltipSpec.throttleInterval;\n } else {\n if (tooltipSpec.renderMode !== 'html' || !tooltipSpec.transitionDuration) {\n wait = 10;\n } else {\n wait = 50;\n }\n }\n return throttle(callback, wait);\n }\n\n protected _getDefaultOption(): Options {\n const { offset } = this._component.getSpec();\n return {\n ...DEFAULT_OPTIONS,\n offsetX: offset?.x ?? DEFAULT_OPTIONS.offsetX,\n offsetY: offset?.y ?? DEFAULT_OPTIONS.offsetY\n };\n }\n\n /**\n * 计算实际的 tooltip 内容\n * @param pattern\n * @param data\n * @param event\n */\n protected _getActualTooltipContent = (\n pattern: ITooltipPattern,\n data: TooltipData,\n params: TooltipHandlerParams\n ): ITooltipActual => {\n // 可见性\n const patternVisible = getTooltipPatternValue(pattern.visible, data, params);\n\n // 数据\n let tooltipContent: TooltipActualTitleContent | null = null;\n tooltipContent = getShowContent(pattern, data, params);\n\n const actualTooltip: ITooltipActual = {\n ...tooltipContent,\n visible: isValid(tooltipContent) ? patternVisible !== false : false, // 最终展示数据为 null 则不展示\n activeType: pattern.activeType,\n data\n };\n\n return actualTooltip;\n };\n\n /**\n * 计算实际的 tooltip 位置\n */\n protected _getActualTooltipPosition = (\n actualTooltip: ITooltipActual,\n params: TooltipHandlerParams,\n tooltipBoxSize: IContainerSize | undefined\n ): ITooltipPositionActual => {\n const event = params.event as MouseEvent;\n const firstDimensionInfo = params.dimensionInfo?.[0];\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n let { offsetX, offsetY } = this._option;\n const tooltipSpec = this._cacheViewSpec;\n if (!tooltipSpec) {\n this._cacheTooltipPosition = undefined;\n return invalidPosition;\n }\n\n const { activeType, data } = actualTooltip;\n const pattern = tooltipSpec[activeType];\n const position = getTooltipPatternValue(pattern.position, data, params);\n const positionMode =\n getTooltipPatternValue(pattern.positionMode, data, params) ?? (activeType === 'mark' ? 'mark' : 'pointer');\n const tooltipParentElement = this._getParentElement(tooltipSpec);\n const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = tooltipBoxSize ?? {};\n\n const isCanvas = tooltipSpec.renderMode === 'canvas';\n const canvasRect = params?.chart?.getCanvasRect();\n const canvasWidth = canvasRect?.width ?? DEFAULT_CHART_WIDTH;\n const canvasHeight = canvasRect?.height ?? DEFAULT_CHART_HEIGHT;\n let isFixedPosition = false;\n\n const containerSize = {\n width: 0,\n height: 0\n };\n let relativePosOffset = { x: 0, y: 0 };\n let tooltipParentElementRect: IPoint | DOMRect = { x: 0, y: 0 };\n let chartElementScale = 1;\n let tooltipParentElementScale = 1;\n\n if (isTrueBrowser(this._env) && !tooltipSpec.confine) {\n // 只有在 browser 模式下才可以获取到 window 对象\n containerSize.width = window.innerWidth;\n containerSize.height = window.innerHeight;\n\n if (!isCanvas) {\n tooltipParentElementRect = tooltipParentElement?.getBoundingClientRect() ?? invalidPosition;\n const chartElement = (this._compiler.getCanvas() ?? this._chartContainer) as HTMLElement;\n const chartElementRect = chartElement?.getBoundingClientRect();\n relativePosOffset = {\n x: chartElementRect.x - tooltipParentElementRect.x,\n y: chartElementRect.y - tooltipParentElementRect.y\n };\n chartElementScale = getScale(chartElement, chartElementRect);\n tooltipParentElementScale = getScale(tooltipParentElement, tooltipParentElementRect as DOMRect);\n }\n } else {\n containerSize.width = canvasWidth;\n containerSize.height = canvasHeight;\n }\n const tooltipSizeScale = tooltipParentElementScale / chartElementScale;\n\n /* 一、计算 left、top、right、bottom */\n let left: number | undefined;\n let top: number | undefined;\n let right: number | undefined;\n let bottom: number | undefined;\n\n let pointerFixedPositionX: TooltipFixedPosition = position as any;\n let pointerFixedPositionY: TooltipFixedPosition = position as any;\n\n const processCartesianFixedPositionX = ({ orient, mode, offset }: ITooltipPositionFixedValue) => {\n let x1: number;\n let x2: number;\n const model = params.model as ILayoutModel;\n const startPoint = model?.getLayoutStartPoint();\n offsetX = offset ?? offsetX;\n\n if (mode === 'mark') {\n isFixedPosition = true;\n const element = params.item as IElement;\n const bounds = element?.getBounds() as AABBBounds;\n if (bounds && startPoint) {\n x1 = bounds.x1 + startPoint.x;\n x2 = bounds.x2 + startPoint.x;\n }\n } else if (mode === 'crosshair' && firstDimensionInfo?.axis?.getCoordinateType() === 'cartesian') {\n isFixedPosition = true;\n const rect = getCartesianCrosshairRect(\n params.dimensionInfo,\n getFirstSeries(this._component.getRegions(), 'cartesian') as ICartesianSeries,\n startPoint\n );\n if (rect) {\n x1 = rect.start.x;\n x2 = rect.end.x;\n }\n } else {\n pointerFixedPositionX = orient;\n }\n\n if (isFixedPosition) {\n switch (getHorizontalPositionType(orient)) {\n case 'left':\n left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n left = x2 + offsetX;\n break;\n case 'center':\n left = (x1 + x2) / 2 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'centerLeft':\n left = (x1 + x2) / 2 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'centerRight':\n left = (x1 + x2) / 2 + offsetX;\n break;\n }\n }\n };\n const processCartesianFixedPositionY = ({ orient, mode, offset }: ITooltipPositionFixedValue) => {\n let y1: number;\n let y2: number;\n const model = params.model as ILayoutModel;\n const startPoint = model?.getLayoutStartPoint();\n offsetY = offset ?? offsetY;\n\n if (mode === 'mark') {\n isFixedPosition = true;\n const element = params.item as IElement;\n const bounds = element?.getBounds() as AABBBounds;\n if (bounds && startPoint) {\n y1 = bounds.y1 + startPoint.y;\n y2 = bounds.y2 + startPoint.y;\n }\n } else if (mode === 'crosshair' && firstDimensionInfo?.axis?.getCoordinateType() === 'cartesian') {\n isFixedPosition = true;\n const rect = getCartesianCrosshairRect(\n params.dimensionInfo,\n getFirstSeries(this._component.getRegions(), 'cartesian') as ICartesianSeries,\n startPoint\n );\n if (rect) {\n y1 = rect.start.y;\n y2 = rect.end.y;\n }\n } else {\n pointerFixedPositionY = orient;\n }\n\n if (isFixedPosition) {\n switch (getVerticalPositionType(orient)) {\n case 'top':\n top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n top = y2 + offsetY;\n break;\n case 'center':\n top = (y1 + y2) / 2 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'centerTop':\n top = (y1 + y2) / 2 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'centerBottom':\n top = (y1 + y2) / 2 + offsetY;\n break;\n }\n }\n };\n\n if (isObject(position)) {\n if (isGlobalTooltipPositionPattern(position)) {\n const {\n left: posLeft,\n right: posRight,\n top: posTop,\n bottom: posBottom\n } = position as IGlobalTooltipPositionPattern;\n left = getActualTooltipPositionValue(posLeft, event);\n top = getActualTooltipPositionValue(posTop, event);\n right = getActualTooltipPositionValue(posRight, event);\n bottom = getActualTooltipPositionValue(posBottom, event);\n } else if (isFixedTooltipPositionPattern(position)) {\n const { x, y } = position;\n if (isNumber(x) || isFunction(x)) {\n left = getActualTooltipPositionValue(x, event);\n } else {\n processCartesianFixedPositionX(x);\n }\n if (isNumber(y) || isFunction(y)) {\n top = getActualTooltipPositionValue(y, event);\n } else {\n processCartesianFixedPositionY(y);\n }\n }\n } else if (isValid(position)) {\n processCartesianFixedPositionX({ orient: position, mode: positionMode });\n processCartesianFixedPositionY({ orient: position, mode: positionMode });\n }\n\n /* 二、换算成 x 和 y */\n let x: number;\n let y: number;\n\n const { canvasX, canvasY } = event as any;\n if (isValidNumber(left)) {\n x = left;\n } else if (isValidNumber(right)) {\n x = canvasWidth - tooltipBoxWidth * tooltipSizeScale - right;\n } else {\n const x0 = canvasX;\n switch (getHorizontalPositionType(pointerFixedPositionX, 'right')) {\n case 'center':\n x = x0 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'left':\n case 'centerLeft':\n x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n case 'centerRight':\n x = x0 + offsetX;\n break;\n }\n }\n if (isValidNumber(top)) {\n y = top;\n } else if (isValidNumber(bottom)) {\n y = canvasHeight - tooltipBoxHeight * tooltipSizeScale - bottom;\n } else {\n const y0 = canvasY;\n switch (getVerticalPositionType(pointerFixedPositionY, 'bottom')) {\n case 'center':\n y = y0 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'top':\n case 'centerTop':\n y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n case 'centerBottom':\n y = y0 + offsetY;\n break;\n }\n }\n\n x *= chartElementScale;\n y *= chartElementScale;\n if (isTrueBrowser(this._env)) {\n x += relativePosOffset.x;\n y += relativePosOffset.y;\n }\n x /= tooltipParentElementScale;\n y /= tooltipParentElementScale;\n\n /* 三、确保tooltip在视区内 */\n const { width: containerWidth, height: containerHeight } = containerSize;\n\n const isLeftOut = () => x * tooltipParentElementScale + tooltipParentElementRect.x < 0;\n const isRightOut = () =>\n (x + tooltipBoxWidth) * tooltipParentElementScale + tooltipParentElementRect.x > containerWidth;\n const isTopOut = () => y * tooltipParentElementScale + tooltipParentElementRect.y < 0;\n const isBottomOut = () =>\n (y + tooltipBoxHeight) * tooltipParentElementScale + tooltipParentElementRect.y > containerHeight;\n\n const detectLeftFirst = () => {\n if (isLeftOut()) {\n // 位置不超出视区左界\n if (isFixedPosition) {\n x = -tooltipParentElementRect.x / tooltipParentElementScale;\n } else {\n if (getHorizontalPositionType(position as TooltipFixedPosition, 'right') === 'center') {\n x += offsetX + tooltipBoxWidth / 2;\n } else {\n x += offsetX * 2 + tooltipBoxWidth;\n }\n }\n }\n };\n const detectLeftLast = () => {\n if (isLeftOut()) {\n // 位置不超出视区左界\n x = -tooltipParentElementRect.x / tooltipParentElementScale;\n }\n };\n const detectRightFirst = () => {\n if (isRightOut()) {\n // 位置不超出视区右界\n if (isFixedPosition) {\n x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;\n } else {\n if (getHorizontalPositionType(position as TooltipFixedPosition, 'right') === 'center') {\n x -= offsetX + tooltipBoxWidth / 2;\n } else {\n x -= offsetX * 2 + tooltipBoxWidth;\n }\n }\n }\n };\n const detectRightLast = () => {\n if (isRightOut()) {\n // 位置不超出视区右界\n x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;\n }\n };\n const detectTopFirst = () => {\n if (isTopOut()) {\n // 位置不超出视区上界\n if (isFixedPosition) {\n y = -tooltipParentElementRect.y / tooltipParentElementScale;\n } else {\n if (getVerticalPositionType(position as TooltipFixedPosition, 'bottom') === 'center') {\n y += offsetY + tooltipBoxHeight / 2;\n } else {\n y += offsetY * 2 + tooltipBoxHeight;\n }\n }\n }\n };\n const detectTopLast = () => {\n if (isTopOut()) {\n // 位置不超出视区上界\n y = 0 - tooltipParentElementRect.y / tooltipParentElementScale;\n }\n };\n const detectBottomFirst = () => {\n if (isBottomOut()) {\n // 位置不超出视区下界\n if (isFixedPosition) {\n y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;\n } else {\n if (getVerticalPositionType(position as TooltipFixedPosition, 'bottom') === 'center') {\n y -= offsetY + tooltipBoxHeight / 2;\n } else {\n y -= offsetY * 2 + tooltipBoxHeight;\n }\n }\n }\n };\n const detectBottomLast = () => {\n if (isBottomOut()) {\n // 位置不超出视区下界\n y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;\n }\n };\n\n // 处理左右\n switch (getHorizontalPositionType(position as TooltipFixedPosition, 'right')) {\n case 'center':\n case 'centerLeft':\n case 'centerRight':\n if (isLeftOut()) {\n detectLeftFirst();\n detectRightLast();\n } else {\n detectRightFirst();\n detectLeftLast();\n }\n break;\n case 'left':\n detectLeftFirst();\n detectRightLast();\n break;\n case 'right':\n detectRightFirst();\n detectLeftLast();\n break;\n }\n // 处理上下\n switch (getVerticalPositionType(position as TooltipFixedPosition, 'bottom')) {\n case 'center':\n case 'centerTop':\n case 'centerBottom':\n if (isTopOut()) {\n detectTopFirst();\n detectBottomLast();\n } else {\n detectBottomFirst();\n detectTopLast();\n }\n break;\n case 'top':\n detectTopFirst();\n detectBottomLast();\n break;\n case 'bottom':\n detectBottomFirst();\n detectTopLast();\n break;\n }\n\n const result = { x, y };\n this._cacheTooltipPosition = result;\n this._cacheTooltipSize = { width: tooltipBoxWidth, height: tooltipBoxHeight };\n return result;\n };\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!changePositionOnly || isNil(this._attributes)) {\n const chartTheme = this._chartOption?.getTheme() ?? {};\n this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);\n }\n const { panel, panelDomHeight } = this._attributes ?? {};\n return {\n width: panel?.width,\n height: panelDomHeight ?? panel?.height\n };\n }\n\n protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams) {\n let { canvasX: x, canvasY: y } = params.event;\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n const tooltipSpec = this._cacheViewSpec;\n const isCanvas = tooltipSpec.renderMode === 'canvas';\n const tooltipParentElement = this._getParentElement(tooltipSpec);\n\n let relativePosOffset = { x: 0, y: 0 };\n let tooltipParentElementRect: IPoint | DOMRect = { x: 0, y: 0 };\n let chartElementScale = 1;\n let tooltipParentElementScale = 1;\n\n if (isTrueBrowser(this._env) && !tooltipSpec.confine) {\n if (!isCanvas) {\n tooltipParentElementRect = tooltipParentElement?.getBoundingClientRect() ?? invalidPosition;\n const chartElement = (this._compiler.getCanvas() ?? this._chartContainer) as HTMLElement;\n const chartElementRect = chartElement?.getBoundingClientRect();\n relativePosOffset = {\n x: chartElementRect.x - tooltipParentElementRect.x,\n y: chartElementRect.y - tooltipParentElementRect.y\n };\n chartElementScale = getScale(chartElement, chartElementRect);\n tooltipParentElementScale = getScale(tooltipParentElement, tooltipParentElementRect as DOMRect);\n }\n }\n\n x *= chartElementScale;\n y *= chartElementScale;\n if (isTrueBrowser(this._env)) {\n x += relativePosOffset.x;\n y += relativePosOffset.y;\n }\n x /= tooltipParentElementScale;\n y /= tooltipParentElementScale;\n return { x, y };\n }\n\n protected _isPointerMovingToTooltip(params: TooltipHandlerParams) {\n if (!this._cacheTooltipPosition || !this._cacheTooltipSize || !this._cachePointerPosition) {\n return false;\n }\n const { width: tooltipWidth, height: tooltipHeight } = this._cacheTooltipSize;\n const { x: tooltipX = 0, y: tooltipY } = this._cacheTooltipPosition;\n\n const pos = this._getPointerPositionRelativeToTooltipParent(params);\n\n if (\n pointInRect(\n pos,\n {\n x1: tooltipX,\n y1: tooltipY,\n x2: tooltipX + tooltipWidth,\n y2: tooltipY + tooltipHeight\n },\n false\n )\n ) {\n return true;\n }\n\n // 确定 tooltip 四端点坐标\n const a = { x: tooltipX, y: tooltipY };\n const b = { x: a.x + tooltipWidth, y: a.y };\n const c = { x: a.x, y: a.y + tooltipHeight };\n const d = { x: b.x, y: c.y };\n const oldPos = this._cachePointerPosition;\n\n return (\n polygonContainPoint([oldPos, a, b], pos.x, pos.y) ||\n polygonContainPoint([oldPos, c, d], pos.x, pos.y) ||\n polygonContainPoint([oldPos, a, d], pos.x, pos.y) ||\n polygonContainPoint([oldPos, b, c], pos.x, pos.y)\n );\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return spec.parentElement as any;\n }\n\n getTooltipContainer() {\n return this._container;\n }\n\n protected _initFromSpec() {\n this._option = this._getDefaultOption();\n // 为方法加防抖\n this.changeTooltip = this._throttle(this._changeTooltip) as any;\n this.changeTooltipPosition = this._throttle(this._changeTooltipPosition) as any;\n }\n\n reInit() {\n this._initFromSpec();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/plugin/components/tooltip-handler/base.ts"],"names":[],"mappings":";;;AAAA,iDAAmF;AAGnF,2CAA8C;AAK9C,2CAAkD;AAalD,2CAAkE;AAClE,+CAO0B;AAC1B,6CAAiD;AACjD,+CAAyD;AAKzD,6CAU0B;AAK1B,iDAAyD;AAYzD,wDAAoD;AAEpD,wCAA+C;AAmB/C,MAAsB,kBAAmB,SAAQ,wBAAU;IAA3D;;QAOY,aAAQ,GAAG,IAAI,CAAC;QAchB,gBAAW,GAA+B,IAAI,CAAC;QAkB/C,gBAAW,GAAY,KAAK,CAAC;QAavC,gBAAW,GAAG,CAAC,UAA6B,EAAE,IAAiB,EAAE,MAA4B,EAAE,EAAE;;YAC/F,IAAI,kB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AC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YACjD,IAAA,4BAAmB,EAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAClD,CAAC;IACJ,CAAC;IAES,iBAAiB,CAAC,IAAkB;QAC5C,OAAO,IAAI,CAAC,aAAoB,CAAC;IACnC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAES,aAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAExC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAQ,CAAC;QAChE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAQ,CAAC;IAClF,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;;AA70BH,gDA80BC;AA50BiB,0BAAO,GAAG,SAAS,CAAC","file":"base.js","sourcesContent":["import { DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT } from '../../../constant/base';\nimport type { Options } from './constants';\n// eslint-disable-next-line no-duplicate-imports\nimport { DEFAULT_OPTIONS } from './constants';\nimport type { Maybe, IPoint, ILayoutPoint, RenderMode } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ITooltipPositionFixedValue } from '../../../typings/tooltip/position';\n// eslint-disable-next-line no-duplicate-imports\nimport { isTrueBrowser } from '../../../util/env';\nimport type {\n TooltipData,\n ITooltipActual,\n TooltipActiveType,\n ITooltipHandler,\n ITooltipPattern,\n ITooltipPositionActual,\n IGlobalTooltipPositionPattern\n} from '../../../typings/tooltip';\n// eslint-disable-next-line no-duplicate-imports\nimport type { TooltipFixedPosition } from '../../../typings/tooltip';\nimport type { BaseEventParams } from '../../../event/interface';\nimport { getTooltipPatternValue, getScale } from './utils/common';\nimport {\n getActualTooltipPositionValue,\n getCartesianCrosshairRect,\n getHorizontalPositionType,\n getVerticalPositionType,\n isFixedTooltipPositionPattern,\n isGlobalTooltipPositionPattern\n} from './utils/position';\nimport { getShowContent } from './utils/compose';\nimport { getTooltipSpecForShow } from './utils/get-spec';\nimport type { ICartesianSeries, ISeries } from '../../../series/interface';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { AABBBounds } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n isNumber,\n isObject,\n isValidNumber,\n isValid,\n throttle,\n isNil,\n polygonContainPoint,\n pointInRect,\n isFunction\n} from '@visactor/vutils';\nimport type { IElement } from '@visactor/vgrammar-core';\nimport type { ILayoutModel } from '../../../model/interface';\nimport type { Compiler } from '../../../compile/compiler';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { getTooltipAttributes } from './utils/attribute';\nimport type { DimensionEventParams } from '../../../event/events/dimension/interface';\nimport type { IChartOption } from '../../../chart/interface';\nimport type {\n ITooltipSpec,\n Tooltip,\n TooltipActualTitleContent,\n TooltipHandlerParams\n} from '../../../component/tooltip';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipResult } from '../../../component/tooltip';\nimport type { IComponentPlugin, IComponentPluginService } from '../interface';\nimport { BasePlugin } from '../../base/base-plugin';\nimport type { ITooltipAttributes } from './interface';\nimport { getFirstSeries } from '../../../util';\n\ntype ChangeTooltipFunc = (\n visible: boolean,\n params: TooltipHandlerParams,\n changePositionOnly?: boolean,\n activeType?: TooltipActiveType,\n data?: TooltipData\n) => TooltipResult;\n\ntype ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n data: TooltipData,\n params: TooltipHandlerParams\n) => TooltipResult;\n\n/**\n * The tooltip handler class.\n */\nexport abstract class BaseTooltipHandler extends BasePlugin implements ITooltipHandler, IComponentPlugin {\n static readonly pluginType: 'component';\n static readonly specKey = 'tooltip';\n\n readonly type: string;\n\n /** 是否可见 */\n protected _visible = true;\n\n // protected _style: ITooltipStyle = {};\n\n protected _option: Options;\n\n protected _chartOption: IChartOption;\n\n protected _env: RenderMode;\n public get env() {\n return this._env;\n }\n\n protected _component: Tooltip;\n protected _attributes?: ITooltipAttributes | null = null;\n\n protected _chartContainer: Maybe<HTMLElement>;\n protected _compiler: Compiler;\n\n protected _cacheViewSpec: ITooltipSpec | undefined;\n protected _cacheActualTooltip: ITooltipActual | undefined;\n\n protected _isTooltipPaused: boolean;\n protected _isPointerEscaped: boolean;\n protected _cachePointerTimer: number;\n protected _cachePointerPosition: ILayoutPoint;\n protected _cacheTooltipPosition: ILayoutPoint;\n protected _cacheTooltipSize: IContainerSize;\n\n // tooltip 容器\n protected _container!: Maybe<IGroup | HTMLElement>;\n\n protected _isReleased: boolean = false;\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n const component = service.component as Tooltip;\n this._component = component;\n this._chartOption = component.getOption() as any;\n this._env = this._chartOption.mode;\n this._chartContainer = this._chartOption.globalInstance.getContainer();\n this._compiler = component.getCompiler();\n this._initFromSpec();\n }\n\n showTooltip = (activeType: TooltipActiveType, data: TooltipData, params: TooltipHandlerParams) => {\n let changePositionOnly = !!params.changePositionOnly;\n if (!params.changePositionOnly || this._cacheActualTooltip?.activeType !== activeType) {\n changePositionOnly = false;\n this._clearCacheOfContent();\n }\n\n if (changePositionOnly && this._cacheViewSpec && this._cacheActualTooltip) {\n return this.changeTooltipPosition(changePositionOnly, data, params);\n }\n return this.changeTooltip(true, params, changePositionOnly, activeType, data);\n };\n\n /** 改变 tooltip 内容和位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltip: ChangeTooltipFunc;\n\n /** 改变 tooltip 内容和位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltip: ChangeTooltipFunc = (\n visible: boolean,\n params: TooltipHandlerParams,\n changePositionOnly?: boolean,\n activeType?: TooltipActiveType,\n data?: TooltipData\n ) => {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n if (this._isReleased || !tooltipSpec) {\n return TooltipResult.failed;\n }\n\n /** 关闭 tooltip */\n if (!visible) {\n this._clearAllCache();\n\n /** 用户自定义逻辑 */\n if (tooltipSpec.handler) {\n return tooltipSpec.handler.hideTooltip?.(params) ?? TooltipResult.success;\n }\n /** 默认逻辑 */\n this._updateTooltip(false, params);\n return TooltipResult.success;\n }\n\n if (isNil(activeType) || isNil(data)) {\n return TooltipResult.failed;\n }\n\n /** spec 预处理 */\n let spec: ITooltipSpec | undefined;\n if (changePositionOnly && this._cacheViewSpec) {\n spec = this._cacheViewSpec;\n } else {\n spec = getTooltipSpecForShow(\n activeType!,\n tooltipSpec,\n (params as BaseEventParams).model as ISeries,\n (params as DimensionEventParams).dimensionInfo\n );\n this._cacheViewSpec = spec;\n }\n\n if (spec.visible === false) {\n return TooltipResult.failed;\n }\n\n /** 用户自定义逻辑 */\n if (spec.handler) {\n return spec.handler.showTooltip?.(activeType!, data!, params) ?? TooltipResult.success;\n }\n\n /** 默认逻辑 */\n const pattern = spec[activeType!] as ITooltipPattern;\n if (!pattern) {\n return TooltipResult.failed;\n }\n\n // 合成 tooltip 内容\n let actualTooltip: ITooltipActual | undefined;\n if (changePositionOnly && this._cacheActualTooltip) {\n actualTooltip = this._cacheActualTooltip;\n } else {\n actualTooltip = this._getActualTooltipContent(pattern, data!, params);\n actualTooltip.title = pattern.updateTitle?.(actualTooltip.title, data, params) ?? actualTooltip.title;\n actualTooltip.content = pattern.updateContent?.(actualTooltip.content, data, params) ?? actualTooltip.content;\n }\n\n // 判断 tooltip 是否为空\n if (isNil(actualTooltip.title?.key) && isNil(actualTooltip.title?.value) && !actualTooltip.content?.length) {\n return TooltipResult.failed;\n }\n\n this._cacheActualTooltip = actualTooltip;\n return this._changeTooltipPosition(!!changePositionOnly, data!, params);\n };\n\n /** 改变 tooltip 位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltipPosition: ChangeTooltipPositionFunc;\n\n /** 改变 tooltip 位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltipPosition: ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n data: TooltipData,\n params: TooltipHandlerParams\n ) => {\n if (this._isReleased) {\n return TooltipResult.failed;\n }\n\n const event = params.event as MouseEvent;\n const spec = this._cacheViewSpec;\n const actualTooltip = this._cacheActualTooltip;\n if (!spec || !actualTooltip) {\n return TooltipResult.failed;\n }\n\n if (spec.enterable) {\n if (!this._isPointerEscaped && this._isPointerMovingToTooltip(params)) {\n if (!this._isTooltipPaused) {\n this._isTooltipPaused = true;\n this._cachePointerTimer = setTimeout(() => {\n this._isPointerEscaped = true;\n }, 300) as unknown as number;\n }\n return TooltipResult.success;\n }\n this._isTooltipPaused = false;\n this._isPointerEscaped = false;\n clearTimeout(this._cachePointerTimer);\n this._cachePointerPosition = this._getPointerPositionRelativeToTooltipParent(params);\n }\n\n const activeType = actualTooltip.activeType;\n\n /** 用户自定义逻辑 */\n if (spec.handler) {\n return spec.handler.showTooltip?.(activeType, data, params) ?? TooltipResult.success;\n }\n\n /** 默认逻辑 */\n const pattern = spec[activeType];\n if (!pattern) {\n return TooltipResult.failed;\n }\n\n // 计算 tooltip 位置\n const position = this._getActualTooltipPosition(\n actualTooltip,\n params,\n this._getTooltipBoxSize(actualTooltip, changePositionOnly)\n );\n actualTooltip.position = position;\n if (pattern.updatePosition) {\n actualTooltip.position = pattern.updatePosition(actualTooltip.position, data, params);\n }\n\n // 判断 tooltip 可见性\n let tooltipVisible = pattern?.visible !== false;\n if (\n !data ||\n event.type === 'pointerout' ||\n !actualTooltip.visible ||\n (!actualTooltip.title && !actualTooltip.content)\n ) {\n tooltipVisible = false;\n }\n\n this._updateTooltip(\n tooltipVisible,\n {\n ...params,\n changePositionOnly\n },\n actualTooltip\n );\n return TooltipResult.success;\n };\n\n hideTooltip(params: TooltipHandlerParams): TooltipResult {\n return this.changeTooltip(false, params);\n }\n\n release(): void {\n this._clearAllCache();\n const spec = this._component.getSpec() ?? {};\n /** 用户自定义逻辑 */\n if (spec.handler) {\n spec.handler.release?.();\n return;\n }\n /** 默认逻辑 */\n this._removeTooltip();\n\n this._isReleased = true;\n }\n\n protected _clearAllCache() {\n this._clearCacheOfContent();\n this._clearCacheOfPosition();\n }\n\n protected _clearCacheOfContent() {\n this._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n }\n\n protected _clearCacheOfPosition() {\n this._isTooltipPaused = false;\n this._isPointerEscaped = false;\n clearTimeout(this._cachePointerTimer);\n this._cachePointerTimer = -1;\n this._cachePointerPosition = undefined;\n this._cacheTooltipPosition = undefined;\n this._cacheTooltipSize = undefined;\n }\n\n /* -----需要子类继承的方法开始----- */\n\n protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: ITooltipActual): void;\n protected abstract _removeTooltip(): void;\n\n /* -----需要子类继承的方法结束----- */\n\n protected _throttle(callback: any) {\n const tooltipSpec = this._component.getSpec();\n let wait: number;\n if (isNumber(tooltipSpec.throttleInterval)) {\n wait = tooltipSpec.throttleInterval;\n } else {\n if (tooltipSpec.renderMode !== 'html' || !tooltipSpec.transitionDuration) {\n wait = 10;\n } else {\n wait = 50;\n }\n }\n return throttle(callback, wait);\n }\n\n protected _getDefaultOption(): Options {\n const { offset } = this._component.getSpec();\n return {\n ...DEFAULT_OPTIONS,\n offsetX: offset?.x ?? DEFAULT_OPTIONS.offsetX,\n offsetY: offset?.y ?? DEFAULT_OPTIONS.offsetY\n };\n }\n\n /**\n * 计算实际的 tooltip 内容\n * @param pattern\n * @param data\n * @param event\n */\n protected _getActualTooltipContent = (\n pattern: ITooltipPattern,\n data: TooltipData,\n params: TooltipHandlerParams\n ): ITooltipActual => {\n // 可见性\n const patternVisible = getTooltipPatternValue(pattern.visible, data, params);\n\n // 数据\n let tooltipContent: TooltipActualTitleContent | null = null;\n tooltipContent = getShowContent(pattern, data, params);\n\n const actualTooltip: ITooltipActual = {\n ...tooltipContent,\n visible: isValid(tooltipContent) ? patternVisible !== false : false, // 最终展示数据为 null 则不展示\n activeType: pattern.activeType,\n data\n };\n\n return actualTooltip;\n };\n\n /**\n * 计算实际的 tooltip 位置\n */\n protected _getActualTooltipPosition = (\n actualTooltip: ITooltipActual,\n params: TooltipHandlerParams,\n tooltipBoxSize: IContainerSize | undefined\n ): ITooltipPositionActual => {\n const event = params.event as MouseEvent;\n const firstDimensionInfo = params.dimensionInfo?.[0];\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n let { offsetX, offsetY } = this._option;\n const tooltipSpec = this._cacheViewSpec;\n if (!tooltipSpec) {\n this._cacheTooltipPosition = undefined;\n return invalidPosition;\n }\n\n const { activeType, data } = actualTooltip;\n const pattern = tooltipSpec[activeType];\n const position = getTooltipPatternValue(pattern.position, data, params);\n const positionMode =\n getTooltipPatternValue(pattern.positionMode, data, params) ?? (activeType === 'mark' ? 'mark' : 'pointer');\n const tooltipParentElement = this._getParentElement(tooltipSpec);\n const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = tooltipBoxSize ?? {};\n\n const isCanvas = tooltipSpec.renderMode === 'canvas';\n const canvasRect = params?.chart?.getCanvasRect();\n const canvasWidth = canvasRect?.width ?? DEFAULT_CHART_WIDTH;\n const canvasHeight = canvasRect?.height ?? DEFAULT_CHART_HEIGHT;\n let isFixedPosition = false;\n\n const containerSize = {\n width: 0,\n height: 0\n };\n let relativePosOffset = { x: 0, y: 0 };\n let tooltipParentElementRect: IPoint | DOMRect = { x: 0, y: 0 };\n let chartElementScale = 1;\n let tooltipParentElementScale = 1;\n\n if (isTrueBrowser(this._env) && !tooltipSpec.confine) {\n // 只有在 browser 模式下才可以获取到 window 对象\n containerSize.width = window.innerWidth;\n containerSize.height = window.innerHeight;\n\n if (!isCanvas) {\n tooltipParentElementRect = tooltipParentElement?.getBoundingClientRect() ?? invalidPosition;\n const chartElement = (this._compiler.getCanvas() ?? this._chartContainer) as HTMLElement;\n const chartElementRect = chartElement?.getBoundingClientRect();\n relativePosOffset = {\n x: chartElementRect.x - tooltipParentElementRect.x,\n y: chartElementRect.y - tooltipParentElementRect.y\n };\n chartElementScale = getScale(chartElement, chartElementRect);\n tooltipParentElementScale = getScale(tooltipParentElement, tooltipParentElementRect as DOMRect);\n }\n } else {\n containerSize.width = canvasWidth;\n containerSize.height = canvasHeight;\n }\n const tooltipSizeScale = tooltipParentElementScale / chartElementScale;\n\n /* 一、计算 left、top、right、bottom */\n let left: number | undefined;\n let top: number | undefined;\n let right: number | undefined;\n let bottom: number | undefined;\n\n let pointerFixedPositionX: TooltipFixedPosition = position as any;\n let pointerFixedPositionY: TooltipFixedPosition = position as any;\n\n const processCartesianFixedPositionX = ({ orient, mode, offset }: ITooltipPositionFixedValue) => {\n let x1: number;\n let x2: number;\n const model = params.model as ILayoutModel;\n const startPoint = model?.getLayoutStartPoint();\n offsetX = offset ?? offsetX;\n\n if (mode === 'mark') {\n isFixedPosition = true;\n const element = params.item as IElement;\n const bounds = element?.getBounds() as AABBBounds;\n if (bounds && startPoint) {\n x1 = bounds.x1 + startPoint.x;\n x2 = bounds.x2 + startPoint.x;\n }\n } else if (mode === 'crosshair' && firstDimensionInfo?.axis?.getCoordinateType() === 'cartesian') {\n isFixedPosition = true;\n const rect = getCartesianCrosshairRect(\n params.dimensionInfo,\n getFirstSeries(this._component.getRegions(), 'cartesian') as ICartesianSeries,\n startPoint\n );\n if (rect) {\n x1 = rect.start.x;\n x2 = rect.end.x;\n }\n } else {\n pointerFixedPositionX = orient;\n }\n\n if (isFixedPosition) {\n switch (getHorizontalPositionType(orient)) {\n case 'left':\n left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n left = x2 + offsetX;\n break;\n case 'center':\n left = (x1 + x2) / 2 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'centerLeft':\n left = (x1 + x2) / 2 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'centerRight':\n left = (x1 + x2) / 2 + offsetX;\n break;\n }\n }\n };\n const processCartesianFixedPositionY = ({ orient, mode, offset }: ITooltipPositionFixedValue) => {\n let y1: number;\n let y2: number;\n const model = params.model as ILayoutModel;\n const startPoint = model?.getLayoutStartPoint();\n offsetY = offset ?? offsetY;\n\n if (mode === 'mark') {\n isFixedPosition = true;\n const element = params.item as IElement;\n const bounds = element?.getBounds() as AABBBounds;\n if (bounds && startPoint) {\n y1 = bounds.y1 + startPoint.y;\n y2 = bounds.y2 + startPoint.y;\n }\n } else if (mode === 'crosshair' && firstDimensionInfo?.axis?.getCoordinateType() === 'cartesian') {\n isFixedPosition = true;\n const rect = getCartesianCrosshairRect(\n params.dimensionInfo,\n getFirstSeries(this._component.getRegions(), 'cartesian') as ICartesianSeries,\n startPoint\n );\n if (rect) {\n y1 = rect.start.y;\n y2 = rect.end.y;\n }\n } else {\n pointerFixedPositionY = orient;\n }\n\n if (isFixedPosition) {\n switch (getVerticalPositionType(orient)) {\n case 'top':\n top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n top = y2 + offsetY;\n break;\n case 'center':\n top = (y1 + y2) / 2 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'centerTop':\n top = (y1 + y2) / 2 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'centerBottom':\n top = (y1 + y2) / 2 + offsetY;\n break;\n }\n }\n };\n\n if (isObject(position)) {\n if (isGlobalTooltipPositionPattern(position)) {\n const {\n left: posLeft,\n right: posRight,\n top: posTop,\n bottom: posBottom\n } = position as IGlobalTooltipPositionPattern;\n left = getActualTooltipPositionValue(posLeft, event);\n top = getActualTooltipPositionValue(posTop, event);\n right = getActualTooltipPositionValue(posRight, event);\n bottom = getActualTooltipPositionValue(posBottom, event);\n } else if (isFixedTooltipPositionPattern(position)) {\n const { x, y } = position;\n if (isNumber(x) || isFunction(x)) {\n left = getActualTooltipPositionValue(x, event);\n } else {\n processCartesianFixedPositionX(x);\n }\n if (isNumber(y) || isFunction(y)) {\n top = getActualTooltipPositionValue(y, event);\n } else {\n processCartesianFixedPositionY(y);\n }\n }\n } else if (isValid(position)) {\n processCartesianFixedPositionX({ orient: position, mode: positionMode });\n processCartesianFixedPositionY({ orient: position, mode: positionMode });\n }\n\n /* 二、换算成 x 和 y */\n let x: number;\n let y: number;\n\n const { canvasX, canvasY } = event as any;\n if (isValidNumber(left)) {\n x = left;\n } else if (isValidNumber(right)) {\n x = canvasWidth - tooltipBoxWidth * tooltipSizeScale - right;\n } else {\n const x0 = canvasX;\n switch (getHorizontalPositionType(pointerFixedPositionX, 'right')) {\n case 'center':\n x = x0 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'left':\n case 'centerLeft':\n x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n case 'centerRight':\n x = x0 + offsetX;\n break;\n }\n }\n if (isValidNumber(top)) {\n y = top;\n } else if (isValidNumber(bottom)) {\n y = canvasHeight - tooltipBoxHeight * tooltipSizeScale - bottom;\n } else {\n const y0 = canvasY;\n switch (getVerticalPositionType(pointerFixedPositionY, 'bottom')) {\n case 'center':\n y = y0 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'top':\n case 'centerTop':\n y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n case 'centerBottom':\n y = y0 + offsetY;\n break;\n }\n }\n\n x *= chartElementScale;\n y *= chartElementScale;\n if (isTrueBrowser(this._env)) {\n x += relativePosOffset.x;\n y += relativePosOffset.y;\n }\n x /= tooltipParentElementScale;\n y /= tooltipParentElementScale;\n\n /* 三、确保tooltip在视区内 */\n const { width: containerWidth, height: containerHeight } = containerSize;\n\n const isLeftOut = () => x * tooltipParentElementScale + tooltipParentElementRect.x < 0;\n const isRightOut = () =>\n (x + tooltipBoxWidth) * tooltipParentElementScale + tooltipParentElementRect.x > containerWidth;\n const isTopOut = () => y * tooltipParentElementScale + tooltipParentElementRect.y < 0;\n const isBottomOut = () =>\n (y + tooltipBoxHeight) * tooltipParentElementScale + tooltipParentElementRect.y > containerHeight;\n\n const detectLeftFirst = () => {\n if (isLeftOut()) {\n // 位置不超出视区左界\n if (isFixedPosition) {\n x = -tooltipParentElementRect.x / tooltipParentElementScale;\n } else {\n if (getHorizontalPositionType(position as TooltipFixedPosition, 'right') === 'center') {\n x += offsetX + tooltipBoxWidth / 2;\n } else {\n x += offsetX * 2 + tooltipBoxWidth;\n }\n }\n }\n };\n const detectLeftLast = () => {\n if (isLeftOut()) {\n // 位置不超出视区左界\n x = -tooltipParentElementRect.x / tooltipParentElementScale;\n }\n };\n const detectRightFirst = () => {\n if (isRightOut()) {\n // 位置不超出视区右界\n if (isFixedPosition) {\n x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;\n } else {\n if (getHorizontalPositionType(position as TooltipFixedPosition, 'right') === 'center') {\n x -= offsetX + tooltipBoxWidth / 2;\n } else {\n x -= offsetX * 2 + tooltipBoxWidth;\n }\n }\n }\n };\n const detectRightLast = () => {\n if (isRightOut()) {\n // 位置不超出视区右界\n x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth;\n }\n };\n const detectTopFirst = () => {\n if (isTopOut()) {\n // 位置不超出视区上界\n if (isFixedPosition) {\n y = -tooltipParentElementRect.y / tooltipParentElementScale;\n } else {\n if (getVerticalPositionType(position as TooltipFixedPosition, 'bottom') === 'center') {\n y += offsetY + tooltipBoxHeight / 2;\n } else {\n y += offsetY * 2 + tooltipBoxHeight;\n }\n }\n }\n };\n const detectTopLast = () => {\n if (isTopOut()) {\n // 位置不超出视区上界\n y = 0 - tooltipParentElementRect.y / tooltipParentElementScale;\n }\n };\n const detectBottomFirst = () => {\n if (isBottomOut()) {\n // 位置不超出视区下界\n if (isFixedPosition) {\n y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;\n } else {\n if (getVerticalPositionType(position as TooltipFixedPosition, 'bottom') === 'center') {\n y -= offsetY + tooltipBoxHeight / 2;\n } else {\n y -= offsetY * 2 + tooltipBoxHeight;\n }\n }\n }\n };\n const detectBottomLast = () => {\n if (isBottomOut()) {\n // 位置不超出视区下界\n y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;\n }\n };\n\n // 处理左右\n switch (getHorizontalPositionType(position as TooltipFixedPosition, 'right')) {\n case 'center':\n case 'centerLeft':\n case 'centerRight':\n if (isLeftOut()) {\n detectLeftFirst();\n detectRightLast();\n } else {\n detectRightFirst();\n detectLeftLast();\n }\n break;\n case 'left':\n detectLeftFirst();\n detectRightLast();\n break;\n case 'right':\n detectRightFirst();\n detectLeftLast();\n break;\n }\n // 处理上下\n switch (getVerticalPositionType(position as TooltipFixedPosition, 'bottom')) {\n case 'center':\n case 'centerTop':\n case 'centerBottom':\n if (isTopOut()) {\n detectTopFirst();\n detectBottomLast();\n } else {\n detectBottomFirst();\n detectTopLast();\n }\n break;\n case 'top':\n detectTopFirst();\n detectBottomLast();\n break;\n case 'bottom':\n detectBottomFirst();\n detectTopLast();\n break;\n }\n\n const result = { x, y };\n this._cacheTooltipPosition = result;\n this._cacheTooltipSize = { width: tooltipBoxWidth, height: tooltipBoxHeight };\n return result;\n };\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!changePositionOnly || isNil(this._attributes)) {\n const chartTheme = this._chartOption?.getTheme() ?? {};\n this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);\n }\n const { panel, panelDomHeight } = this._attributes ?? {};\n // canvas模式下, size需要考虑border size, 目的是为了精准判断边界是否超出画布,达到confine效果\n // html模式不提供confine, 所以不考虑精准计算size\n const isCanvas = this._component.getSpec().renderMode === 'canvas';\n\n return {\n width: panel?.width + (isCanvas ? panel.lineWidth : 0),\n height: (panelDomHeight ?? panel?.height) + (isCanvas ? panel.lineWidth : 0)\n };\n }\n\n protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams) {\n let { canvasX: x, canvasY: y } = params.event;\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n const tooltipSpec = this._cacheViewSpec;\n const isCanvas = tooltipSpec.renderMode === 'canvas';\n const tooltipParentElement = this._getParentElement(tooltipSpec);\n\n let relativePosOffset = { x: 0, y: 0 };\n let tooltipParentElementRect: IPoint | DOMRect = { x: 0, y: 0 };\n let chartElementScale = 1;\n let tooltipParentElementScale = 1;\n\n if (isTrueBrowser(this._env) && !tooltipSpec.confine) {\n if (!isCanvas) {\n tooltipParentElementRect = tooltipParentElement?.getBoundingClientRect() ?? invalidPosition;\n const chartElement = (this._compiler.getCanvas() ?? this._chartContainer) as HTMLElement;\n const chartElementRect = chartElement?.getBoundingClientRect();\n relativePosOffset = {\n x: chartElementRect.x - tooltipParentElementRect.x,\n y: chartElementRect.y - tooltipParentElementRect.y\n };\n chartElementScale = getScale(chartElement, chartElementRect);\n tooltipParentElementScale = getScale(tooltipParentElement, tooltipParentElementRect as DOMRect);\n }\n }\n\n x *= chartElementScale;\n y *= chartElementScale;\n if (isTrueBrowser(this._env)) {\n x += relativePosOffset.x;\n y += relativePosOffset.y;\n }\n x /= tooltipParentElementScale;\n y /= tooltipParentElementScale;\n return { x, y };\n }\n\n protected _isPointerMovingToTooltip(params: TooltipHandlerParams) {\n if (!this._cacheTooltipPosition || !this._cacheTooltipSize || !this._cachePointerPosition) {\n return false;\n }\n const { width: tooltipWidth, height: tooltipHeight } = this._cacheTooltipSize;\n const { x: tooltipX = 0, y: tooltipY } = this._cacheTooltipPosition;\n\n const pos = this._getPointerPositionRelativeToTooltipParent(params);\n\n if (\n pointInRect(\n pos,\n {\n x1: tooltipX,\n y1: tooltipY,\n x2: tooltipX + tooltipWidth,\n y2: tooltipY + tooltipHeight\n },\n false\n )\n ) {\n return true;\n }\n\n // 确定 tooltip 四端点坐标\n const a = { x: tooltipX, y: tooltipY };\n const b = { x: a.x + tooltipWidth, y: a.y };\n const c = { x: a.x, y: a.y + tooltipHeight };\n const d = { x: b.x, y: c.y };\n const oldPos = this._cachePointerPosition;\n\n return (\n polygonContainPoint([oldPos, a, b], pos.x, pos.y) ||\n polygonContainPoint([oldPos, c, d], pos.x, pos.y) ||\n polygonContainPoint([oldPos, a, d], pos.x, pos.y) ||\n polygonContainPoint([oldPos, b, c], pos.x, pos.y)\n );\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return spec.parentElement as any;\n }\n\n getTooltipContainer() {\n return this._container;\n }\n\n protected _initFromSpec() {\n this._option = this._getDefaultOption();\n // 为方法加防抖\n this.changeTooltip = this._throttle(this._changeTooltip) as any;\n this.changeTooltipPosition = this._throttle(this._changeTooltipPosition) as any;\n }\n\n reInit() {\n this._initFromSpec();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/utils/attribute.ts"],"names":[],"mappings":";;;AASA,6CAAyE;AACzE,iEAA6D;AAC7D,kDAAoE;AACpE,qCAA8C;AAG9C,mDAAgD;AAEhD,MAAM,uBAAuB,GAA+B;IAC1D,UAAU,EAAE,aAAK,CAAC,UAAU;IAC5B,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,QAA2B,EAAE,EAC7B,WAAoB,EACpB,iBAA8C;;IAE9C,MAAM,KAAK,mCACN,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,uBAAuB,CAAC,KACjD,IAAI,EAAE,CAAC,M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AM,KAAK,GAAG,IAAI,CAAC,KAA6C,CAAC;YAEjE,IAAI,KAAK,IAAI,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,IAAI,CAAC,EAAE;gBACtC,KAAK,CAAC,KAAK;oBACT,UAAU;wBACV,WAAW,CAAC,IAAI;wBAChB,WAAW,CAAC,KAAK;wBACjB,aAAa;wBACb,WAAW;wBACX,QAAQ,CAAC,OAAO;wBAChB,UAAU,CAAC,OAAO,CAAC;gBAErB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;oBACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACzC;gBACD,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aACtE;QACH,CAAC,CAAC,CAAC;KACJ;IAED,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;IACpC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,cAAc,GAAG,cAAc,CAAC;IAE3C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA1PW,QAAA,oBAAoB,wBA0P/B","file":"attribute.js","sourcesContent":["import type {\n TooltipPanelAttrs,\n TooltipRowAttrs,\n TooltipRowStyleAttrs,\n TooltipSymbolAttrs,\n TooltipTextAttrs\n} from '@visactor/vrender-components';\nimport type { IPadding, ITooltipActual } from '../../../../typings';\nimport type { ITooltipAttributes, ITooltipTextStyle } from '../interface';\nimport { isValid, maxInArray, normalizePadding } from '@visactor/vutils';\nimport { mergeSpec } from '../../../../util/spec/merge-spec';\nimport { normalizeLayoutPaddingSpec } from '../../../../util/space';\nimport { measureTooltipText } from './common';\nimport type { ITheme } from '../../../../theme';\nimport type { ITooltipSpec, ITooltipTextTheme, ITooltipTheme } from '../../../../component/tooltip';\nimport { token } from '../../../../theme/token';\n\nconst DEFAULT_TEXT_ATTRIBUTES: Partial<ITooltipTextStyle> = {\n fontFamily: token.fontFamily,\n spacing: 10,\n wordBreak: 'break-word'\n};\n\nexport function getTextAttributes(\n style: ITooltipTextTheme = {},\n globalTheme?: ITheme,\n defaultAttributes?: Partial<ITooltipTextStyle>\n): ITooltipTextStyle {\n const attrs: ITooltipTextStyle = {\n ...(defaultAttributes ?? DEFAULT_TEXT_ATTRIBUTES),\n fill: (style.fill ?? style.fontColor) as string,\n textAlign: style.textAlign,\n textBaseline: style.textBaseline,\n fontFamily: style.fontFamily ?? (globalTheme?.fontFamily as string),\n fontSize: style.fontSize as number,\n fontWeight: style.fontWeight,\n lineHeight: style.lineHeight as number,\n spacing: style.spacing,\n multiLine: style.multiLine,\n maxWidth: style.maxWidth,\n wordBreak: style.wordBreak,\n autoWidth: style.autoWidth\n };\n return attrs;\n}\n\nexport const getPanelAttributes = (style: ITooltipTheme['panel']): TooltipPanelAttrs => {\n const { backgroundColor, border, shadow } = style;\n const panelAttrs: TooltipPanelAttrs = {\n lineWidth: border?.width ?? 0,\n shadow: !!shadow\n };\n if (border?.color) {\n panelAttrs.stroke = border.color as string;\n }\n if (backgroundColor) {\n panelAttrs.fill = backgroundColor as string;\n }\n if (shadow) {\n panelAttrs.shadowColor = shadow.color as string;\n panelAttrs.shadowBlur = shadow.blur;\n panelAttrs.shadowOffsetX = shadow.x;\n panelAttrs.shadowOffsetY = shadow.y;\n panelAttrs.shadowSpread = shadow.spread;\n }\n const { radius } = border ?? {};\n if (isValid(radius)) {\n panelAttrs.cornerRadius = [radius, radius, radius, radius];\n }\n return panelAttrs;\n};\n\nexport const getTooltipAttributes = (\n actualTooltip: ITooltipActual,\n spec: ITooltipSpec,\n globalTheme: ITheme\n): ITooltipAttributes => {\n const { style = {}, enterable, transitionDuration } = spec;\n const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow: commonSpaceRow, maxContentHeight } = style;\n const padding = normalizePadding(panel.padding);\n const paddingSpec = normalizeLayoutPaddingSpec(panel.padding) as IPadding;\n\n const titleStyle = getTextAttributes(titleLabel, globalTheme);\n const keyStyle = getTextAttributes(keyLabel, globalTheme);\n const valueStyle = getTextAttributes(valueLabel, globalTheme);\n const shapeStyle: TooltipRowStyleAttrs['shape'] = {\n fill: true,\n size: shape?.size ?? 8,\n spacing: shape?.spacing ?? 6\n };\n\n const attributes: ITooltipAttributes = {\n panel: getPanelAttributes(panel),\n padding,\n\n title: {},\n content: [],\n\n titleStyle: {\n value: titleStyle,\n spaceRow: commonSpaceRow\n },\n contentStyle: {\n shape: shapeStyle,\n key: keyStyle,\n value: valueStyle,\n spaceRow: commonSpaceRow\n },\n hasContentShape: false,\n keyWidth: 0,\n valueWidth: 0,\n\n maxContentHeight,\n\n enterable,\n transitionDuration\n };\n\n const { title = {}, content = [] } = actualTooltip;\n\n let panelWidth = paddingSpec.left + paddingSpec.right;\n let panelHeight = paddingSpec.top + paddingSpec.bottom;\n /** dom tooltip 的高度。由于 canvas tooltip 不支持滚动条,dom tooltip 单独计算高度 */\n let panelDomHeight = paddingSpec.top + paddingSpec.bottom;\n\n // calculate content\n let contentMaxWidth = 0;\n // filter content\n const filteredContent = content.filter(item => {\n return (item.key || item.value) && item.visible !== false;\n });\n const hasContent = !!filteredContent.length;\n let maxKeyWidth = 0;\n let maxAdaptiveKeyWidth = 0;\n let maxValueWidth = 0;\n let maxShapeWidth = 0;\n\n if (hasContent) {\n const keyWidths: number[] = [];\n const adaptiveKeyWidths: number[] = [];\n const valueWidths: number[] = [];\n const shapeWidths: number[] = [];\n\n let contentHeight = 0;\n attributes.content = filteredContent.map((item, i) => {\n let itemHeight = 0;\n const {\n hasShape: actualHasShape,\n key: actualKey,\n shapeType: actualShapeType = '',\n shapeFill: actualShapeFill,\n shapeStroke: actualShapeStroke,\n shapeLineWidth: actualShapeLineWidth,\n shapeSize: actualShapeSize,\n value: actualValue,\n isKeyAdaptive: actualIsKeyAdaptive,\n spaceRow: actualSpaceRow,\n keyStyle: actualKeyStyle,\n valueStyle: actualValueStyle,\n shapeHollow: actualShapeHollow,\n // 弃用的属性,做下兼容\n shapeColor: actualShapeColor\n } = item;\n const itemAttrs: TooltipRowAttrs = { height: 0, spaceRow: actualSpaceRow ?? commonSpaceRow };\n if (isValid(actualKey)) {\n const itemKeyStyle: ITooltipTextStyle = mergeSpec(\n {},\n keyStyle,\n getTextAttributes(actualKeyStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualKey, itemKeyStyle);\n itemAttrs.key = {\n width,\n height,\n ...itemKeyStyle,\n text\n };\n if (!actualIsKeyAdaptive) {\n keyWidths.push(width);\n } else {\n adaptiveKeyWidths.push(width);\n }\n itemHeight = Math.max(itemHeight, height);\n }\n if (isValid(actualValue)) {\n const itemValueStyle: ITooltipTextStyle = mergeSpec(\n {},\n valueStyle,\n getTextAttributes(actualValueStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualValue, itemValueStyle);\n itemAttrs.value = {\n width,\n height,\n ...itemValueStyle,\n text\n };\n valueWidths.push(width);\n itemHeight = Math.max(itemHeight, height);\n }\n if (actualHasShape) {\n const shape: TooltipSymbolAttrs = {\n visible: true,\n symbolType: actualShapeType\n };\n const adaptiveShapeFill = actualShapeFill ?? actualShapeColor;\n if (actualShapeHollow) {\n shape.stroke = adaptiveShapeFill;\n } else {\n shape.fill = adaptiveShapeFill;\n }\n shape.stroke = actualShapeStroke ?? adaptiveShapeFill;\n shape.lineWidth = actualShapeLineWidth;\n itemAttrs.shape = shape;\n\n const shapeWidth = actualShapeSize ?? shapeStyle.size;\n itemHeight = Math.max(shapeWidth, itemHeight);\n shapeWidths.push(shapeWidth);\n } else {\n itemAttrs.shape = { visible: false };\n }\n\n itemAttrs.height = itemHeight;\n contentHeight += itemHeight;\n if (i < filteredContent.length - 1) {\n contentHeight += itemAttrs.spaceRow;\n }\n\n return itemAttrs;\n });\n panelHeight += contentHeight;\n panelDomHeight += Math.min(contentHeight, maxContentHeight ?? Infinity);\n\n maxKeyWidth = keyWidths.length ? maxInArray(keyWidths) : 0; // name 需要对齐\n maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? maxInArray(adaptiveKeyWidths) : 0;\n maxValueWidth = valueWidths.length ? maxInArray(valueWidths) : 0; // value 需要对齐\n maxShapeWidth = shapeWidths.length ? maxInArray(shapeWidths) + shapeStyle.spacing : 0; // shape 列宽度\n contentMaxWidth = Math.max(\n maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing,\n maxShapeWidth + maxAdaptiveKeyWidth,\n contentMaxWidth\n );\n attributes.hasContentShape = !!shapeWidths.length;\n attributes.keyWidth = maxKeyWidth;\n attributes.valueWidth = maxValueWidth;\n }\n\n // calculate title\n let titleMaxWidth = 0;\n let titleMaxHeight = 0;\n let titleHeightWithSpace = 0;\n const {\n visible: actualTitleVisible = true,\n value: actualTitleValue = '',\n valueStyle: actualTitleValueStyle,\n spaceRow: actualTitleSpaceRow\n } = title;\n attributes.title.visible = actualTitleVisible;\n attributes.title.spaceRow = actualTitleSpaceRow ?? commonSpaceRow;\n\n let titleValueStyle: ITooltipTextStyle = {};\n // 当前是否处于自适应宽度模式\n const isAutoWidthMode = () => titleValueStyle.autoWidth && titleValueStyle.multiLine !== false;\n if (actualTitleVisible) {\n titleValueStyle = mergeSpec({}, titleStyle, getTextAttributes(actualTitleValueStyle, undefined, {}));\n // 标题默认优化策略:如果 autoWidth 为 true,则宽度默认跟随 content 宽度并开启自动换行\n if (isAutoWidthMode()) {\n titleValueStyle.multiLine = titleValueStyle.multiLine ?? true;\n titleValueStyle.maxWidth = titleValueStyle.maxWidth ?? (hasContent ? Math.ceil(contentMaxWidth) : undefined);\n }\n\n const { text, width, height } = measureTooltipText(actualTitleValue, titleValueStyle);\n attributes.title.value = {\n width: isAutoWidthMode() ? Math.min(width, titleValueStyle.maxWidth ?? Number.MAX_VALUE) : width,\n height,\n ...titleValueStyle,\n text\n };\n titleMaxWidth = attributes.title.value.width;\n titleMaxHeight = attributes.title.value.height;\n\n titleHeightWithSpace = titleMaxHeight + (hasContent ? attributes.title.spaceRow : 0);\n }\n panelHeight += titleHeightWithSpace;\n panelDomHeight += titleHeightWithSpace;\n attributes.title.width = titleMaxWidth;\n attributes.title.height = titleMaxHeight;\n\n if (isAutoWidthMode()) {\n panelWidth += contentMaxWidth ? contentMaxWidth : titleMaxWidth;\n } else {\n panelWidth += Math.max(titleMaxWidth, contentMaxWidth);\n }\n\n // 处理 content 的自动宽度模式\n if (hasContent) {\n attributes.content.forEach(item => {\n const value = item.value as ITooltipTextStyle & TooltipTextAttrs;\n // 最后一列默认自适应宽度\n if (value && (value.autoWidth ?? true)) {\n value.width =\n panelWidth -\n paddingSpec.left -\n paddingSpec.right -\n maxShapeWidth -\n maxKeyWidth -\n keyStyle.spacing -\n valueStyle.spacing;\n //value.multiLine = true; multiLine 需要用户手动开启,不会自动开启\n if (!value.maxWidth) {\n value.maxWidth = Math.ceil(value.width);\n }\n attributes.valueWidth = Math.max(attributes.valueWidth, value.width);\n }\n });\n }\n\n attributes.panel.width = panelWidth;\n attributes.panel.height = panelHeight;\n attributes.panelDomHeight = panelDomHeight;\n\n return attributes;\n};\n"]}
1
+ {"version":3,"sources":["../src/plugin/components/tooltip-handler/utils/attribute.ts"],"names":[],"mappings":";;;AASA,6CAAyE;AACzE,iEAA6D;AAC7D,kDAAoE;AACpE,qCAA8C;AAG9C,mDAAgD;AAEhD,MAAM,uBAAuB,GAA+B;IAC1D,UAAU,EAAE,aAAK,CAAC,UAAU;IAC5B,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,QAA2B,EAAE,EAC7B,WAAoB,EACpB,iBAA8C;;IAE9C,MAAM,KAAK,mCACN,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,uBAAuB,CAAC,KACjD,IAAI,EAAE,CAAC,MAAA,KAAK,CAAC,IAAI,mCAAI,KAAK,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AAC;YAEjE,IAAI,KAAK,IAAI,CAAC,MAAA,KAAK,CAAC,SAAS,mCAAI,IAAI,CAAC,EAAE;gBACtC,KAAK,CAAC,KAAK;oBACT,UAAU;wBACV,WAAW,CAAC,IAAI;wBAChB,WAAW,CAAC,KAAK;wBACjB,aAAa;wBACb,WAAW;wBACX,QAAQ,CAAC,OAAO;wBAChB,UAAU,CAAC,OAAO,CAAC;gBAErB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;oBACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACzC;gBACD,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aACtE;QACH,CAAC,CAAC,CAAC;KACJ;IAED,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;IACpC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC;IACtC,UAAU,CAAC,cAAc,GAAG,cAAc,CAAC;IAC3C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAzPW,QAAA,oBAAoB,wBAyP/B","file":"attribute.js","sourcesContent":["import type {\n TooltipPanelAttrs,\n TooltipRowAttrs,\n TooltipRowStyleAttrs,\n TooltipSymbolAttrs,\n TooltipTextAttrs\n} from '@visactor/vrender-components';\nimport type { IPadding, ITooltipActual } from '../../../../typings';\nimport type { ITooltipAttributes, ITooltipTextStyle } from '../interface';\nimport { isValid, maxInArray, normalizePadding } from '@visactor/vutils';\nimport { mergeSpec } from '../../../../util/spec/merge-spec';\nimport { normalizeLayoutPaddingSpec } from '../../../../util/space';\nimport { measureTooltipText } from './common';\nimport type { ITheme } from '../../../../theme';\nimport type { ITooltipSpec, ITooltipTextTheme, ITooltipTheme } from '../../../../component/tooltip';\nimport { token } from '../../../../theme/token';\n\nconst DEFAULT_TEXT_ATTRIBUTES: Partial<ITooltipTextStyle> = {\n fontFamily: token.fontFamily,\n spacing: 10,\n wordBreak: 'break-word'\n};\n\nexport function getTextAttributes(\n style: ITooltipTextTheme = {},\n globalTheme?: ITheme,\n defaultAttributes?: Partial<ITooltipTextStyle>\n): ITooltipTextStyle {\n const attrs: ITooltipTextStyle = {\n ...(defaultAttributes ?? DEFAULT_TEXT_ATTRIBUTES),\n fill: (style.fill ?? style.fontColor) as string,\n textAlign: style.textAlign,\n textBaseline: style.textBaseline,\n fontFamily: style.fontFamily ?? (globalTheme?.fontFamily as string),\n fontSize: style.fontSize as number,\n fontWeight: style.fontWeight,\n lineHeight: style.lineHeight as number,\n spacing: style.spacing,\n multiLine: style.multiLine,\n maxWidth: style.maxWidth,\n wordBreak: style.wordBreak,\n autoWidth: style.autoWidth\n };\n return attrs;\n}\n\nexport const getPanelAttributes = (style: ITooltipTheme['panel']): TooltipPanelAttrs => {\n const { backgroundColor, border, shadow } = style;\n const panelAttrs: TooltipPanelAttrs = {\n lineWidth: border?.width ?? 0,\n shadow: !!shadow\n };\n if (border?.color) {\n panelAttrs.stroke = border.color as string;\n }\n if (backgroundColor) {\n panelAttrs.fill = backgroundColor as string;\n }\n if (shadow) {\n panelAttrs.shadowColor = shadow.color as string;\n panelAttrs.shadowBlur = shadow.blur;\n panelAttrs.shadowOffsetX = shadow.x;\n panelAttrs.shadowOffsetY = shadow.y;\n panelAttrs.shadowSpread = shadow.spread;\n }\n const { radius } = border ?? {};\n if (isValid(radius)) {\n panelAttrs.cornerRadius = [radius, radius, radius, radius];\n }\n return panelAttrs;\n};\n\nexport const getTooltipAttributes = (\n actualTooltip: ITooltipActual,\n spec: ITooltipSpec,\n globalTheme: ITheme\n): ITooltipAttributes => {\n const { style = {}, enterable, transitionDuration } = spec;\n const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow: commonSpaceRow, maxContentHeight } = style;\n const padding = normalizePadding(panel.padding);\n const paddingSpec = normalizeLayoutPaddingSpec(panel.padding) as IPadding;\n\n const titleStyle = getTextAttributes(titleLabel, globalTheme);\n const keyStyle = getTextAttributes(keyLabel, globalTheme);\n const valueStyle = getTextAttributes(valueLabel, globalTheme);\n const shapeStyle: TooltipRowStyleAttrs['shape'] = {\n fill: true,\n size: shape?.size ?? 8,\n spacing: shape?.spacing ?? 6\n };\n\n const attributes: ITooltipAttributes = {\n panel: getPanelAttributes(panel),\n padding,\n\n title: {},\n content: [],\n\n titleStyle: {\n value: titleStyle,\n spaceRow: commonSpaceRow\n },\n contentStyle: {\n shape: shapeStyle,\n key: keyStyle,\n value: valueStyle,\n spaceRow: commonSpaceRow\n },\n hasContentShape: false,\n keyWidth: 0,\n valueWidth: 0,\n\n maxContentHeight,\n\n enterable,\n transitionDuration\n };\n\n const { title = {}, content = [] } = actualTooltip;\n\n let panelWidth = paddingSpec.left + paddingSpec.right;\n let panelHeight = paddingSpec.top + paddingSpec.bottom;\n /** dom tooltip 的高度。由于 canvas tooltip 不支持滚动条,dom tooltip 单独计算高度 */\n let panelDomHeight = paddingSpec.top + paddingSpec.bottom;\n\n // calculate content\n let contentMaxWidth = 0;\n // filter content\n const filteredContent = content.filter(item => {\n return (item.key || item.value) && item.visible !== false;\n });\n const hasContent = !!filteredContent.length;\n let maxKeyWidth = 0;\n let maxAdaptiveKeyWidth = 0;\n let maxValueWidth = 0;\n let maxShapeWidth = 0;\n\n if (hasContent) {\n const keyWidths: number[] = [];\n const adaptiveKeyWidths: number[] = [];\n const valueWidths: number[] = [];\n const shapeWidths: number[] = [];\n\n let contentHeight = 0;\n attributes.content = filteredContent.map((item, i) => {\n let itemHeight = 0;\n const {\n hasShape: actualHasShape,\n key: actualKey,\n shapeType: actualShapeType = '',\n shapeFill: actualShapeFill,\n shapeStroke: actualShapeStroke,\n shapeLineWidth: actualShapeLineWidth,\n shapeSize: actualShapeSize,\n value: actualValue,\n isKeyAdaptive: actualIsKeyAdaptive,\n spaceRow: actualSpaceRow,\n keyStyle: actualKeyStyle,\n valueStyle: actualValueStyle,\n shapeHollow: actualShapeHollow,\n // 弃用的属性,做下兼容\n shapeColor: actualShapeColor\n } = item;\n const itemAttrs: TooltipRowAttrs = { height: 0, spaceRow: actualSpaceRow ?? commonSpaceRow };\n if (isValid(actualKey)) {\n const itemKeyStyle: ITooltipTextStyle = mergeSpec(\n {},\n keyStyle,\n getTextAttributes(actualKeyStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualKey, itemKeyStyle);\n itemAttrs.key = {\n width,\n height,\n ...itemKeyStyle,\n text\n };\n if (!actualIsKeyAdaptive) {\n keyWidths.push(width);\n } else {\n adaptiveKeyWidths.push(width);\n }\n itemHeight = Math.max(itemHeight, height);\n }\n if (isValid(actualValue)) {\n const itemValueStyle: ITooltipTextStyle = mergeSpec(\n {},\n valueStyle,\n getTextAttributes(actualValueStyle, undefined, {})\n );\n const { width, height, text } = measureTooltipText(actualValue, itemValueStyle);\n itemAttrs.value = {\n width,\n height,\n ...itemValueStyle,\n text\n };\n valueWidths.push(width);\n itemHeight = Math.max(itemHeight, height);\n }\n if (actualHasShape) {\n const shape: TooltipSymbolAttrs = {\n visible: true,\n symbolType: actualShapeType\n };\n const adaptiveShapeFill = actualShapeFill ?? actualShapeColor;\n if (actualShapeHollow) {\n shape.stroke = adaptiveShapeFill;\n } else {\n shape.fill = adaptiveShapeFill;\n }\n shape.stroke = actualShapeStroke ?? adaptiveShapeFill;\n shape.lineWidth = actualShapeLineWidth;\n itemAttrs.shape = shape;\n\n const shapeWidth = actualShapeSize ?? shapeStyle.size;\n itemHeight = Math.max(shapeWidth, itemHeight);\n shapeWidths.push(shapeWidth);\n } else {\n itemAttrs.shape = { visible: false };\n }\n\n itemAttrs.height = itemHeight;\n contentHeight += itemHeight;\n if (i < filteredContent.length - 1) {\n contentHeight += itemAttrs.spaceRow;\n }\n\n return itemAttrs;\n });\n panelHeight += contentHeight;\n panelDomHeight += Math.min(contentHeight, maxContentHeight ?? Infinity);\n\n maxKeyWidth = keyWidths.length ? maxInArray(keyWidths) : 0; // name 需要对齐\n maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? maxInArray(adaptiveKeyWidths) : 0;\n maxValueWidth = valueWidths.length ? maxInArray(valueWidths) : 0; // value 需要对齐\n maxShapeWidth = shapeWidths.length ? maxInArray(shapeWidths) + shapeStyle.spacing : 0; // shape 列宽度\n contentMaxWidth = Math.max(\n maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing,\n maxShapeWidth + maxAdaptiveKeyWidth,\n contentMaxWidth\n );\n attributes.hasContentShape = !!shapeWidths.length;\n attributes.keyWidth = maxKeyWidth;\n attributes.valueWidth = maxValueWidth;\n }\n\n // calculate title\n let titleMaxWidth = 0;\n let titleMaxHeight = 0;\n let titleHeightWithSpace = 0;\n const {\n visible: actualTitleVisible = true,\n value: actualTitleValue = '',\n valueStyle: actualTitleValueStyle,\n spaceRow: actualTitleSpaceRow\n } = title;\n attributes.title.visible = actualTitleVisible;\n attributes.title.spaceRow = actualTitleSpaceRow ?? commonSpaceRow;\n\n let titleValueStyle: ITooltipTextStyle = {};\n // 当前是否处于自适应宽度模式\n const isAutoWidthMode = () => titleValueStyle.autoWidth && titleValueStyle.multiLine !== false;\n if (actualTitleVisible) {\n titleValueStyle = mergeSpec({}, titleStyle, getTextAttributes(actualTitleValueStyle, undefined, {}));\n // 标题默认优化策略:如果 autoWidth 为 true,则宽度默认跟随 content 宽度并开启自动换行\n if (isAutoWidthMode()) {\n titleValueStyle.multiLine = titleValueStyle.multiLine ?? true;\n titleValueStyle.maxWidth = titleValueStyle.maxWidth ?? (hasContent ? Math.ceil(contentMaxWidth) : undefined);\n }\n\n const { text, width, height } = measureTooltipText(actualTitleValue, titleValueStyle);\n attributes.title.value = {\n width: isAutoWidthMode() ? Math.min(width, titleValueStyle.maxWidth ?? Number.MAX_VALUE) : width,\n height,\n ...titleValueStyle,\n text\n };\n titleMaxWidth = attributes.title.value.width;\n titleMaxHeight = attributes.title.value.height;\n\n titleHeightWithSpace = titleMaxHeight + (hasContent ? attributes.title.spaceRow : 0);\n }\n panelHeight += titleHeightWithSpace;\n panelDomHeight += titleHeightWithSpace;\n attributes.title.width = titleMaxWidth;\n attributes.title.height = titleMaxHeight;\n\n if (isAutoWidthMode()) {\n panelWidth += contentMaxWidth ? contentMaxWidth : titleMaxWidth;\n } else {\n panelWidth += Math.max(titleMaxWidth, contentMaxWidth);\n }\n\n // 处理 content 的自动宽度模式\n if (hasContent) {\n attributes.content.forEach(item => {\n const value = item.value as ITooltipTextStyle & TooltipTextAttrs;\n // 最后一列默认自适应宽度\n if (value && (value.autoWidth ?? true)) {\n value.width =\n panelWidth -\n paddingSpec.left -\n paddingSpec.right -\n maxShapeWidth -\n maxKeyWidth -\n keyStyle.spacing -\n valueStyle.spacing;\n //value.multiLine = true; multiLine 需要用户手动开启,不会自动开启\n if (!value.maxWidth) {\n value.maxWidth = Math.ceil(value.width);\n }\n attributes.valueWidth = Math.max(attributes.valueWidth, value.width);\n }\n });\n }\n\n attributes.panel.width = panelWidth;\n attributes.panel.height = panelHeight;\n attributes.panelDomHeight = panelDomHeight;\n return attributes;\n};\n"]}
@@ -36,6 +36,7 @@ export declare abstract class BaseSeries<T extends ISeriesSpec> extends BaseMode
36
36
  protected _rootMark: IGroupMark;
37
37
  getRootMark(): IGroupMark;
38
38
  protected _seriesMark: Maybe<IMark>;
39
+ getSeriesMark(): IMark;
39
40
  protected _layoutLevel: number;
40
41
  protected _rawData: DataView;
41
42
  getRawData(): DataView;
@@ -16,6 +16,9 @@ class BaseSeries extends base_model_1.BaseModel {
16
16
  getRootMark() {
17
17
  return this._rootMark;
18
18
  }
19
+ getSeriesMark() {
20
+ return this._seriesMark;
21
+ }
19
22
  getRawData() {
20
23
  return this._rawData;
21
24
  }