@visactor/vchart 2.0.11-alpha.6 → 2.0.11

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 (62) hide show
  1. package/build/es5/index.js +2 -2
  2. package/build/index.es.js +377 -141
  3. package/build/index.js +377 -141
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/component/axis/cartesian/axis.d.ts +6 -0
  7. package/cjs/component/axis/cartesian/axis.js +3 -0
  8. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  9. package/cjs/component/crosshair/base.js +11 -3
  10. package/cjs/component/crosshair/base.js.map +1 -1
  11. package/cjs/component/label/util.d.ts +6 -1
  12. package/cjs/component/label/util.js +34 -3
  13. package/cjs/component/label/util.js.map +1 -1
  14. package/cjs/component/tooltip/tooltip.d.ts +2 -1
  15. package/cjs/component/tooltip/tooltip.js +20 -12
  16. package/cjs/component/tooltip/tooltip.js.map +1 -1
  17. package/cjs/core/index.d.ts +1 -1
  18. package/cjs/core/index.js +1 -1
  19. package/cjs/core/index.js.map +1 -1
  20. package/cjs/data/transforms/box-plot.d.ts +1 -0
  21. package/cjs/data/transforms/box-plot.js +3 -2
  22. package/cjs/data/transforms/box-plot.js.map +1 -1
  23. package/cjs/mark/box-plot.d.ts +1 -0
  24. package/cjs/mark/box-plot.js +20 -1
  25. package/cjs/mark/box-plot.js.map +1 -1
  26. package/cjs/series/box-plot/box-plot-transformer.d.ts +5 -0
  27. package/cjs/series/box-plot/box-plot-transformer.js +16 -0
  28. package/cjs/series/box-plot/box-plot-transformer.js.map +1 -0
  29. package/cjs/series/box-plot/box-plot.d.ts +9 -4
  30. package/cjs/series/box-plot/box-plot.js +25 -16
  31. package/cjs/series/box-plot/box-plot.js.map +1 -1
  32. package/cjs/typings/visual.d.ts +15 -6
  33. package/cjs/typings/visual.js.map +1 -1
  34. package/esm/component/axis/cartesian/axis.d.ts +6 -0
  35. package/esm/component/axis/cartesian/axis.js +3 -0
  36. package/esm/component/axis/cartesian/axis.js.map +1 -1
  37. package/esm/component/crosshair/base.js +11 -3
  38. package/esm/component/crosshair/base.js.map +1 -1
  39. package/esm/component/label/util.d.ts +6 -1
  40. package/esm/component/label/util.js +31 -1
  41. package/esm/component/label/util.js.map +1 -1
  42. package/esm/component/tooltip/tooltip.d.ts +2 -1
  43. package/esm/component/tooltip/tooltip.js +18 -12
  44. package/esm/component/tooltip/tooltip.js.map +1 -1
  45. package/esm/core/index.d.ts +1 -1
  46. package/esm/core/index.js +1 -1
  47. package/esm/core/index.js.map +1 -1
  48. package/esm/data/transforms/box-plot.d.ts +1 -0
  49. package/esm/data/transforms/box-plot.js +3 -3
  50. package/esm/data/transforms/box-plot.js.map +1 -1
  51. package/esm/mark/box-plot.d.ts +1 -0
  52. package/esm/mark/box-plot.js +20 -1
  53. package/esm/mark/box-plot.js.map +1 -1
  54. package/esm/series/box-plot/box-plot-transformer.d.ts +5 -0
  55. package/esm/series/box-plot/box-plot-transformer.js +8 -0
  56. package/esm/series/box-plot/box-plot-transformer.js.map +1 -0
  57. package/esm/series/box-plot/box-plot.d.ts +9 -4
  58. package/esm/series/box-plot/box-plot.js +26 -15
  59. package/esm/series/box-plot/box-plot.js.map +1 -1
  60. package/esm/typings/visual.d.ts +15 -6
  61. package/esm/typings/visual.js.map +1 -1
  62. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/component/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASpF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,mBA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,SAAS,CAAC;AA+pB7B,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC","file":"tooltip.js","sourcesContent":["import { ComponentTypeEnum } from '../interface/type';\nimport type { IModelRenderOption } from '../../model/interface';\nimport type { IRegion } from '../../region/interface';\nimport { BaseComponent } from '../base/base-component';\nimport type { BaseEventParams, EventCallback, EventQuery, EventType } from '../../event/interface';\nimport type { ITooltipHandler, TooltipActiveType } from '../../typings/tooltip';\nimport type { Datum, IPoint, IShowTooltipOption } from '../../typings';\nimport { isMobileLikeMode, isTrueBrowser, isMiniAppLikeMode } from '../../util/env';\nimport type {\n ITooltip,\n ITooltipActiveTypeAsKeys,\n ITooltipSpec,\n TooltipHandlerParams,\n TotalMouseEventData\n} from './interface';\nimport { TooltipResult } from './interface/common';\nimport { showTooltip } from './utils/show-tooltip';\nimport { isEmptyPos } from './utils/common';\nimport { isSameDimensionInfo } from '../../event/events/dimension/util/common';\nimport { ChartEvent, Event_Source_Type } from '../../constant/event';\nimport type {\n DimensionTooltipInfo,\n GroupTooltipInfo,\n ITooltipProcessor,\n MarkTooltipInfo,\n TooltipInfo\n} from './processor/interface';\nimport { isDimensionInfo, isMarkInfo } from './processor/util';\n// eslint-disable-next-line no-duplicate-imports\nimport { isValid, isNil, array, isNumber, throttle, isObject } from '@visactor/vutils';\nimport { VChart } from '../../core/vchart';\nimport type { TooltipEventParams } from './interface/event';\nimport { Factory } from '../../core/factory';\nimport type { IGraphic } from '@visactor/vrender-core';\nimport { TooltipSpecTransformer } from './tooltip-transformer';\nimport { error } from '../../util';\nimport { DEFAULT_SHOW_DELAY, TooltipHandlerType, TooltipType } from './constant';\nimport { tooltip } from '../../theme/builtin/common/component/tooltip';\n\ntype EventHandlerList = {\n eventType: EventType;\n handler: any;\n}[];\n\nexport class Tooltip extends BaseComponent<any> implements ITooltip {\n protected layoutZIndex: number = 1;\n static type = ComponentTypeEnum.tooltip;\n static readonly transformerConstructor = TooltipSpecTransformer;\n type = ComponentTypeEnum.tooltip;\n name: string = ComponentTypeEnum.tooltip;\n readonly transformerConstructor = TooltipSpecTransformer;\n\n static readonly builtInTheme = {\n tooltip\n };\n\n static specKey = 'tooltip';\n specKey = 'tooltip';\n\n layoutType: 'none' = 'none';\n private _hideTimer?: number;\n private _outTimer?: number;\n private _showTimer?: number;\n private _needInitEventOfTooltip?: boolean;\n private _enterable: boolean;\n private _isReleased: boolean = false;\n /**\n * 是否正在浏览tooltip内容\n */\n private _isEnterTooltip: boolean;\n protected declare _spec: ITooltipSpec;\n\n tooltipHandler?: ITooltipHandler;\n\n processor: ITooltipActiveTypeAsKeys<\n ITooltipProcessor<MarkTooltipInfo>,\n ITooltipProcessor<DimensionTooltipInfo>,\n ITooltipProcessor<GroupTooltipInfo>\n >;\n\n private _alwaysShow: boolean = false;\n\n private _cacheInfo: TooltipInfo | undefined;\n private _cacheParams: BaseEventParams | undefined;\n private _cacheActiveType: TooltipActiveType | undefined;\n private _cacheEnterableRect: { width: number; height: number };\n\n private _eventList: EventHandlerList = [];\n\n protected _isTooltipShown: boolean = false;\n\n protected _clickLock: boolean = false;\n private _handleMouseMove: (params: BaseEventParams) => void;\n\n /** 当前是否正在显示 tooltip */\n isTooltipShown() {\n return this._isTooltipShown;\n }\n\n protected _registerEvent() {\n /* do nothing */\n }\n protected _releaseEvent() {\n /* do nothing */\n }\n onLayoutEnd() {\n /* do nothing */\n }\n\n created() {\n super.created();\n this._regions = this._option.getAllRegions();\n // event\n this._initEvent();\n }\n\n release() {\n super.release();\n this._isReleased = true;\n if (this._hideTimer) {\n clearTimeout(this._hideTimer);\n }\n\n this._eventList.forEach(({ eventType, handler }) => {\n this.event.off(eventType, handler);\n });\n this._eventList = [];\n this.tooltipHandler?.release?.();\n this._isTooltipShown = false;\n }\n\n beforeRelease() {\n // 触发事件\n this.event.emit(ChartEvent.tooltipHide, {\n tooltip: this,\n chart: this.getChart()\n } as unknown as TooltipEventParams);\n this.event.emit(ChartEvent.tooltipRelease, {\n tooltip: this,\n chart: this.getChart()\n } as unknown as TooltipEventParams);\n }\n\n protected _initHandler() {\n const renderMode = this._spec.renderMode ?? 'html';\n\n const userTooltipHandler = this._option.globalInstance.getTooltipHandlerByUser();\n if (userTooltipHandler) {\n this.tooltipHandler = userTooltipHandler;\n this._enterable = false;\n } else {\n // 构造内部默认 handler\n const type = renderMode === 'canvas' ? TooltipHandlerType.canvas : TooltipHandlerType.dom;\n const handlerConstructor = Factory.getComponentPluginInType(type);\n if (!handlerConstructor) {\n error('Can not find tooltip handler: ' + type);\n }\n const handler = new handlerConstructor();\n handler.name = `${this._spec.className}-${this._option.globalInstance.id ?? 0}-${this.getSpecIndex()}`;\n this.pluginService?.load([handler]);\n\n this.tooltipHandler = handler as unknown as ITooltipHandler;\n\n if (this._spec.enterable && renderMode === 'html' && this.tooltipHandler) {\n this._enterable = true;\n this._needInitEventOfTooltip = true;\n } else {\n this._enterable = false;\n }\n }\n }\n\n protected _initEventOfTooltipContent() {\n if (!this._needInitEventOfTooltip) {\n return;\n }\n\n const container = this.tooltipHandler.getRootDom?.();\n\n if (container) {\n container.addEventListener('pointerenter', () => {\n if (!this._enterable) {\n return;\n }\n this._isEnterTooltip = true;\n\n const rect = container.getBoundingClientRect?.();\n if (rect) {\n this._cacheEnterableRect = { width: rect.width, height: rect.height };\n }\n if (this._outTimer) {\n clearTimeout(this._outTimer);\n this._outTimer = null;\n }\n\n if (this._showTimer) {\n clearTimeout(this._showTimer);\n this._showTimer = null;\n }\n });\n\n container.addEventListener('pointerleave', () => {\n if (!this._enterable) {\n return;\n }\n this._isEnterTooltip = false;\n\n if (this._spec.triggerOff === 'none') {\n return;\n }\n\n if (this._cacheEnterableRect) {\n const newRect = container.getBoundingClientRect?.();\n\n /**\n * 这里需要比对width,height,是防止用户在进入到tooltip 的时候做了一些操作,\n * 导致tooltip的尺寸发生变更,这种情况一般不需要隐藏tooltip\n */\n if (\n newRect &&\n Object.keys(this._cacheEnterableRect).every(\n k => (this._cacheEnterableRect as any)[k] === (newRect as any)[k]\n )\n ) {\n this._cacheEnterableRect = null;\n this._outTimer = setTimeout(\n this.hideTooltip,\n this._spec?.showDelay ?? DEFAULT_SHOW_DELAY\n ) as unknown as number;\n }\n }\n });\n\n this._needInitEventOfTooltip = false;\n }\n }\n\n protected _initProcessor() {\n // 初始化 tooltip 类型\n const activeType = this._spec.activeType;\n\n this.processor = {};\n\n (activeType as TooltipActiveType[]).forEach(type => {\n const instance = Factory.createTooltipProcessor(type, this);\n\n if (instance) {\n (this.processor as any)[type] = instance;\n }\n });\n }\n\n protected _initEvent() {\n if (this._option.disableTriggerEvent) {\n return;\n }\n const trigger = array(this._spec.trigger ?? 'hover');\n const triggerOff = array(this._spec.triggerOff);\n const mode = this._option.mode;\n\n trigger.forEach(triggerType => {\n if (triggerType === 'hover') {\n this._handleMouseMove = this._throttle(this._getMouseMoveHandler(false));\n\n this._mountEvent('pointermove', { source: 'chart' }, this._handleMouseMove);\n // 移动端的点按 + 滑动触发\n if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {\n this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));\n this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));\n }\n this._mountEvent('pointerleave', { source: 'chart' }, this._getMouseOutHandler(false));\n } else if (triggerType === 'click') {\n this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));\n this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));\n } else if (isObject(triggerType)) {\n this._mountEvent(\n triggerType.eventType,\n { source: triggerType.source ?? 'chart', consume: triggerType.consume },\n this._getMouseMoveHandler(true)\n );\n }\n });\n const offEvents = triggerOff.filter(entry => isObject(entry));\n\n offEvents.forEach(entry => {\n this._mountEvent(\n (entry as any).eventType,\n { source: (entry as any).source ?? 'chart', consume: (entry as any).consume },\n this._getMouseOutHandler((entry as any).checkOutside ?? false)\n );\n });\n\n if (!trigger.includes('click') && this._spec.lockAfterClick) {\n this._mountEvent('pointertap', { source: 'chart' }, this._handleClickToLock);\n }\n }\n\n protected _throttle(callback: (...args: any[]) => any): (...args: any[]) => any {\n let wait: number;\n if (isNumber(this._spec.throttleInterval)) {\n wait = this._spec.throttleInterval;\n } else {\n if (this._spec.renderMode !== 'html' || !this._spec.transitionDuration) {\n wait = 10;\n } else {\n wait = 50;\n }\n }\n return throttle(callback, wait);\n }\n\n protected _mountEvent = (eType: EventType, query: EventQuery, callback: EventCallback<any>) => {\n this.event.on(eType, query, callback);\n this._eventList.push({\n eventType: eType,\n handler: callback\n });\n };\n\n protected _handleClickToLock = (params: BaseEventParams) => {\n if (this._clickLock) {\n this._handleChartMouseOut(params);\n this._clickLock = false;\n } else {\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n return;\n }\n this._clickLock = true;\n }\n };\n\n protected _getMouseOutHandler = (needPointerDetection?: boolean) => (params: BaseEventParams) => {\n if (this._isReleased) {\n return;\n }\n if (this._alwaysShow || this._clickLock) {\n return;\n }\n\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n return;\n }\n\n const browserEnv = isTrueBrowser(this._option?.mode);\n const { clientX, clientY } = params.event as MouseEvent;\n\n // 当 enterable 为 true,同时鼠标移入 tooltip 时 pointerleave 事件也会触发,所以这里做一个判断\n\n // 判断鼠标是否在图表范围内\n if (browserEnv && needPointerDetection && this._isPointerInChart({ x: clientX, y: clientY })) {\n return;\n }\n\n if (this._enterable) {\n this._outTimer = setTimeout(() => {\n this._handleChartMouseOut(params);\n }, this._spec?.showDelay ?? DEFAULT_SHOW_DELAY) as unknown as number;\n } else {\n this._handleChartMouseOut(params);\n }\n };\n\n protected _handleChartMouseOut = (params?: BaseEventParams) => {\n if (this._alwaysShow || this._isReleased || this._isEnterTooltip) {\n return;\n }\n\n if (this._spec.triggerOff !== 'none') {\n this._hideTooltipByHandler({\n ...(params as any),\n tooltip: this\n });\n\n if (this._handleMouseMove && (this._handleMouseMove as any).cancel) {\n // 防止因为throttle,mousemove事件又触发了一遍,导致 tooltip 隐藏失败\n (this._handleMouseMove as any).cancel();\n }\n this._cacheEnterableRect = null;\n this._cacheInfo = undefined;\n this._cacheParams = undefined;\n this._cacheActiveType = undefined;\n }\n };\n\n protected _getMouseMoveHandler = (isClick: boolean) => (params: BaseEventParams) => {\n if (this._isReleased || this._isEnterTooltip) {\n return;\n }\n if (this._outTimer) {\n clearTimeout(this._outTimer);\n this._outTimer = null;\n }\n\n if (!this.tooltipHandler) {\n this._initHandler();\n }\n\n if (!this.processor) {\n this._initProcessor();\n }\n\n if (this._alwaysShow) {\n return;\n }\n\n if (this._clickLock) {\n if (isClick) {\n this._handleChartMouseOut(params);\n this._clickLock = false;\n }\n return;\n }\n\n if (!isClick && this._enterable && this.tooltipHandler?.isTooltipShown?.()) {\n if (this._showTimer) {\n clearTimeout(this._showTimer);\n }\n\n this._showTimer = setTimeout(() => {\n this._handleChartMouseMove(params, isClick);\n }, this._spec?.showDelay ?? DEFAULT_SHOW_DELAY) as unknown as number;\n } else {\n this._handleChartMouseMove(params, isClick);\n }\n };\n\n protected _handleChartMouseMove = (params: BaseEventParams, isClick: boolean) => {\n if (this._isReleased) {\n return;\n }\n /* 获取 tooltip 原始数据 */\n const mouseEventData = this._getMouseEventData(params);\n const {\n tooltipInfo: { dimension: dimensionInfo },\n ignore: { mark: ignoreMark }\n } = mouseEventData;\n\n /** tooltip 是否显示成功 */\n const success: ITooltipActiveTypeAsKeys<boolean, boolean, boolean> = {\n mark: false,\n dimension: false,\n group: false\n };\n\n const supportedTooltip = [TooltipType.group, TooltipType.mark, TooltipType.dimension];\n\n for (let i = 0, len = supportedTooltip.length; i < len; i++) {\n const type = supportedTooltip[i];\n const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;\n\n if (res) {\n success[type] = true;\n break;\n }\n }\n\n /* 如果不是常规情况,进行一些特殊情况tooltip处理 */\n if (Object.values(success).every(val => !val) && !isEmptyPos(params)) {\n // 用户手动配置ignore,则继续显示缓存tooltip\n if (ignoreMark && isMarkInfo(this._cacheInfo)) {\n success.mark = this._showTooltipByMouseEvent('mark', mouseEventData, params, isClick, true);\n } else if (isValid(dimensionInfo)) {\n // 用户没有手动配置ignore的话,默认显示dimension tooltip\n success.dimension = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);\n }\n }\n\n /* 如果还是不应该显示tooltip,则隐藏上一次tooltip */\n if (!success.mark && !success.group && (!success.dimension || isNil(dimensionInfo))) {\n this._handleChartMouseOut(params);\n } else {\n this._initEventOfTooltipContent();\n }\n };\n\n /**\n * 通过鼠标事件触发 tooltip,返回是否成功\n * @param activeType tooltip 类型\n * @param mouseEventData tooltip 相关数据\n * @param params 事件参数\n * @param useCache 是否直接显示缓存 tooltip\n * @returns 是否成功执行\n */\n protected _showTooltipByMouseEvent = (\n activeType: TooltipActiveType,\n mouseEventData: TotalMouseEventData,\n params: BaseEventParams,\n isClick: boolean,\n useCache?: boolean\n ): boolean => {\n if (this._option?.componentShowContent) {\n // 全局关闭 tooltip\n if (this._option.componentShowContent.tooltip === false) {\n return false;\n }\n // 单独关闭 tooltip\n if (\n isObject(this._option.componentShowContent.tooltip) &&\n this._option.componentShowContent.tooltip[activeType] === false\n ) {\n return false;\n }\n }\n\n const processor = this.processor[activeType];\n // 判断是否应该触发 tooltip\n if (!processor.shouldHandleTooltip(params, mouseEventData.tooltipInfo[activeType])) {\n return false;\n }\n if (this._hideTimer) {\n clearTimeout(this._hideTimer);\n }\n\n let success: boolean;\n\n if (useCache) {\n // 直接显示缓存 tooltip\n success = !processor.showTooltip(this._cacheInfo as any, params, true);\n } else {\n const tooltipInfo = mouseEventData.tooltipInfo[activeType];\n const isSameAsCache = this._isSameAsCache(tooltipInfo, params, activeType);\n\n success = !processor.showTooltip(tooltipInfo as any, params, isSameAsCache);\n\n if (success) {\n // 成功显示 tooltip,则更新缓存\n this._cacheInfo = tooltipInfo;\n this._cacheParams = params;\n this._cacheActiveType = activeType;\n }\n }\n if (success) {\n this._isTooltipShown = true;\n if (isClick && this._spec.lockAfterClick && !this._clickLock) {\n this._clickLock = true;\n } else if (Number.isFinite(this._spec.hideTimer)) {\n // hover 事件,设置默认的定时器,避免out事件不触发的问题\n this._hideTimer = setTimeout(() => {\n this._handleChartMouseOut();\n }, this._spec.hideTimer as number) as unknown as number;\n }\n }\n // 全局唯一 tooltip\n const vchart = this._option?.globalInstance;\n if (success && VChart.globalConfig.uniqueTooltip && vchart) {\n VChart.hideTooltip(vchart.id);\n }\n return success;\n };\n\n protected _getMouseEventData = (params: BaseEventParams): TotalMouseEventData => {\n const result: TotalMouseEventData = {\n tooltipInfo: {},\n ignore: {}\n };\n\n Object.keys(this.processor).forEach(activeType => {\n const { tooltipInfo, ignore } = this.processor[activeType as TooltipActiveType].getMouseEventData(params);\n result.tooltipInfo[activeType as TooltipActiveType] = tooltipInfo as any;\n result.ignore[activeType as TooltipActiveType] = ignore;\n });\n return result;\n };\n\n protected _hideTooltipByHandler = (params: TooltipHandlerParams): TooltipResult => {\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n // 如果当前 tooltip 未显示,则提前退出\n return TooltipResult.success;\n }\n\n // 触发事件\n this.event.emit(ChartEvent.tooltipHide, {\n ...params,\n source: Event_Source_Type.chart, // 统一 event 的来源\n tooltip: this\n });\n\n // 删除缓存\n Object.values(this.processor).forEach((processor: ITooltipProcessor<TooltipInfo>) => {\n processor.clearCache();\n });\n\n // 隐藏 tooltip\n const handler = this._spec.handler ?? this.tooltipHandler;\n\n if (handler.hideTooltip) {\n const result = handler.hideTooltip.call(handler, params);\n if (!result) {\n this._isTooltipShown = false;\n }\n return result;\n }\n return TooltipResult.failed;\n };\n\n reInit(spec?: any) {\n super.reInit(spec);\n\n if (this.tooltipHandler) {\n const renderMode = this._spec.renderMode ?? 'html';\n const newEnterable = this._spec.enterable && renderMode === 'html';\n\n if (newEnterable && !this._enterable) {\n this._needInitEventOfTooltip = true;\n }\n this._enterable = newEnterable;\n\n this.tooltipHandler.reInit?.();\n } else {\n this._initHandler();\n }\n }\n\n showTooltip(datum: Datum, options: IShowTooltipOption) {\n if (!this.tooltipHandler) {\n this._initHandler();\n }\n\n if (!this.processor) {\n this._initProcessor();\n }\n\n if (!this.tooltipHandler?.showTooltip) {\n return false;\n }\n\n const result = showTooltip(datum, options, this);\n if (result !== 'none') {\n this._alwaysShow = !!options?.alwaysShow;\n }\n return result;\n }\n\n /** 手动隐藏 tooltip,返回是否成功 */\n hideTooltip = (): boolean => {\n if (this._isReleased) {\n return false;\n }\n\n const params: TooltipHandlerParams = {\n changePositionOnly: false,\n tooltip: this,\n item: undefined,\n datum: undefined,\n source: Event_Source_Type.chart\n } as any;\n\n this._alwaysShow = false;\n return !this._hideTooltipByHandler(params);\n };\n\n private _isSameAsCache(\n nextInfo?: TooltipInfo,\n nextParams?: BaseEventParams,\n nextActiveType?: TooltipActiveType\n ): boolean {\n if (nextActiveType !== this._cacheActiveType) {\n return false;\n }\n if (nextInfo === this._cacheInfo) {\n return true;\n }\n if (isNil(this._cacheInfo) || isNil(nextInfo)) {\n return false;\n }\n\n // 判断 tooltip 信息是否一致\n if (isDimensionInfo(nextInfo)) {\n if (isMarkInfo(this._cacheInfo)) {\n return false;\n }\n\n const prevInfo = this._cacheInfo as DimensionTooltipInfo;\n const isSameAsCacheInfo =\n prevInfo.length === nextInfo.length && nextInfo.every((info, i) => isSameDimensionInfo(info, prevInfo[i]));\n\n return isSameAsCacheInfo;\n }\n\n if (isDimensionInfo(this._cacheInfo)) {\n return false;\n }\n\n const prevInfo = this._cacheInfo as MarkTooltipInfo;\n const isSameAsCacheInfo =\n nextInfo?.datum === prevInfo.datum && nextInfo?.mark === prevInfo.mark && nextInfo?.series === prevInfo.series;\n if (!isSameAsCacheInfo) {\n return false;\n }\n\n // 判断事件触发信息是否一致\n const prevParams = this._cacheParams;\n if (isNil(prevParams) || isNil(nextParams)) {\n return false;\n }\n return (\n prevParams.mark === nextParams.mark &&\n prevParams.model === nextParams.model &&\n prevParams.datum === nextParams.datum\n );\n }\n\n private _isPointerInChart(point: IPoint): boolean {\n const globalInstance = this._option?.globalInstance;\n if (!globalInstance) {\n return false;\n }\n const chart = globalInstance.getChart();\n if (!chart) {\n return false;\n }\n const { x, y } = point;\n const canvas = globalInstance.getCanvas();\n const { x: chartX, y: chartY, width: chartWidth, height: chartHeight } = canvas.getBoundingClientRect();\n // 鼠标仍在图表范围内,则不处理\n if (x >= chartX && x <= chartX + chartWidth && y >= chartY && y <= chartY + chartHeight) {\n return true;\n }\n\n return false;\n }\n\n getVisible() {\n return this._spec.visible !== false;\n }\n}\n\nexport const registerTooltip = () => {\n Factory.registerComponent(Tooltip.type, Tooltip);\n};\n"]}
1
+ {"version":3,"sources":["../src/component/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASpF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAQrE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OA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,MAAM,CAAC,qBAAqB,EAAE,CAAC;QAExG,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,UAAU,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,WAAW,EAAE;YACvF,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC;IACtC,CAAC;;AAhsBM,YAAI,GAAG,iBAAiB,CAAC,OAAO,CAAC;AACxB,8BAAsB,GAAG,sBAAsB,CAAC;AAKhD,oBAAY,GAAG;IAC7B,OAAO;CACR,CAAC;AAEK,eAAO,GAAG,SAAS,CAAC;AAyrB7B,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC","file":"tooltip.js","sourcesContent":["import { ComponentTypeEnum } from '../interface/type';\nimport type { IModelRenderOption } from '../../model/interface';\nimport type { IRegion } from '../../region/interface';\nimport { BaseComponent } from '../base/base-component';\nimport type { BaseEventParams, EventCallback, EventQuery, EventType } from '../../event/interface';\nimport type { ITooltipHandler, TooltipActiveType } from '../../typings/tooltip';\nimport type { Datum, IPoint, IShowTooltipOption } from '../../typings';\nimport { isMobileLikeMode, isTrueBrowser, isMiniAppLikeMode } from '../../util/env';\nimport type {\n ITooltip,\n ITooltipActiveTypeAsKeys,\n ITooltipSpec,\n TooltipHandlerParams,\n TotalMouseEventData\n} from './interface';\nimport { TooltipResult } from './interface/common';\nimport { showTooltip } from './utils/show-tooltip';\nimport { isEmptyPos } from './utils/common';\nimport { isSameDimensionInfo } from '../../event/events/dimension/util/common';\nimport { ChartEvent, Event_Source_Type } from '../../constant/event';\nimport type {\n DimensionTooltipInfo,\n GroupTooltipInfo,\n ITooltipProcessor,\n MarkTooltipInfo,\n TooltipInfo\n} from './processor/interface';\nimport { isDimensionInfo, isMarkInfo } from './processor/util';\n// eslint-disable-next-line no-duplicate-imports\nimport { isValid, isNil, array, isNumber, throttle, isObject } from '@visactor/vutils';\nimport { VChart } from '../../core/vchart';\nimport type { TooltipEventParams } from './interface/event';\nimport { Factory } from '../../core/factory';\nimport type { IGraphic } from '@visactor/vrender-core';\nimport { TooltipSpecTransformer } from './tooltip-transformer';\nimport { error } from '../../util';\nimport { DEFAULT_SHOW_DELAY, TooltipHandlerType, TooltipType } from './constant';\nimport { tooltip } from '../../theme/builtin/common/component/tooltip';\n\ntype EventHandlerList = {\n eventType: EventType;\n handler: any;\n}[];\n\nexport class Tooltip extends BaseComponent<any> implements ITooltip {\n protected layoutZIndex: number = 1;\n static type = ComponentTypeEnum.tooltip;\n static readonly transformerConstructor = TooltipSpecTransformer;\n type = ComponentTypeEnum.tooltip;\n name: string = ComponentTypeEnum.tooltip;\n readonly transformerConstructor = TooltipSpecTransformer;\n\n static readonly builtInTheme = {\n tooltip\n };\n\n static specKey = 'tooltip';\n specKey = 'tooltip';\n\n layoutType: 'none' = 'none';\n private _hideTimer?: number;\n private _outTimer?: number;\n private _showTimer?: number;\n private _needInitEventOfTooltip?: boolean;\n private _enterable: boolean;\n private _isReleased: boolean = false;\n /**\n * 是否正在浏览tooltip内容\n */\n private _isEnterTooltip: boolean;\n protected declare _spec: ITooltipSpec;\n\n tooltipHandler?: ITooltipHandler;\n\n processor: ITooltipActiveTypeAsKeys<\n ITooltipProcessor<MarkTooltipInfo>,\n ITooltipProcessor<DimensionTooltipInfo>,\n ITooltipProcessor<GroupTooltipInfo>\n >;\n\n private _alwaysShow: boolean = false;\n\n private _cacheInfo: TooltipInfo | undefined;\n private _cacheParams: BaseEventParams | undefined;\n private _cacheActiveType: TooltipActiveType | undefined;\n private _cacheEnterableRect: { width: number; height: number };\n\n private _eventList: EventHandlerList = [];\n\n protected _isTooltipShown: boolean = false;\n\n protected _clickLock: boolean = false;\n private _handleMouseMove: (params: BaseEventParams) => void;\n\n /** 当前是否正在显示 tooltip */\n isTooltipShown() {\n return this._isTooltipShown;\n }\n\n protected _registerEvent() {\n /* do nothing */\n }\n protected _releaseEvent() {\n /* do nothing */\n }\n onLayoutEnd() {\n /* do nothing */\n }\n\n created() {\n super.created();\n this._regions = this._option.getAllRegions();\n // event\n this._initEvent();\n }\n\n release() {\n super.release();\n this._isReleased = true;\n if (this._hideTimer) {\n clearTimeout(this._hideTimer);\n }\n\n this._eventList.forEach(({ eventType, handler }) => {\n this.event.off(eventType, handler);\n });\n this._eventList = [];\n this.tooltipHandler?.release?.();\n this._isTooltipShown = false;\n }\n\n beforeRelease() {\n // 触发事件\n this.event.emit(ChartEvent.tooltipHide, {\n tooltip: this,\n chart: this.getChart()\n } as unknown as TooltipEventParams);\n this.event.emit(ChartEvent.tooltipRelease, {\n tooltip: this,\n chart: this.getChart()\n } as unknown as TooltipEventParams);\n }\n\n protected _initHandler() {\n const renderMode = this._spec.renderMode ?? 'html';\n\n const userTooltipHandler = this._option.globalInstance.getTooltipHandlerByUser();\n if (userTooltipHandler) {\n this.tooltipHandler = userTooltipHandler;\n this._enterable = false;\n } else {\n // 构造内部默认 handler\n const type = renderMode === 'canvas' ? TooltipHandlerType.canvas : TooltipHandlerType.dom;\n const handlerConstructor = Factory.getComponentPluginInType(type);\n if (!handlerConstructor) {\n error('Can not find tooltip handler: ' + type);\n }\n const handler = new handlerConstructor();\n handler.name = `${this._spec.className}-${this._option.globalInstance.id ?? 0}-${this.getSpecIndex()}`;\n this.pluginService?.load([handler]);\n\n this.tooltipHandler = handler as unknown as ITooltipHandler;\n\n if (this._spec.enterable && renderMode === 'html' && this.tooltipHandler) {\n this._enterable = true;\n this._needInitEventOfTooltip = true;\n } else {\n this._enterable = false;\n }\n }\n }\n\n protected _initEventOfTooltipContent() {\n if (!this._needInitEventOfTooltip) {\n return;\n }\n\n const container = this.tooltipHandler.getRootDom?.();\n\n if (container) {\n container.addEventListener('pointerenter', () => {\n if (!this._enterable) {\n return;\n }\n this._isEnterTooltip = true;\n\n const rect = container.getBoundingClientRect?.();\n if (rect) {\n this._cacheEnterableRect = { width: rect.width, height: rect.height };\n }\n if (this._outTimer) {\n clearTimeout(this._outTimer);\n this._outTimer = null;\n }\n\n if (this._showTimer) {\n clearTimeout(this._showTimer);\n this._showTimer = null;\n }\n });\n\n container.addEventListener('pointerleave', () => {\n if (!this._enterable) {\n return;\n }\n this._isEnterTooltip = false;\n\n if (this._spec.triggerOff === 'none') {\n return;\n }\n\n if (this._cacheEnterableRect) {\n const newRect = container.getBoundingClientRect?.();\n\n /**\n * 这里需要比对width,height,是防止用户在进入到tooltip 的时候做了一些操作,\n * 导致tooltip的尺寸发生变更,这种情况一般不需要隐藏tooltip\n */\n if (\n newRect &&\n Object.keys(this._cacheEnterableRect).every(\n k => (this._cacheEnterableRect as any)[k] === (newRect as any)[k]\n )\n ) {\n this._cacheEnterableRect = null;\n this._outTimer = setTimeout(\n this.hideTooltip,\n this._spec?.showDelay ?? DEFAULT_SHOW_DELAY\n ) as unknown as number;\n }\n }\n });\n\n this._needInitEventOfTooltip = false;\n }\n }\n\n protected _initProcessor() {\n // 初始化 tooltip 类型\n const activeType = this._spec.activeType;\n\n this.processor = {};\n\n (activeType as TooltipActiveType[]).forEach(type => {\n const instance = Factory.createTooltipProcessor(type, this);\n\n if (instance) {\n (this.processor as any)[type] = instance;\n }\n });\n }\n\n protected _initEvent() {\n if (this._option.disableTriggerEvent) {\n return;\n }\n const trigger = array(this._spec.trigger ?? 'hover');\n const triggerOff = array(this._spec.triggerOff);\n const mode = this._option.mode;\n\n trigger.forEach(triggerType => {\n if (triggerType === 'hover') {\n this._handleMouseMove = this._throttle(this._getMouseMoveHandler(false));\n\n this._mountEvent('pointermove', { source: 'chart' }, this._handleMouseMove);\n // 移动端的点按 + 滑动触发\n if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {\n this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));\n this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));\n }\n this._mountEvent('pointerleave', { source: 'chart' }, this._getMouseOutHandler(false));\n } else if (triggerType === 'click') {\n this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));\n this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));\n } else if (isObject(triggerType)) {\n this._mountEvent(\n triggerType.eventType,\n { source: triggerType.source ?? 'chart', consume: triggerType.consume },\n this._getMouseMoveHandler(true)\n );\n }\n });\n const offEvents = triggerOff.filter(entry => isObject(entry));\n\n offEvents.forEach(entry => {\n this._mountEvent(\n (entry as any).eventType,\n { source: (entry as any).source ?? 'chart', consume: (entry as any).consume },\n this._getMouseOutHandler((entry as any).checkOutside ?? false)\n );\n });\n\n if (!trigger.includes('click') && this._spec.lockAfterClick) {\n this._mountEvent('pointertap', { source: 'chart' }, this._handleClickToLock);\n }\n }\n\n protected _throttle(callback: (...args: any[]) => any): (...args: any[]) => any {\n let wait: number;\n if (isNumber(this._spec.throttleInterval)) {\n wait = this._spec.throttleInterval;\n } else {\n if (this._spec.renderMode !== 'html' || !this._spec.transitionDuration) {\n wait = 10;\n } else {\n wait = 50;\n }\n }\n return throttle(callback, wait);\n }\n\n protected _mountEvent = (eType: EventType, query: EventQuery, callback: EventCallback<any>) => {\n this.event.on(eType, query, callback);\n this._eventList.push({\n eventType: eType,\n handler: callback\n });\n };\n\n protected _handleClickToLock = (params: BaseEventParams) => {\n if (this._clickLock) {\n this._handleChartMouseOut(params);\n this._clickLock = false;\n } else {\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n return;\n }\n this._clickLock = true;\n }\n };\n\n protected _getMouseOutHandler = (needPointerDetection?: boolean) => (params: BaseEventParams) => {\n if (this._isReleased) {\n return;\n }\n if (this._alwaysShow || this._clickLock) {\n return;\n }\n\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n return;\n }\n\n const browserEnv = isTrueBrowser(this._option?.mode);\n const { clientX, clientY } = params.event as MouseEvent;\n\n // 当 enterable 为 true,同时鼠标移入 tooltip 时 pointerleave 事件也会触发,所以这里做一个判断\n\n // 判断鼠标是否在图表范围内\n if (browserEnv && needPointerDetection && this._isPointerInChart({ x: clientX, y: clientY })) {\n return;\n }\n\n if (this._enterable) {\n this._outTimer = setTimeout(() => {\n this._handleChartMouseOut(params);\n }, this._spec?.showDelay ?? DEFAULT_SHOW_DELAY) as unknown as number;\n } else {\n this._handleChartMouseOut(params);\n }\n };\n\n protected _handleChartMouseOut = (params?: BaseEventParams) => {\n if (\n this._cacheActiveType &&\n this._option?.componentShowContent &&\n (this._option.componentShowContent.tooltip === false ||\n (isObject(this._option.componentShowContent.tooltip) &&\n this._option.componentShowContent.tooltip[this._cacheActiveType] === false))\n ) {\n return;\n }\n if (this._alwaysShow || this._isReleased || this._isEnterTooltip) {\n return;\n }\n\n if (this._spec.triggerOff !== 'none') {\n this._hideTooltipByHandler({\n ...(params as any),\n tooltip: this\n });\n\n if (this._handleMouseMove && (this._handleMouseMove as any).cancel) {\n // 防止因为throttle,mousemove事件又触发了一遍,导致 tooltip 隐藏失败\n (this._handleMouseMove as any).cancel();\n }\n this._cacheEnterableRect = null;\n this._cacheInfo = undefined;\n this._cacheParams = undefined;\n this._cacheActiveType = undefined;\n }\n };\n\n protected _getMouseMoveHandler = (isClick: boolean) => (params: BaseEventParams) => {\n if (this._isReleased || this._isEnterTooltip) {\n return;\n }\n if (this._outTimer) {\n clearTimeout(this._outTimer);\n this._outTimer = null;\n }\n\n if (!this.tooltipHandler) {\n this._initHandler();\n }\n\n if (!this.processor) {\n this._initProcessor();\n }\n\n if (this._alwaysShow) {\n return;\n }\n\n if (this._clickLock) {\n if (isClick) {\n this._handleChartMouseOut(params);\n this._clickLock = false;\n }\n return;\n }\n\n if (!isClick && this._enterable && this.tooltipHandler?.isTooltipShown?.()) {\n if (this._showTimer) {\n clearTimeout(this._showTimer);\n }\n\n this._showTimer = setTimeout(() => {\n this._handleChartMouseMove(params, isClick);\n }, this._spec?.showDelay ?? DEFAULT_SHOW_DELAY) as unknown as number;\n } else {\n this._handleChartMouseMove(params, isClick);\n }\n };\n\n protected _handleChartMouseMove = (params: BaseEventParams, isClick: boolean) => {\n if (this._isReleased) {\n return;\n }\n /* 获取 tooltip 原始数据 */\n const mouseEventData = this._getMouseEventData(params);\n const {\n tooltipInfo: { dimension: dimensionInfo },\n ignore: { mark: ignoreMark }\n } = mouseEventData;\n\n /** tooltip 是否显示成功 */\n const success: ITooltipActiveTypeAsKeys<\n boolean | 'unShowByOption',\n boolean | 'unShowByOption',\n boolean | 'unShowByOption'\n > = {\n mark: false,\n dimension: false,\n group: false\n };\n\n const supportedTooltip = [TooltipType.group, TooltipType.mark, TooltipType.dimension];\n\n for (let i = 0, len = supportedTooltip.length; i < len; i++) {\n const type = supportedTooltip[i];\n const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;\n\n if (res === 'unShowByOption') {\n success[type] = 'unShowByOption';\n } else if (res) {\n success[type] = true;\n break;\n }\n }\n\n /* 如果不是常规情况,进行一些特殊情况tooltip处理 */\n if (Object.values(success).every(val => !val) && !isEmptyPos(params)) {\n // 用户手动配置ignore,则继续显示缓存tooltip\n if (ignoreMark && isMarkInfo(this._cacheInfo)) {\n success.mark = this._showTooltipByMouseEvent('mark', mouseEventData, params, isClick, true);\n } else if (isValid(dimensionInfo)) {\n // 用户没有手动配置ignore的话,默认显示dimension tooltip\n success.dimension = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);\n }\n }\n\n /* 如果还是不应该显示tooltip,则隐藏上一次tooltip */\n if (success.mark !== true && success.group !== true && (success.dimension !== true || isNil(dimensionInfo))) {\n // 如果 tooltip 类型都不是 'unShowByOption',则隐藏上一次 tooltip\n // 否则,不隐藏上一次 tooltip ,tooltip 不展示属于 'unShowByOption' 类型的情况\n if (!this._cacheActiveType || success[this._cacheActiveType as TooltipActiveType] !== 'unShowByOption') {\n this._handleChartMouseOut(params);\n }\n } else {\n this._initEventOfTooltipContent();\n }\n };\n\n protected _showContentByEvent(activeType: TooltipActiveType) {\n if (this._option?.componentShowContent) {\n // 全局关闭 tooltip\n if (this._option.componentShowContent.tooltip === false) {\n return false;\n }\n // 单独关闭 tooltip\n if (\n isObject(this._option.componentShowContent.tooltip) &&\n this._option.componentShowContent.tooltip[activeType] === false\n ) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * 通过鼠标事件触发 tooltip,返回是否成功\n * @param activeType tooltip 类型\n * @param mouseEventData tooltip 相关数据\n * @param params 事件参数\n * @param useCache 是否直接显示缓存 tooltip\n * @returns 是否成功执行\n */\n protected _showTooltipByMouseEvent = (\n activeType: TooltipActiveType,\n mouseEventData: TotalMouseEventData,\n params: BaseEventParams,\n isClick: boolean,\n useCache?: boolean\n ): boolean | 'unShowByOption' => {\n if (!this._showContentByEvent(activeType)) {\n return 'unShowByOption';\n }\n\n const processor = this.processor[activeType];\n // 判断是否应该触发 tooltip\n if (!processor.shouldHandleTooltip(params, mouseEventData.tooltipInfo[activeType])) {\n return false;\n }\n if (this._hideTimer) {\n clearTimeout(this._hideTimer);\n }\n\n let success: boolean;\n\n if (useCache) {\n // 直接显示缓存 tooltip\n success = !processor.showTooltip(this._cacheInfo as any, params, true);\n } else {\n const tooltipInfo = mouseEventData.tooltipInfo[activeType];\n const isSameAsCache = this._isSameAsCache(tooltipInfo, params, activeType);\n\n success = !processor.showTooltip(tooltipInfo as any, params, isSameAsCache);\n\n if (success) {\n // 成功显示 tooltip,则更新缓存\n this._cacheInfo = tooltipInfo;\n this._cacheParams = params;\n this._cacheActiveType = activeType;\n }\n }\n if (success) {\n this._isTooltipShown = true;\n if (isClick && this._spec.lockAfterClick && !this._clickLock) {\n this._clickLock = true;\n } else if (Number.isFinite(this._spec.hideTimer)) {\n // hover 事件,设置默认的定时器,避免out事件不触发的问题\n this._hideTimer = setTimeout(() => {\n this._handleChartMouseOut();\n }, this._spec.hideTimer as number) as unknown as number;\n }\n }\n // 全局唯一 tooltip\n const vchart = this._option?.globalInstance;\n if (success && VChart.globalConfig.uniqueTooltip && vchart) {\n VChart.hideTooltip(vchart.id);\n }\n return success;\n };\n\n protected _getMouseEventData = (params: BaseEventParams): TotalMouseEventData => {\n const result: TotalMouseEventData = {\n tooltipInfo: {},\n ignore: {}\n };\n\n Object.keys(this.processor).forEach(activeType => {\n const { tooltipInfo, ignore } = this.processor[activeType as TooltipActiveType].getMouseEventData(params);\n result.tooltipInfo[activeType as TooltipActiveType] = tooltipInfo as any;\n result.ignore[activeType as TooltipActiveType] = ignore;\n });\n return result;\n };\n\n protected _hideTooltipByHandler = (params: TooltipHandlerParams): TooltipResult => {\n if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {\n // 如果当前 tooltip 未显示,则提前退出\n return TooltipResult.success;\n }\n\n // 触发事件\n this.event.emit(ChartEvent.tooltipHide, {\n ...params,\n source: Event_Source_Type.chart, // 统一 event 的来源\n tooltip: this\n });\n\n // 删除缓存\n Object.values(this.processor).forEach((processor: ITooltipProcessor<TooltipInfo>) => {\n processor.clearCache();\n });\n\n // 隐藏 tooltip\n const handler = this._spec.handler ?? this.tooltipHandler;\n if (handler.hideTooltip) {\n const result = handler.hideTooltip.call(handler, params);\n if (!result) {\n this._isTooltipShown = false;\n }\n return result;\n }\n return TooltipResult.failed;\n };\n\n reInit(spec?: any) {\n super.reInit(spec);\n\n if (this.tooltipHandler) {\n const renderMode = this._spec.renderMode ?? 'html';\n const newEnterable = this._spec.enterable && renderMode === 'html';\n\n if (newEnterable && !this._enterable) {\n this._needInitEventOfTooltip = true;\n }\n this._enterable = newEnterable;\n\n this.tooltipHandler.reInit?.();\n } else {\n this._initHandler();\n }\n }\n\n showTooltip(datum: Datum, options: IShowTooltipOption) {\n if (!this.tooltipHandler) {\n this._initHandler();\n }\n\n if (!this.processor) {\n this._initProcessor();\n }\n\n if (!this.tooltipHandler?.showTooltip) {\n return false;\n }\n\n const result = showTooltip(datum, options, this);\n if (result !== 'none') {\n this._alwaysShow = !!options?.alwaysShow;\n this._cacheActiveType = result;\n }\n return result;\n }\n\n /** 手动隐藏 tooltip,返回是否成功 */\n hideTooltip = (): boolean => {\n if (this._isReleased) {\n return false;\n }\n\n const params: TooltipHandlerParams = {\n changePositionOnly: false,\n tooltip: this,\n item: undefined,\n datum: undefined,\n source: Event_Source_Type.chart\n } as any;\n\n this._alwaysShow = false;\n return !this._hideTooltipByHandler(params);\n };\n\n private _isSameAsCache(\n nextInfo?: TooltipInfo,\n nextParams?: BaseEventParams,\n nextActiveType?: TooltipActiveType\n ): boolean {\n if (nextActiveType !== this._cacheActiveType) {\n return false;\n }\n if (nextInfo === this._cacheInfo) {\n return true;\n }\n if (isNil(this._cacheInfo) || isNil(nextInfo)) {\n return false;\n }\n\n // 判断 tooltip 信息是否一致\n if (isDimensionInfo(nextInfo)) {\n if (isMarkInfo(this._cacheInfo)) {\n return false;\n }\n\n const prevInfo = this._cacheInfo as DimensionTooltipInfo;\n const isSameAsCacheInfo =\n prevInfo.length === nextInfo.length && nextInfo.every((info, i) => isSameDimensionInfo(info, prevInfo[i]));\n\n return isSameAsCacheInfo;\n }\n\n if (isDimensionInfo(this._cacheInfo)) {\n return false;\n }\n\n const prevInfo = this._cacheInfo as MarkTooltipInfo;\n const isSameAsCacheInfo =\n nextInfo?.datum === prevInfo.datum && nextInfo?.mark === prevInfo.mark && nextInfo?.series === prevInfo.series;\n if (!isSameAsCacheInfo) {\n return false;\n }\n\n // 判断事件触发信息是否一致\n const prevParams = this._cacheParams;\n if (isNil(prevParams) || isNil(nextParams)) {\n return false;\n }\n return (\n prevParams.mark === nextParams.mark &&\n prevParams.model === nextParams.model &&\n prevParams.datum === nextParams.datum\n );\n }\n\n private _isPointerInChart(point: IPoint): boolean {\n const globalInstance = this._option?.globalInstance;\n if (!globalInstance) {\n return false;\n }\n const chart = globalInstance.getChart();\n if (!chart) {\n return false;\n }\n const { x, y } = point;\n const canvas = globalInstance.getCanvas();\n const { x: chartX, y: chartY, width: chartWidth, height: chartHeight } = canvas.getBoundingClientRect();\n // 鼠标仍在图表范围内,则不处理\n if (x >= chartX && x <= chartX + chartWidth && y >= chartY && y <= chartY + chartHeight) {\n return true;\n }\n\n return false;\n }\n\n getVisible() {\n return this._spec.visible !== false;\n }\n}\n\nexport const registerTooltip = () => {\n Factory.registerComponent(Tooltip.type, Tooltip);\n};\n"]}
@@ -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 = "2.0.11-alpha.6";
4
+ export declare const version = "2.0.11";
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 = "2.0.11-alpha.6";
7
+ export const version = "2.0.11";
8
8
 
9
9
  export * from "../event/interface";
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,gBAAgB,CAAC;AAOxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,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,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,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 = \"2.0.11-alpha.6\";\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 '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\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} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\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,QAAQ,CAAC;AAOhC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAGlC,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,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGtE,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,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 = \"2.0.11\";\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 '../event/interface';\nexport * from '../theme/interface';\nexport * from '../model/interface';\n\nexport * from './interface';\nexport * from '../typings';\nexport type { IMarkGraphic, IGraphicContext } from '../mark/interface/';\n\n// some constants\nexport * from '../constant/base';\nexport * from '../constant/data';\nexport * from '../constant/layout';\nexport { AttributeLevel } from '../constant/attribute';\nexport { TransformLevel } from '../data/initialize';\nexport { STATE_VALUE_ENUM } from '../compile/mark/interface';\nexport { ChartEvent } from '../constant/event';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\nexport * from '../typings/visual';\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} from '@visactor/vrender-core';\nexport { ManualTicker, StreamLight } from '@visactor/vrender-animate';\n\n// utils\nexport * from '../util/space';\nexport { transformToGraphic } from '../util/style';\nexport { getSpecInfo } from '../component/util';\nexport { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';\nexport { lookup } from '../data/transforms/lookup';\nexport { warn } from '../util/debug';\nexport { measureText } from '../util/text';\n"]}
@@ -1,5 +1,6 @@
1
1
  export interface IBoxPlotOutlierOpt {
2
2
  dimensionField: string[];
3
3
  outliersField: string;
4
+ seriesField?: string;
4
5
  }
5
6
  export declare const foldOutlierData: (data: Array<DataView>, op: IBoxPlotOutlierOpt) => any;
@@ -1,9 +1,9 @@
1
- import { isArray } from "@visactor/vutils";
1
+ import { isArray, isValid } from "@visactor/vutils";
2
2
 
3
3
  import { BOX_PLOT_OUTLIER_VALUE_FIELD } from "../../constant/box-plot";
4
4
 
5
5
  export const foldOutlierData = (data, op) => {
6
- const result = [], {outliersField: outliersField, dimensionField: dimensionField} = op;
6
+ const result = [], {outliersField: outliersField, dimensionField: dimensionField, seriesField: seriesField} = op;
7
7
  return (data[0].latestData || []).forEach((d => {
8
8
  let outlierValues = d[outliersField];
9
9
  isArray(outlierValues) || (outlierValues = [ outlierValues ]), result.push(...outlierValues.map((v => {
@@ -12,7 +12,7 @@ export const foldOutlierData = (data, op) => {
12
12
  };
13
13
  return dimensionField.forEach((field => {
14
14
  resData[field] = d[field];
15
- })), resData;
15
+ })), isValid(seriesField) && (resData[seriesField] = d[seriesField]), resData;
16
16
  })));
17
17
  })), result;
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data/transforms/box-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAavE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,EAAsB,EAAE,EAAE;IAC/E,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;IAC7C,MAAM,UAAU,GAAI,IAAI,CAAC,CAAC,CAAS,CAAC,UAAU,IAAI,EAAE,CAAC;IACrD,UAAU,CAAC,OAAO,CAAC,CAAC,CAAQ,EAAE,EAAE;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC3B,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;SACjC;QACD,MAAM,CAAC,IAAI,CACT,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;YAC9B,MAAM,OAAO,GAAG;gBACd,CAAC,4BAA4B,CAAC,EAAE,CAAC;aAClC,CAAC;YACF,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","file":"box-plot.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { BOX_PLOT_OUTLIER_VALUE_FIELD } from '../../constant/box-plot';\nimport type { Datum } from '../../typings';\n\nexport interface IBoxPlotOutlierOpt {\n dimensionField: string[];\n outliersField: string;\n}\n/**\n * 将箱型图outlier数组展平\n * @param data\n * @param options\n * @returns\n */\nexport const foldOutlierData = (data: Array<DataView>, op: IBoxPlotOutlierOpt) => {\n const result: any = [];\n const { outliersField, dimensionField } = op;\n const latestData = (data[0] as any).latestData || [];\n latestData.forEach((d: Datum) => {\n let outlierValues = d[outliersField];\n if (!isArray(outlierValues)) {\n outlierValues = [outlierValues];\n }\n result.push(\n ...outlierValues.map((v: any) => {\n const resData = {\n [BOX_PLOT_OUTLIER_VALUE_FIELD]: v\n };\n dimensionField.forEach(field => {\n resData[field] = d[field];\n });\n return resData;\n })\n );\n });\n return result;\n};\n"]}
1
+ {"version":3,"sources":["../src/data/transforms/box-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAcvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,EAAsB,EAAE,EAAE;IAC/E,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;IAC1D,MAAM,UAAU,GAAI,IAAI,CAAC,CAAC,CAAS,CAAC,UAAU,IAAI,EAAE,CAAC;IAErD,UAAU,CAAC,OAAO,CAAC,CAAC,CAAQ,EAAE,EAAE;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC3B,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;SACjC;QACD,MAAM,CAAC,IAAI,CACT,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;YAC9B,MAAM,OAAO,GAAG;gBACd,CAAC,4BAA4B,CAAC,EAAE,CAAC;aAClC,CAAC;YACF,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC5B,OAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;YAEH,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE;gBACvB,OAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;aAChD;YAED,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","file":"box-plot.js","sourcesContent":["import { isArray, isValid } from '@visactor/vutils';\nimport { BOX_PLOT_OUTLIER_VALUE_FIELD } from '../../constant/box-plot';\nimport type { Datum } from '../../typings';\n\nexport interface IBoxPlotOutlierOpt {\n dimensionField: string[];\n outliersField: string;\n seriesField?: string;\n}\n/**\n * 将箱型图outlier数组展平\n * @param data\n * @param options\n * @returns\n */\nexport const foldOutlierData = (data: Array<DataView>, op: IBoxPlotOutlierOpt) => {\n const result: any = [];\n const { outliersField, dimensionField, seriesField } = op;\n const latestData = (data[0] as any).latestData || [];\n\n latestData.forEach((d: Datum) => {\n let outlierValues = d[outliersField];\n if (!isArray(outlierValues)) {\n outlierValues = [outlierValues];\n }\n result.push(\n ...outlierValues.map((v: any) => {\n const resData = {\n [BOX_PLOT_OUTLIER_VALUE_FIELD]: v\n };\n dimensionField.forEach(field => {\n (resData as any)[field] = d[field];\n });\n\n if (isValid(seriesField)) {\n (resData as any)[seriesField] = d[seriesField];\n }\n\n return resData;\n })\n );\n });\n return result;\n};\n"]}
@@ -13,6 +13,7 @@ export declare class BoxPlotMark extends GlyphMark<IBoxPlotMarkSpec, {
13
13
  direction?: 'horizontal' | 'vertical';
14
14
  shaftShape?: BoxPlotShaftShape;
15
15
  }): void;
16
+ setDataLabelType(): string;
16
17
  protected _getDefaultStyle(): IMarkStyle<IBoxPlotMarkSpec>;
17
18
  }
18
19
  export declare const registerBoxPlotMark: () => void;
@@ -138,7 +138,23 @@ export class BoxPlotMark extends GlyphMark {
138
138
  y: 0
139
139
  }
140
140
  }
141
- }, this._positionChannels = BOX_PLOT_CHANNELS, this._channelEncoder = null, this._positionEncoder = (glyphAttrs, datum, g) => {
141
+ }, this._positionChannels = BOX_PLOT_CHANNELS, this._channelEncoder = {
142
+ boxStroke: val => ({
143
+ box: {
144
+ stroke: val
145
+ }
146
+ }),
147
+ medianStroke: val => ({
148
+ median: {
149
+ stroke: val
150
+ }
151
+ }),
152
+ boxCornerRadius: val => ({
153
+ box: {
154
+ cornerRadius: val
155
+ }
156
+ })
157
+ }, this._positionEncoder = (glyphAttrs, datum, g) => {
142
158
  var _a;
143
159
  const {x: x = g.attribute.x, y: y = g.attribute.y, boxWidth: boxWidth = g.attribute.boxWidth, boxHeight: boxHeight = g.attribute.boxHeight, ruleWidth: ruleWidth = g.attribute.ruleWidth, ruleHeight: ruleHeight = g.attribute.ruleHeight, q1: q1 = g.attribute.q1, q3: q3 = g.attribute.q3, min: min = g.attribute.min, max: max = g.attribute.max, median: median = g.attribute.median, angle: angle} = glyphAttrs, isH = this._isHorizontal(), attributes = {};
144
160
  if (isH ? (attributes.box = {
@@ -224,6 +240,9 @@ export class BoxPlotMark extends GlyphMark {
224
240
  return attributes;
225
241
  });
226
242
  }
243
+ setDataLabelType() {
244
+ return "symbol";
245
+ }
227
246
  _getDefaultStyle() {
228
247
  return Object.assign(Object.assign({}, super._getDefaultStyle()), {
229
248
  lineWidth: 2,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/mark/box-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAA2C,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,qBAAqB,GAAG;IAC5B,GAAG;IACH,GAAG;IACH,aAAa;IACb,cAAc;IACd,WAAW;IACX,YAAY;IACZ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,QAAQ;IACR,OAAO;CACR,CAAC;AAEF,MAAM,iBAAiB,GAAG;IAC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ACf,YAAY,EAAE,CAAC;IACf,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC,CAAC","file":"box-plot.js","sourcesContent":["import { Factory } from './../core/factory';\nimport type { BoxPlotShaftShape, IBoxPlotMarkSpec } from '../typings/visual';\nimport type { IBoxPlotMark, IMarkStyle } from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkTypeEnum } from './interface/type';\nimport { createLine, createRect, type IGlyph, type ILineGraphicAttribute } from '@visactor/vrender-core';\nimport { GlyphMark, registerGlyphMark } from './glyph';\nimport type { Datum } from '../typings/common';\nimport { isValidNumber } from '@visactor/vutils';\nimport { registerLine, registerRect } from '@visactor/vrender-kits';\n\nconst BAR_BOX_PLOT_CHANNELS = [\n 'x',\n 'y',\n 'minMaxWidth',\n 'minMaxHeight',\n 'q1q3Width',\n 'q1q3Height',\n 'q1',\n 'q3',\n 'min',\n 'max',\n 'median',\n 'angle'\n];\n\nconst BOX_PLOT_CHANNELS = [\n 'x',\n 'y',\n 'boxWidth',\n 'boxHeight',\n 'ruleWidth',\n 'ruleHeight',\n 'q1',\n 'q3',\n 'min',\n 'max',\n 'median',\n 'angle'\n];\n\nexport class BoxPlotMark\n extends GlyphMark<IBoxPlotMarkSpec, { direction?: 'horizontal' | 'vertical'; shaftShape?: BoxPlotShaftShape }>\n implements IBoxPlotMark\n{\n static readonly type = MarkTypeEnum.boxPlot;\n readonly type = BoxPlotMark.type;\n\n protected _isHorizontal() {\n return this._glyphConfig && this._glyphConfig.direction === 'horizontal';\n }\n\n setGlyphConfig(cfg: { direction?: 'horizontal' | 'vertical'; shaftShape?: BoxPlotShaftShape }): void {\n super.setGlyphConfig(cfg);\n\n if (cfg.shaftShape === 'bar') {\n this._subMarks = {\n minMaxBox: {\n type: 'rect',\n defaultAttributes: {\n lineWidth: 0\n }\n },\n q1q3Box: {\n type: 'rect',\n defaultAttributes: {\n lineWidth: 0\n }\n },\n median: {\n type: 'line',\n defaultAttributes: { x: 0, y: 0 }\n }\n };\n this._positionChannels = BAR_BOX_PLOT_CHANNELS;\n this._channelEncoder = {\n minMaxFillOpacity: (val: number) => ({ minMaxBox: { fillOpacity: val } }),\n lineWidth: (val: number) => ({ minMaxBox: { lineWidth: 0 }, q1q3Box: { lineWidth: 0 } }),\n stroke: (val: number) => ({ minMaxBox: { stroke: false }, q1q3Box: { stroke: false } })\n };\n\n this._positionEncoder = (glyphAttrs: any, datum: Datum, g: IGlyph) => {\n const {\n x = g.attribute.x,\n y = g.attribute.y,\n minMaxWidth = (g.attribute as any).minMaxWidth,\n minMaxHeight = (g.attribute as any).minMaxHeight,\n q1q3Width = (g.attribute as any).q1q3Width,\n q1q3Height = (g.attribute as any).q1q3Height,\n q1 = (g.attribute as any).q1,\n q3 = (g.attribute as any).q3,\n min = (g.attribute as any).min,\n max = (g.attribute as any).max,\n median = (g.attribute as any).median,\n angle\n } = glyphAttrs;\n const isH = this._isHorizontal();\n\n const attributes: any = {};\n\n if (isH) {\n attributes.minMaxBox = {\n x: min,\n x1: max,\n y: y - minMaxHeight / 2,\n y1: y + minMaxHeight / 2\n };\n attributes.q1q3Box = {\n x: q1,\n x1: q3,\n y: y - q1q3Height / 2,\n y1: y + q1q3Height / 2\n };\n\n attributes.median = {\n points: [\n {\n x: median,\n y: y - q1q3Height / 2\n },\n {\n x: median,\n y: y + q1q3Height / 2\n }\n ]\n };\n } else {\n attributes.minMaxBox = {\n y: min,\n y1: max,\n x: x - minMaxWidth / 2,\n x1: x + minMaxWidth / 2\n };\n attributes.q1q3Box = {\n y: q1,\n y1: q3,\n x: x - q1q3Width / 2,\n x1: x + q1q3Width / 2\n };\n\n attributes.median = {\n points: [\n {\n y: median,\n x: x - q1q3Width / 2\n },\n {\n y: median,\n x: x + q1q3Width / 2\n }\n ]\n };\n }\n\n if (isValidNumber(angle)) {\n const anchor = glyphAttrs.anchor ?? (isH ? [(min + max) / 2, y] : [x, (min + max) / 2]);\n Object.keys(attributes).forEach(key => {\n attributes[key].angle = angle;\n attributes[key].anchor = anchor;\n });\n }\n\n return attributes;\n };\n } else {\n this._subMarks = {\n shaft: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n box: { type: 'rect' },\n max: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n min: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n median: { type: 'line', defaultAttributes: { x: 0, y: 0 } }\n };\n this._positionChannels = BOX_PLOT_CHANNELS;\n this._channelEncoder = null;\n this._positionEncoder = (glyphAttrs: any, datum: Datum, g: IGlyph) => {\n const {\n x = g.attribute.x,\n y = g.attribute.y,\n boxWidth = (g.attribute as any).boxWidth,\n boxHeight = (g.attribute as any).boxHeight,\n ruleWidth = (g.attribute as any).ruleWidth,\n ruleHeight = (g.attribute as any).ruleHeight,\n q1 = (g.attribute as any).q1,\n q3 = (g.attribute as any).q3,\n min = (g.attribute as any).min,\n max = (g.attribute as any).max,\n median = (g.attribute as any).median,\n angle\n } = glyphAttrs;\n const isH = this._isHorizontal();\n\n const attributes: any = {};\n\n if (isH) {\n attributes.box = {\n x: q1,\n x1: q3,\n y: y - boxHeight / 2,\n y1: y + boxHeight / 2\n };\n attributes.median = {\n points: [\n {\n x: median,\n y: y - boxHeight / 2\n },\n {\n x: median,\n y: y + boxHeight / 2\n }\n ]\n };\n attributes.shaft = {\n points: [\n {\n x: min,\n y: y\n },\n {\n x: max,\n y: y\n }\n ]\n };\n attributes.max = {\n points: [\n {\n x: max,\n y: y - ruleHeight / 2\n },\n {\n x: max,\n y: y + ruleHeight / 2\n }\n ]\n };\n attributes.min = {\n points: [\n {\n x: min,\n y: y - ruleHeight / 2\n },\n {\n x: min,\n y: y + ruleHeight / 2\n }\n ]\n };\n } else {\n attributes.box = {\n x: x - boxWidth / 2,\n x1: x + boxWidth / 2,\n y: q1,\n y1: q3\n };\n attributes.median = {\n points: [\n {\n x: x - boxWidth / 2,\n y: median\n },\n {\n x: x + boxWidth / 2,\n y: median\n }\n ]\n };\n\n attributes.max = {\n points: [\n {\n x: x - ruleWidth / 2,\n y: max\n },\n {\n x: x + ruleWidth / 2,\n y: max\n }\n ]\n };\n attributes.min = {\n points: [\n {\n x: x - ruleWidth / 2,\n y: min\n },\n {\n x: x + ruleWidth / 2,\n y: min\n }\n ]\n };\n attributes.shaft = {\n points: [\n {\n x: x,\n y: min\n },\n {\n x: x,\n y: max\n }\n ]\n };\n }\n\n if (isValidNumber(angle)) {\n const anchor = glyphAttrs.anchor ?? (isH ? [(min + max) / 2, y] : [x, (min + max) / 2]);\n Object.keys(attributes).forEach(key => {\n attributes[key].angle = angle;\n attributes[key].anchor = anchor;\n });\n }\n\n return attributes;\n };\n }\n }\n\n protected _getDefaultStyle() {\n const defaultStyle: IMarkStyle<IBoxPlotMarkSpec> = {\n ...super._getDefaultStyle(),\n lineWidth: 2,\n boxWidth: 30,\n shaftWidth: 20,\n shaftShape: 'line'\n };\n return defaultStyle;\n }\n}\n\nexport const registerBoxPlotMark = () => {\n registerGlyphMark();\n registerLine();\n registerRect();\n Factory.registerGraphicComponent('line', (attrs: ILineGraphicAttribute) => createLine(attrs));\n Factory.registerGraphicComponent('rect', (attrs: ILineGraphicAttribute) => createRect(attrs));\n Factory.registerMark(BoxPlotMark.type, BoxPlotMark);\n};\n"]}
1
+ {"version":3,"sources":["../src/mark/box-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAA2C,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EA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C,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACxF,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;wBACpC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;wBAC9B,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;oBAClC,CAAC,CAAC,CAAC;iBACJ;gBAED,OAAO,UAAU,CAAC;YACpB,CAAC,CAAC;SACH;IACH,CAAC;IAED,gBAAgB;QACd,OAAO,QAAQ,CAAC;IAClB,CAAC;IAES,gBAAgB;QACxB,MAAM,YAAY,mCACb,KAAK,CAAC,gBAAgB,EAAE,KAC3B,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,EAAE,EACZ,UAAU,EAAE,EAAE,EACd,UAAU,EAAE,MAAM,GACnB,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC;;AAnSe,gBAAI,aAAwB;AAsS9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACtD,CAAC,CAAC","file":"box-plot.js","sourcesContent":["import { Factory } from './../core/factory';\nimport type { BoxPlotShaftShape, IBoxPlotMarkSpec } from '../typings/visual';\nimport type { IBoxPlotMark, IMarkStyle } from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { MarkTypeEnum } from './interface/type';\nimport { createLine, createRect, type IGlyph, type ILineGraphicAttribute } from '@visactor/vrender-core';\nimport { GlyphMark, registerGlyphMark } from './glyph';\nimport type { Datum } from '../typings/common';\nimport { isValidNumber } from '@visactor/vutils';\nimport { registerLine, registerRect } from '@visactor/vrender-kits';\n\nconst BAR_BOX_PLOT_CHANNELS = [\n 'x',\n 'y',\n 'minMaxWidth',\n 'minMaxHeight',\n 'q1q3Width',\n 'q1q3Height',\n 'q1',\n 'q3',\n 'min',\n 'max',\n 'median',\n 'angle'\n];\n\nconst BOX_PLOT_CHANNELS = [\n 'x',\n 'y',\n 'boxWidth',\n 'boxHeight',\n 'ruleWidth',\n 'ruleHeight',\n 'q1',\n 'q3',\n 'min',\n 'max',\n 'median',\n 'angle'\n];\n\nexport class BoxPlotMark\n extends GlyphMark<IBoxPlotMarkSpec, { direction?: 'horizontal' | 'vertical'; shaftShape?: BoxPlotShaftShape }>\n implements IBoxPlotMark\n{\n static readonly type = MarkTypeEnum.boxPlot;\n readonly type = BoxPlotMark.type;\n\n protected _isHorizontal() {\n return this._glyphConfig && this._glyphConfig.direction === 'horizontal';\n }\n\n setGlyphConfig(cfg: { direction?: 'horizontal' | 'vertical'; shaftShape?: BoxPlotShaftShape }): void {\n super.setGlyphConfig(cfg);\n\n if (cfg.shaftShape === 'bar') {\n this._subMarks = {\n minMaxBox: {\n type: 'rect',\n defaultAttributes: {\n lineWidth: 0\n }\n },\n q1q3Box: {\n type: 'rect',\n defaultAttributes: {\n lineWidth: 0\n }\n },\n median: {\n type: 'line',\n defaultAttributes: { x: 0, y: 0 }\n }\n };\n this._positionChannels = BAR_BOX_PLOT_CHANNELS;\n this._channelEncoder = {\n minMaxFillOpacity: (val: number) => ({ minMaxBox: { fillOpacity: val } }),\n lineWidth: (val: number) => ({ minMaxBox: { lineWidth: 0 }, q1q3Box: { lineWidth: 0 } }),\n stroke: (val: number) => ({ minMaxBox: { stroke: false }, q1q3Box: { stroke: false } })\n };\n\n this._positionEncoder = (glyphAttrs: any, datum: Datum, g: IGlyph) => {\n const {\n x = g.attribute.x,\n y = g.attribute.y,\n minMaxWidth = (g.attribute as any).minMaxWidth,\n minMaxHeight = (g.attribute as any).minMaxHeight,\n q1q3Width = (g.attribute as any).q1q3Width,\n q1q3Height = (g.attribute as any).q1q3Height,\n q1 = (g.attribute as any).q1,\n q3 = (g.attribute as any).q3,\n min = (g.attribute as any).min,\n max = (g.attribute as any).max,\n median = (g.attribute as any).median,\n angle\n } = glyphAttrs;\n const isH = this._isHorizontal();\n\n const attributes: any = {};\n\n if (isH) {\n attributes.minMaxBox = {\n x: min,\n x1: max,\n y: y - minMaxHeight / 2,\n y1: y + minMaxHeight / 2\n };\n attributes.q1q3Box = {\n x: q1,\n x1: q3,\n y: y - q1q3Height / 2,\n y1: y + q1q3Height / 2\n };\n\n attributes.median = {\n points: [\n {\n x: median,\n y: y - q1q3Height / 2\n },\n {\n x: median,\n y: y + q1q3Height / 2\n }\n ]\n };\n } else {\n attributes.minMaxBox = {\n y: min,\n y1: max,\n x: x - minMaxWidth / 2,\n x1: x + minMaxWidth / 2\n };\n attributes.q1q3Box = {\n y: q1,\n y1: q3,\n x: x - q1q3Width / 2,\n x1: x + q1q3Width / 2\n };\n\n attributes.median = {\n points: [\n {\n y: median,\n x: x - q1q3Width / 2\n },\n {\n y: median,\n x: x + q1q3Width / 2\n }\n ]\n };\n }\n\n if (isValidNumber(angle)) {\n const anchor = glyphAttrs.anchor ?? (isH ? [(min + max) / 2, y] : [x, (min + max) / 2]);\n Object.keys(attributes).forEach(key => {\n attributes[key].angle = angle;\n attributes[key].anchor = anchor;\n });\n }\n\n return attributes;\n };\n } else {\n this._subMarks = {\n shaft: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n box: { type: 'rect' },\n max: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n min: { type: 'line', defaultAttributes: { x: 0, y: 0 } },\n median: { type: 'line', defaultAttributes: { x: 0, y: 0 } }\n };\n this._positionChannels = BOX_PLOT_CHANNELS;\n this._channelEncoder = {\n boxStroke: (val: string) => ({ box: { stroke: val } }),\n medianStroke: (val: string) => ({ median: { stroke: val } }),\n boxCornerRadius: (val: number) => ({ box: { cornerRadius: val } })\n };\n this._positionEncoder = (glyphAttrs: any, datum: Datum, g: IGlyph) => {\n const {\n x = g.attribute.x,\n y = g.attribute.y,\n boxWidth = (g.attribute as any).boxWidth,\n boxHeight = (g.attribute as any).boxHeight,\n ruleWidth = (g.attribute as any).ruleWidth,\n ruleHeight = (g.attribute as any).ruleHeight,\n q1 = (g.attribute as any).q1,\n q3 = (g.attribute as any).q3,\n min = (g.attribute as any).min,\n max = (g.attribute as any).max,\n median = (g.attribute as any).median,\n angle\n } = glyphAttrs;\n const isH = this._isHorizontal();\n\n const attributes: any = {};\n\n if (isH) {\n attributes.box = {\n x: q1,\n x1: q3,\n y: y - boxHeight / 2,\n y1: y + boxHeight / 2\n };\n attributes.median = {\n points: [\n {\n x: median,\n y: y - boxHeight / 2\n },\n {\n x: median,\n y: y + boxHeight / 2\n }\n ]\n };\n attributes.shaft = {\n points: [\n {\n x: min,\n y: y\n },\n {\n x: max,\n y: y\n }\n ]\n };\n attributes.max = {\n points: [\n {\n x: max,\n y: y - ruleHeight / 2\n },\n {\n x: max,\n y: y + ruleHeight / 2\n }\n ]\n };\n attributes.min = {\n points: [\n {\n x: min,\n y: y - ruleHeight / 2\n },\n {\n x: min,\n y: y + ruleHeight / 2\n }\n ]\n };\n } else {\n attributes.box = {\n x: x - boxWidth / 2,\n x1: x + boxWidth / 2,\n y: q1,\n y1: q3\n };\n attributes.median = {\n points: [\n {\n x: x - boxWidth / 2,\n y: median\n },\n {\n x: x + boxWidth / 2,\n y: median\n }\n ]\n };\n\n attributes.max = {\n points: [\n {\n x: x - ruleWidth / 2,\n y: max\n },\n {\n x: x + ruleWidth / 2,\n y: max\n }\n ]\n };\n attributes.min = {\n points: [\n {\n x: x - ruleWidth / 2,\n y: min\n },\n {\n x: x + ruleWidth / 2,\n y: min\n }\n ]\n };\n attributes.shaft = {\n points: [\n {\n x: x,\n y: min\n },\n {\n x: x,\n y: max\n }\n ]\n };\n }\n\n if (isValidNumber(angle)) {\n const anchor = glyphAttrs.anchor ?? (isH ? [(min + max) / 2, y] : [x, (min + max) / 2]);\n Object.keys(attributes).forEach(key => {\n attributes[key].angle = angle;\n attributes[key].anchor = anchor;\n });\n }\n\n return attributes;\n };\n }\n }\n\n setDataLabelType() {\n return 'symbol';\n }\n\n protected _getDefaultStyle() {\n const defaultStyle: IMarkStyle<IBoxPlotMarkSpec> = {\n ...super._getDefaultStyle(),\n lineWidth: 2,\n boxWidth: 30,\n shaftWidth: 20,\n shaftShape: 'line'\n };\n return defaultStyle;\n }\n}\n\nexport const registerBoxPlotMark = () => {\n registerGlyphMark();\n registerLine();\n registerRect();\n Factory.registerGraphicComponent('line', (attrs: ILineGraphicAttribute) => createLine(attrs));\n Factory.registerGraphicComponent('rect', (attrs: ILineGraphicAttribute) => createRect(attrs));\n Factory.registerMark(BoxPlotMark.type, BoxPlotMark);\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import { BaseSeriesSpecTransformer } from '../base';
2
+ import type { IBoxPlotSeriesSpec, IBoxPlotSeriesTheme } from './interface';
3
+ export declare class BoxPlotSeriesSpecTransformer<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec, K extends IBoxPlotSeriesTheme = IBoxPlotSeriesTheme> extends BaseSeriesSpecTransformer<T, K> {
4
+ protected _transformLabelSpec(spec: T): void;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseSeriesSpecTransformer } from "../base";
2
+
3
+ export class BoxPlotSeriesSpecTransformer extends BaseSeriesSpecTransformer {
4
+ _transformLabelSpec(spec) {
5
+ this._addMarkLabelSpec(spec, "boxPlot");
6
+ }
7
+ }
8
+ //# sourceMappingURL=box-plot-transformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/series/box-plot/box-plot-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIpD,MAAM,OAAO,4BAGX,SAAQ,yBAA+B;IAC7B,mBAAmB,CAAC,IAAO;QACnC,IAAI,CAAC,iBAAiB,CAAC,IAAI,YAA6B,CAAC;IAC3D,CAAC;CACF","file":"box-plot-transformer.js","sourcesContent":["import { BaseSeriesSpecTransformer } from '../base';\nimport { SeriesMarkNameEnum } from '../interface';\nimport type { IBoxPlotSeriesSpec, IBoxPlotSeriesTheme } from './interface';\n\nexport class BoxPlotSeriesSpecTransformer<\n T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec,\n K extends IBoxPlotSeriesTheme = IBoxPlotSeriesTheme\n> extends BaseSeriesSpecTransformer<T, K> {\n protected _transformLabelSpec(spec: T): void {\n this._addMarkLabelSpec(spec, SeriesMarkNameEnum.boxPlot);\n }\n}\n"]}
@@ -1,11 +1,13 @@
1
- import type { IModelEvaluateOption, IModelInitOption } from '../../model/interface';
1
+ import type { IModelInitOption } from '../../model/interface';
2
2
  import type { BoxPlotShaftShape, IOutlierMarkSpec, Datum, DirectionType } from '../../typings';
3
3
  import { CartesianSeries } from '../cartesian/cartesian';
4
4
  import type { SeriesMarkMap } from '../interface';
5
5
  import { SeriesTypeEnum } from '../interface/type';
6
6
  import type { IBoxPlotSeriesSpec } from './interface';
7
- import type { IMark } from '../../mark/interface';
7
+ import { DataView } from '@visactor/vdataset';
8
+ import type { IMark, ITextMark } from '../../mark/interface';
8
9
  import type { ICompilableData } from '../../compile/data';
10
+ import { BoxPlotSeriesSpecTransformer } from './box-plot-transformer';
9
11
  export declare const DEFAULT_FILL_COLOR = "#FFF";
10
12
  export declare const DEFAULT_STROKE_COLOR = "#000";
11
13
  export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeriesSpec> extends CartesianSeries<T> {
@@ -15,6 +17,8 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
15
17
  boxPlot: import("./interface").IBoxPlotSeriesTheme;
16
18
  };
17
19
  static readonly mark: SeriesMarkMap;
20
+ static readonly transformerConstructor: any;
21
+ readonly transformerConstructor: typeof BoxPlotSeriesSpecTransformer;
18
22
  protected _bandPosition: number;
19
23
  protected _minField: string;
20
24
  getMinField(): string;
@@ -40,7 +44,7 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
40
44
  protected _shaftFillOpacity: number;
41
45
  protected _outliersStyle: IOutlierMarkSpec;
42
46
  getOutliersStyle(): IOutlierMarkSpec;
43
- protected _outlierDataView: ICompilableData;
47
+ protected _outlierData: ICompilableData;
44
48
  private _autoBoxWidth;
45
49
  setAttrFromSpec(): void;
46
50
  private _boxPlotMark?;
@@ -48,8 +52,10 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
48
52
  initMark(): void;
49
53
  initMarkStyle(): void;
50
54
  initBoxPlotMarkStyle(): void;
55
+ initLabelMarkStyle(textMark: ITextMark): void;
51
56
  initData(): void;
52
57
  compileData(): void;
58
+ viewDataUpdate(d: DataView): void;
53
59
  init(option: IModelInitOption): void;
54
60
  private _getMarkWidth;
55
61
  protected _getPosition(direction: DirectionType, datum: Datum): number;
@@ -61,7 +67,6 @@ export declare class BoxPlotSeries<T extends IBoxPlotSeriesSpec = IBoxPlotSeries
61
67
  key: string;
62
68
  operations: import("../../data/transforms/interface").StatisticOperations;
63
69
  }[];
64
- onEvaluateEnd(ctx: IModelEvaluateOption): void;
65
70
  getDefaultShapeType(): string;
66
71
  getActiveMarks(): IMark[];
67
72
  }
@@ -54,6 +54,8 @@ import { getActualNumValue } from "../../util/space";
54
54
 
55
55
  import { isContinuous } from "@visactor/vscale";
56
56
 
57
+ import { BoxPlotSeriesSpecTransformer } from "./box-plot-transformer";
58
+
57
59
  const DEFAULT_STROKE_WIDTH = 2, DEFAULT_SHAFT_FILL_OPACITY = .5, DEFAULT_SHAFT_SHAPE = "line";
58
60
 
59
61
  export const DEFAULT_FILL_COLOR = "#FFF";
@@ -64,7 +66,8 @@ const DEFAULT_OUTLIER_SIZE = 10;
64
66
 
65
67
  export class BoxPlotSeries extends CartesianSeries {
66
68
  constructor() {
67
- super(...arguments), this.type = SeriesTypeEnum.boxPlot, this._bandPosition = 0;
69
+ super(...arguments), this.type = SeriesTypeEnum.boxPlot, this.transformerConstructor = BoxPlotSeriesSpecTransformer,
70
+ this._bandPosition = 0;
68
71
  }
69
72
  getMinField() {
70
73
  return this._minField;
@@ -114,13 +117,11 @@ export class BoxPlotSeries extends CartesianSeries {
114
117
  isSeriesMark: !0
115
118
  }), this._outliersField && (this._outlierMark = this._createMark(BoxPlotSeries.mark.outlier, {
116
119
  key: DEFAULT_DATA_INDEX,
117
- groupKey: this._seriesField,
118
- dataView: this._outlierDataView.getDataView(),
119
- dataProductId: this._outlierDataView.getProductId()
120
- }));
120
+ groupKey: this._seriesField
121
+ }), this._outlierMark.setData(this._outlierData));
121
122
  }
122
123
  initMarkStyle() {
123
- var _a, _b, _c, _d, _e;
124
+ var _a, _b, _c, _d, _e, _f;
124
125
  const boxPlotMark = this._boxPlotMark;
125
126
  if (boxPlotMark) {
126
127
  const commonBoxplotStyles = {
@@ -175,8 +176,9 @@ export class BoxPlotSeries extends CartesianSeries {
175
176
  }
176
177
  const outlierMark = this._outlierMark;
177
178
  outlierMark && this.setMarkStyle(outlierMark, {
178
- fill: null !== (_d = null === (_c = this._outliersStyle) || void 0 === _c ? void 0 : _c.fill) && void 0 !== _d ? _d : this.getColorAttribute(),
179
- size: isNumber(null === (_e = this._outliersStyle) || void 0 === _e ? void 0 : _e.size) ? this._outliersStyle.size : 10
179
+ fill: null !== (_e = null !== (_d = null === (_c = this._outliersStyle) || void 0 === _c ? void 0 : _c.fill) && void 0 !== _d ? _d : this._boxFillColor) && void 0 !== _e ? _e : this.getColorAttribute(),
180
+ stroke: this.getColorAttribute(),
181
+ size: isNumber(null === (_f = this._outliersStyle) || void 0 === _f ? void 0 : _f.size) ? this._outliersStyle.size : 10
180
182
  }, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
181
183
  }
182
184
  initBoxPlotMarkStyle() {
@@ -218,6 +220,13 @@ export class BoxPlotSeries extends CartesianSeries {
218
220
  this.setMarkStyle(outlierMark, outlierMarkPositionChannel, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
219
221
  }
220
222
  }
223
+ initLabelMarkStyle(textMark) {
224
+ textMark && this.setMarkStyle(textMark, {
225
+ fill: this.getColorAttribute(),
226
+ text: datum => datum[this.getMedianField()],
227
+ z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
228
+ });
229
+ }
221
230
  initData() {
222
231
  if (super.initData(), !this._data) return;
223
232
  registerDataSetInstanceTransform(this._dataSet, "foldOutlierData", foldOutlierData),
@@ -231,7 +240,8 @@ export class BoxPlotSeries extends CartesianSeries {
231
240
  type: "foldOutlierData",
232
241
  options: {
233
242
  dimensionField: "horizontal" === this._direction ? this._fieldY : this._fieldX,
234
- outliersField: this._outliersField
243
+ outliersField: this._outliersField,
244
+ seriesField: this._seriesField
235
245
  }
236
246
  }), outlierDataView.transform({
237
247
  type: "addVChartProperty",
@@ -239,11 +249,15 @@ export class BoxPlotSeries extends CartesianSeries {
239
249
  beforeCall: initKeyMap.bind(this),
240
250
  call: addDataKey
241
251
  }
242
- }, !1), this._outlierDataView = new CompilableData(this._option, outlierDataView);
252
+ }, !1), this._outlierData = new CompilableData(this._option, outlierDataView);
243
253
  }
244
254
  compileData() {
245
255
  var _a;
246
- super.compileData(), null === (_a = this._outlierDataView) || void 0 === _a || _a.compile();
256
+ super.compileData(), null === (_a = this._outlierData) || void 0 === _a || _a.compile();
257
+ }
258
+ viewDataUpdate(d) {
259
+ var _a;
260
+ super.viewDataUpdate(d), null === (_a = this._outlierData) || void 0 === _a || _a.updateData();
247
261
  }
248
262
  init(option) {
249
263
  super.init(option), this.initBoxPlotMarkStyle();
@@ -314,9 +328,6 @@ export class BoxPlotSeries extends CartesianSeries {
314
328
  return outliersField && (outliersField.operations = [ "array-min", "array-max" ]),
315
329
  fields;
316
330
  }
317
- onEvaluateEnd(ctx) {
318
- super.onEvaluateEnd(ctx), this._outlierDataView.updateData();
319
- }
320
331
  getDefaultShapeType() {
321
332
  return "square";
322
333
  }
@@ -327,7 +338,7 @@ export class BoxPlotSeries extends CartesianSeries {
327
338
 
328
339
  BoxPlotSeries.type = SeriesTypeEnum.boxPlot, BoxPlotSeries.builtInTheme = {
329
340
  boxPlot: boxPlot
330
- }, BoxPlotSeries.mark = boxPlotSeriesMark;
341
+ }, BoxPlotSeries.mark = boxPlotSeriesMark, BoxPlotSeries.transformerConstructor = BoxPlotSeriesSpecTransformer;
331
342
 
332
343
  export const registerBoxplotSeries = () => {
333
344
  registerBoxPlotMark(), registerSymbolMark(), registerScaleInOutAnimation(), registerCartesianBandAxis(),