@visactor/vchart 1.5.1-alpha.2 → 1.5.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +361 -288
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/compiler.d.ts +0 -1
- package/cjs/compile/compiler.js +1 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/util.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +2 -4
- package/cjs/component/tooltip/handler/base.js +15 -38
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.d.ts +1 -2
- package/cjs/component/tooltip/handler/dom/util.js +14 -13
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/interface/style.d.ts +4 -23
- package/cjs/component/tooltip/handler/interface/style.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.d.ts +9 -11
- package/cjs/component/tooltip/handler/utils/attribute.js +136 -126
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/common.d.ts +8 -0
- package/cjs/component/tooltip/handler/utils/common.js +42 -2
- package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/index.d.ts +0 -1
- package/cjs/component/tooltip/handler/utils/index.js +1 -2
- package/cjs/component/tooltip/handler/utils/index.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +5 -3
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/env/env.d.ts +7 -0
- package/cjs/env/env.js +48 -0
- package/cjs/env/env.js.map +1 -0
- package/cjs/env/index.d.ts +1 -0
- package/cjs/env/index.js +21 -0
- package/cjs/env/index.js.map +1 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interaction/interaction.js +1 -2
- package/cjs/interaction/trigger.js +2 -1
- package/cjs/mark/arc.js +1 -1
- package/cjs/mark/area.js +1 -1
- package/cjs/series/gauge/gauge.d.ts +2 -0
- package/cjs/series/gauge/gauge.js +10 -4
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/sankey/sankey.js +3 -18
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/theme/builtin/common/series/gauge.js +1 -1
- package/cjs/theme/builtin/common/series/gauge.js.map +1 -1
- package/cjs/vchart-all.js +3 -2
- package/cjs/vchart-all.js.map +1 -1
- package/cjs/vchart-simple.js +3 -2
- package/cjs/vchart-simple.js.map +1 -1
- package/esm/compile/compiler.d.ts +0 -1
- package/esm/compile/compiler.js +1 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/util.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +2 -4
- package/esm/component/tooltip/handler/base.js +14 -39
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +2 -2
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.d.ts +1 -2
- package/esm/component/tooltip/handler/dom/util.js +14 -14
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/interface/style.d.ts +4 -23
- package/esm/component/tooltip/handler/interface/style.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.d.ts +9 -11
- package/esm/component/tooltip/handler/utils/attribute.js +131 -123
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/common.d.ts +8 -0
- package/esm/component/tooltip/handler/utils/common.js +41 -1
- package/esm/component/tooltip/handler/utils/common.js.map +1 -1
- package/esm/component/tooltip/handler/utils/index.d.ts +0 -1
- package/esm/component/tooltip/handler/utils/index.js +0 -2
- package/esm/component/tooltip/handler/utils/index.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +5 -3
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +3 -3
- package/esm/core/vchart.js.map +1 -1
- package/esm/env/env.d.ts +7 -0
- package/esm/env/env.js +32 -0
- package/esm/env/env.js.map +1 -0
- package/esm/env/index.d.ts +1 -0
- package/esm/env/index.js +2 -0
- package/esm/env/index.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/interaction/interaction.js +1 -2
- package/esm/interaction/trigger.js +2 -1
- package/esm/mark/arc.js +1 -1
- package/esm/mark/area.js +1 -1
- package/esm/series/gauge/gauge.d.ts +2 -0
- package/esm/series/gauge/gauge.js +10 -4
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/sankey/sankey.js +3 -17
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/theme/builtin/common/series/gauge.js +1 -1
- package/esm/theme/builtin/common/series/gauge.js.map +1 -1
- package/esm/vchart-all.js +4 -1
- package/esm/vchart-all.js.map +1 -1
- package/esm/vchart-simple.js +4 -1
- package/esm/vchart-simple.js.map +1 -1
- package/package.json +14 -14
- package/cjs/component/tooltip/handler/utils/style.d.ts +0 -4
- package/cjs/component/tooltip/handler/utils/style.js +0 -32
- package/cjs/component/tooltip/handler/utils/style.js.map +0 -1
- package/esm/component/tooltip/handler/utils/style.d.ts +0 -4
- package/esm/component/tooltip/handler/utils/style.js +0 -26
- package/esm/component/tooltip/handler/utils/style.js.map +0 -1
|
@@ -25,7 +25,6 @@ export declare class Compiler {
|
|
|
25
25
|
protected _model: CompilerModel;
|
|
26
26
|
getModel(): CompilerModel;
|
|
27
27
|
private _compileChart;
|
|
28
|
-
private _rafId;
|
|
29
28
|
constructor(container: IRenderContainer, option: IRenderOption);
|
|
30
29
|
getRenderer(): import("@visactor/vgrammar-core").IRenderer;
|
|
31
30
|
getCanvas(): HTMLCanvasElement | undefined;
|
package/cjs/compile/compiler.js
CHANGED
|
@@ -239,7 +239,7 @@ class Compiler {
|
|
|
239
239
|
var _a;
|
|
240
240
|
this.releaseEvent(), this._option = this._container = null, this._releaseModel(),
|
|
241
241
|
null === (_a = this._view) || void 0 === _a || _a.release(), this._view = null,
|
|
242
|
-
this.isInited = !1, this.
|
|
242
|
+
this.isInited = !1, this.isReleased = !0;
|
|
243
243
|
}
|
|
244
244
|
releaseGrammar() {
|
|
245
245
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compile/compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAiD;AAGjD,2DAA+C;AAU/C,2CAA0C;AAC1C,iCAAsC;AACtC,kCAAoE;AAGpE,6CAAuE;AAMvE,0CAAgD;AAOhD,MAAa,QAAQ;IAKnB,eAAe;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAoBD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAKD,YAAY,SAA2B,EAAE,MAAqB;QA1BpD,mBAAc,GAAgD,IAAI,GAAG,EAAE,CAAC;QACxE,qBAAgB,GAAgD,IAAI,GAAG,EAAE,CAAC;QAC1E,qBAAgB,GAAgD,IAA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cAAc,CAAC,EAAE;gBACjD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAmB,CAAC;gBAErE,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;gBAG7C,MAAM,UAAU,GAAG,YAAY;qBAC5B,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;oBACvB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;qBACxC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC,EAAE,EAAoB,CAAC;qBACvB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;qBACpC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;gBAGhD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,cAAc;;QACpB,OAAO,IAAA,oBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,QAAQ,EAAE,0CAAE,MAAM,CAAC;IACjF,CAAC;CACF;AAvZD,4BAuZC","file":"compiler.js","sourcesContent":["import { ChartEvent } from './../constant/event';\nimport type { IElement, IView } from '@visactor/vgrammar-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { View } from '@visactor/vgrammar-core';\nimport type {\n CompilerListenerParameters,\n CompilerModel,\n IGrammarItem,\n IProductMap,\n IRenderContainer,\n IRenderOption\n} from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarType } from './interface';\nimport { toRenderMode } from './util';\nimport { isMobileLikeMode, isString, isTrueBrowser } from '../util';\nimport type { IBoundsLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNil, isValid, Logger, LoggerLevel } from '@visactor/vutils';\nimport type { EventSourceType } from '../event/interface';\nimport type { IChart } from '../chart/interface';\nimport type { VChart } from '../core/vchart';\nimport type { IColor, Stage } from '@visactor/vrender-core';\nimport type { IMorphConfig } from '../animation/spec';\nimport { Event_Source_Type } from '../constant';\n\ntype EventListener = {\n type: string;\n callback: (...args: any[]) => void;\n};\n\nexport class Compiler {\n protected _view: IView;\n /**\n * 获取 VGrammar View 实例\n */\n getVGrammarView() {\n return this._view;\n }\n protected _viewListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _windowListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _canvasListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n\n isInited: boolean = false;\n // 是否已经销毁\n isReleased: boolean = false;\n\n protected _width: number;\n protected _height: number;\n\n protected _container: IRenderContainer;\n protected _option: IRenderOption;\n\n protected _model: CompilerModel = {\n [GrammarType.signal]: {},\n [GrammarType.data]: {},\n [GrammarType.mark]: {}\n };\n getModel() {\n return this._model;\n }\n\n private _compileChart: IChart = null;\n private _rafId: number;\n\n constructor(container: IRenderContainer, option: IRenderOption) {\n this._container = container;\n this._option = option;\n }\n\n getRenderer() {\n return this._view?.renderer;\n }\n\n /**\n * 获取 canvas dom\n * @returns HTMLCanvasElement | undefined\n */\n getCanvas(): HTMLCanvasElement | undefined {\n return this._view?.renderer.canvas();\n }\n\n /**\n * 获取 渲染引擎\n */\n getStage(): Stage | undefined {\n return this._view?.renderer.stage();\n }\n\n initView() {\n if (this.isReleased) {\n return;\n }\n this.isInited = true;\n if (this._view) {\n return;\n }\n const logger = new Logger(this._option.logLevel ?? LoggerLevel.Error);\n if (this._option?.onError) {\n logger.addErrorHandler((...args) => {\n this._option?.onError?.(...args);\n });\n }\n this._view = new View({\n width: this._width,\n height: this._height,\n // 禁用默认交互,防止干扰数据流\n hover: false,\n select: false,\n container: this._container.dom ?? null,\n renderCanvas: this._container.canvas ?? null,\n hooks: (this._option as any).performanceHook, // vgrammar 事件改造后,性能回调函数放在了hooks中实现\n cursor: false,\n ...this._option,\n mode: toRenderMode(this._option.mode),\n autoFit: false,\n eventConfig: {\n gesture: isMobileLikeMode(this._option.mode),\n disable: this._option.interactive === false\n },\n doLayout: () => {\n this._compileChart?.onLayout(this._view);\n },\n logger: logger,\n logLevel: logger.level()\n });\n this._setCanvasStyle();\n\n // emit afterRender event\n this.getStage().hooks.afterRender.tap('chart-event', () => {\n this._compileChart?.getEvent()?.emit(ChartEvent.afterRender, { chart: this._compileChart });\n });\n\n const interactive = this._option.interactive;\n if (interactive !== false) {\n // 将 view 实例化之前监听的事件挂载到 view 上\n this._viewListeners.forEach(listener => {\n this._view?.addEventListener(listener.type, listener.callback);\n });\n }\n }\n\n private _setCanvasStyle() {\n if (!this._view) {\n return;\n }\n if (this._container.dom && !isString(this._container.dom)) {\n this._container.dom.style.display = 'block';\n this._container.dom.style.position = 'relative';\n const canvas = this.getCanvas();\n if (canvas) {\n canvas.style.display = 'block';\n }\n }\n }\n\n compile(ctx: { chart: IChart; vChart: VChart }, option: any) {\n const { chart } = ctx;\n this._compileChart = chart;\n this.initView();\n if (!this._view) {\n return;\n }\n\n chart.compile();\n chart.afterCompile();\n this.updateDepend();\n }\n\n clear(ctx: { chart: IChart; vChart: VChart }) {\n const { chart } = ctx;\n chart.clear();\n this.releaseGrammar();\n }\n\n async renderAsync(morphConfig?: IMorphConfig): Promise<any> {\n this.initView();\n if (!this._view) {\n return Promise.reject('srView init fail');\n }\n await this._view?.runNextTick(morphConfig);\n return this;\n }\n\n renderSync(morphConfig?: IMorphConfig): void {\n this.initView();\n if (!this._view) {\n return;\n }\n this._view?.runSync(morphConfig);\n }\n\n updateViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n resize(width: number, height: number, reRender: boolean = true) {\n if (!this._view) {\n return Promise.reject();\n }\n this._width = width;\n this._height = height;\n\n this._view.resize(width, height);\n return reRender ? this.renderAsync({ morph: false }) : this;\n }\n\n setBackground(color: IColor) {\n this._view?.background(color);\n }\n\n setSize(width: number, height: number) {\n this._width = width;\n this._height = height;\n if (!this._view) {\n return;\n }\n\n this._view.width(width);\n this._view.height(height);\n }\n\n setViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n addEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n // TODO: 需要明确一下 interactive 的作用范围,同时考虑是否存在非交互行为的事件以及是否需要生效\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = function (event: any, element: IElement | null) {\n const context = element?.mark?.context ?? {};\n const modelId = isValid(context.modelId) ? context.modelId : null;\n const markId = isValid(context.markId) ? context.markId : null;\n const modelUserId = isValid(context.modelUserId) ? context.modelUserId : null;\n const markUserId = isValid(context.markUserId) ? context.markUserId : null;\n\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: element,\n datum: element?.getDatum?.() || null,\n markId,\n modelId,\n markUserId,\n modelUserId\n };\n callback.call(null, params);\n }.bind(this);\n this._viewListeners.set(callback, { type, callback: wrappedCallback });\n // 如果 view 已经初始化则立刻挂载监听\n // FIXME: 目前 vgrammar 类型声明没有对齐,事件相关类型声明并没有使用 SceneItem\n this._view?.addEventListener(type, wrappedCallback as any);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._windowListeners.set(callback, { type, callback: wrappedCallback });\n const windowObject = this._getGlobalThis();\n windowObject?.addEventListener(type, wrappedCallback);\n } else if (source === Event_Source_Type.canvas) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._canvasListeners.set(callback, { type, callback: wrappedCallback });\n const canvasObject = this.getStage()?.window;\n canvasObject?.addEventListener(type, wrappedCallback);\n }\n }\n\n removeEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = this._viewListeners.get(callback)?.callback;\n wrappedCallback && this._view?.removeEventListener(type, wrappedCallback);\n this._viewListeners.delete(callback);\n } else if (source === Event_Source_Type.window) {\n const windowObject = this._getGlobalThis();\n const wrappedCallback = this._windowListeners.get(callback)?.callback;\n wrappedCallback && windowObject?.removeEventListener(type, wrappedCallback);\n this._windowListeners.delete(callback);\n } else if (source === Event_Source_Type.canvas) {\n const canvasObject = this._getGlobalThis();\n const wrappedCallback = this._canvasListeners.get(callback)?.callback;\n wrappedCallback && canvasObject?.removeEventListener(type, wrappedCallback);\n this._canvasListeners.delete(callback);\n }\n }\n\n protected releaseEvent(): void {\n // 相应的事件remove在model中完成\n this._viewListeners.clear();\n this._windowListeners.clear();\n this._canvasListeners.clear();\n }\n\n release(): void {\n this.releaseEvent();\n this._option = this._container = null as any;\n // vgrammar release\n this._releaseModel();\n this._view?.release();\n this._view = null;\n this.isInited = false;\n this._rafId = null;\n this.isReleased = true;\n }\n\n releaseGrammar() {\n this._releaseModel();\n this._view?.removeAllGrammars();\n }\n\n protected _releaseModel() {\n // 释放model\n Object.keys(this._model).forEach(type => {\n Object.values(this._model[type] as IProductMap<IGrammarItem>).forEach(grammarItemMap => {\n Object.values(grammarItemMap).forEach((item: IGrammarItem) => {\n item.removeProduct(true); // 保留 vgrammar 语法元素,下面一起清空\n });\n });\n this._model[type] = {};\n });\n }\n\n /** 添加语法元素 */\n addGrammarItem(grammarItem: IGrammarItem) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n if (isNil(this._model[type][id])) {\n this._model[type][id] = {};\n }\n this._model[type][id][grammarItem.id] = grammarItem;\n }\n\n /** 删除语法元素 */\n removeGrammarItem(grammarItem: IGrammarItem, reserveVGrammarModel?: boolean) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n const map = this._model[type][id];\n if (isValid(map)) {\n delete map[grammarItem.id];\n if (Object.keys(map).length === 0) {\n delete this._model[type][id];\n }\n }\n if (!reserveVGrammarModel) {\n this._view?.removeGrammar(product);\n }\n }\n\n /** 更新语法元素间的依赖关系,返回是否全部成功更新 */\n updateDepend(items?: IGrammarItem[]): boolean {\n if (isValid(items) && items.length > 0) {\n // 局部更新依赖\n return items.every(item => item.updateDepend());\n }\n // 全局更新依赖\n Object.values(this._model).forEach(productMap => {\n Object.values(productMap).forEach(grammarItemMap => {\n const grammarItems = Object.values(grammarItemMap) as IGrammarItem[];\n // 获取编译产物\n const product = grammarItems[0].getProduct();\n\n // 获取编译产物的依赖项\n const dependList = grammarItems\n .reduce((depend, item) => {\n if (item.getDepend().length > 0) {\n return depend.concat(item.getDepend());\n }\n return depend;\n }, [] as IGrammarItem[])\n .filter(grammarItem => !!grammarItem)\n .map(grammarItem => grammarItem.getProduct());\n\n // 更新依赖\n product.depend(dependList);\n });\n });\n return true;\n }\n\n private _getGlobalThis() {\n return isTrueBrowser(this._option.mode) ? globalThis : this.getStage()?.window;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/compile/compiler.ts"],"names":[],"m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,MAAA,IAAI,CAAC,QAAQ,EAAE,0CAAE,MAAM,CAAC;IACjF,CAAC;CACF;AArZD,4BAqZC","file":"compiler.js","sourcesContent":["import { ChartEvent } from './../constant/event';\nimport type { IElement, IView } from '@visactor/vgrammar-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { View } from '@visactor/vgrammar-core';\nimport type {\n CompilerListenerParameters,\n CompilerModel,\n IGrammarItem,\n IProductMap,\n IRenderContainer,\n IRenderOption\n} from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarType } from './interface';\nimport { toRenderMode } from './util';\nimport { isMobileLikeMode, isString, isTrueBrowser } from '../util';\nimport type { IBoundsLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNil, isValid, Logger, LoggerLevel } from '@visactor/vutils';\nimport type { EventSourceType } from '../event/interface';\nimport type { IChart } from '../chart/interface';\nimport type { VChart } from '../core/vchart';\nimport type { IColor, Stage } from '@visactor/vrender-core';\nimport type { IMorphConfig } from '../animation/spec';\nimport { Event_Source_Type } from '../constant';\n\ntype EventListener = {\n type: string;\n callback: (...args: any[]) => void;\n};\n\nexport class Compiler {\n protected _view: IView;\n /**\n * 获取 VGrammar View 实例\n */\n getVGrammarView() {\n return this._view;\n }\n protected _viewListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _windowListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _canvasListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n\n isInited: boolean = false;\n // 是否已经销毁\n isReleased: boolean = false;\n\n protected _width: number;\n protected _height: number;\n\n protected _container: IRenderContainer;\n protected _option: IRenderOption;\n\n protected _model: CompilerModel = {\n [GrammarType.signal]: {},\n [GrammarType.data]: {},\n [GrammarType.mark]: {}\n };\n getModel() {\n return this._model;\n }\n\n private _compileChart: IChart = null;\n\n constructor(container: IRenderContainer, option: IRenderOption) {\n this._container = container;\n this._option = option;\n }\n\n getRenderer() {\n return this._view?.renderer;\n }\n\n /**\n * 获取 canvas dom\n * @returns HTMLCanvasElement | undefined\n */\n getCanvas(): HTMLCanvasElement | undefined {\n return this._view?.renderer.canvas();\n }\n\n /**\n * 获取 渲染引擎\n */\n getStage(): Stage | undefined {\n return this._view?.renderer.stage();\n }\n\n initView() {\n if (this.isReleased) {\n return;\n }\n this.isInited = true;\n if (this._view) {\n return;\n }\n const logger = new Logger(this._option.logLevel ?? LoggerLevel.Error);\n if (this._option?.onError) {\n logger.addErrorHandler((...args) => {\n this._option?.onError?.(...args);\n });\n }\n this._view = new View({\n width: this._width,\n height: this._height,\n // 禁用默认交互,防止干扰数据流\n hover: false,\n select: false,\n container: this._container.dom ?? null,\n renderCanvas: this._container.canvas ?? null,\n hooks: (this._option as any).performanceHook, // vgrammar 事件改造后,性能回调函数放在了hooks中实现\n cursor: false,\n ...this._option,\n mode: toRenderMode(this._option.mode),\n autoFit: false,\n eventConfig: {\n gesture: isMobileLikeMode(this._option.mode),\n disable: this._option.interactive === false\n },\n doLayout: () => {\n this._compileChart?.onLayout(this._view);\n },\n logger: logger,\n logLevel: logger.level()\n });\n this._setCanvasStyle();\n\n // emit afterRender event\n this.getStage().hooks.afterRender.tap('chart-event', () => {\n this._compileChart?.getEvent()?.emit(ChartEvent.afterRender, { chart: this._compileChart });\n });\n\n const interactive = this._option.interactive;\n if (interactive !== false) {\n // 将 view 实例化之前监听的事件挂载到 view 上\n this._viewListeners.forEach(listener => {\n this._view?.addEventListener(listener.type, listener.callback);\n });\n }\n }\n\n private _setCanvasStyle() {\n if (!this._view) {\n return;\n }\n if (this._container.dom && !isString(this._container.dom)) {\n this._container.dom.style.display = 'block';\n this._container.dom.style.position = 'relative';\n const canvas = this.getCanvas();\n if (canvas) {\n canvas.style.display = 'block';\n }\n }\n }\n\n compile(ctx: { chart: IChart; vChart: VChart }, option: any) {\n const { chart } = ctx;\n this._compileChart = chart;\n this.initView();\n if (!this._view) {\n return;\n }\n\n chart.compile();\n chart.afterCompile();\n this.updateDepend();\n }\n\n clear(ctx: { chart: IChart; vChart: VChart }) {\n const { chart } = ctx;\n chart.clear();\n this.releaseGrammar();\n }\n\n async renderAsync(morphConfig?: IMorphConfig): Promise<any> {\n this.initView();\n if (!this._view) {\n return Promise.reject('srView init fail');\n }\n await this._view?.runNextTick(morphConfig);\n return this;\n }\n\n renderSync(morphConfig?: IMorphConfig): void {\n this.initView();\n if (!this._view) {\n return;\n }\n this._view?.runSync(morphConfig);\n }\n\n updateViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n resize(width: number, height: number, reRender: boolean = true) {\n if (!this._view) {\n return Promise.reject();\n }\n this._width = width;\n this._height = height;\n\n this._view.resize(width, height);\n return reRender ? this.renderAsync({ morph: false }) : this;\n }\n\n setBackground(color: IColor) {\n this._view?.background(color);\n }\n\n setSize(width: number, height: number) {\n this._width = width;\n this._height = height;\n if (!this._view) {\n return;\n }\n\n this._view.width(width);\n this._view.height(height);\n }\n\n setViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n addEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n // TODO: 需要明确一下 interactive 的作用范围,同时考虑是否存在非交互行为的事件以及是否需要生效\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = function (event: any, element: IElement | null) {\n const context = element?.mark?.context ?? {};\n const modelId = isValid(context.modelId) ? context.modelId : null;\n const markId = isValid(context.markId) ? context.markId : null;\n const modelUserId = isValid(context.modelUserId) ? context.modelUserId : null;\n const markUserId = isValid(context.markUserId) ? context.markUserId : null;\n\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: element,\n datum: element?.getDatum?.() || null,\n markId,\n modelId,\n markUserId,\n modelUserId\n };\n callback.call(null, params);\n }.bind(this);\n this._viewListeners.set(callback, { type, callback: wrappedCallback });\n // 如果 view 已经初始化则立刻挂载监听\n // FIXME: 目前 vgrammar 类型声明没有对齐,事件相关类型声明并没有使用 SceneItem\n this._view?.addEventListener(type, wrappedCallback as any);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._windowListeners.set(callback, { type, callback: wrappedCallback });\n const windowObject = this._getGlobalThis();\n windowObject?.addEventListener(type, wrappedCallback);\n } else if (source === Event_Source_Type.canvas) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._canvasListeners.set(callback, { type, callback: wrappedCallback });\n const canvasObject = this.getStage()?.window;\n canvasObject?.addEventListener(type, wrappedCallback);\n }\n }\n\n removeEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = this._viewListeners.get(callback)?.callback;\n wrappedCallback && this._view?.removeEventListener(type, wrappedCallback);\n this._viewListeners.delete(callback);\n } else if (source === Event_Source_Type.window) {\n const windowObject = this._getGlobalThis();\n const wrappedCallback = this._windowListeners.get(callback)?.callback;\n wrappedCallback && windowObject?.removeEventListener(type, wrappedCallback);\n this._windowListeners.delete(callback);\n } else if (source === Event_Source_Type.canvas) {\n const canvasObject = this._getGlobalThis();\n const wrappedCallback = this._canvasListeners.get(callback)?.callback;\n wrappedCallback && canvasObject?.removeEventListener(type, wrappedCallback);\n this._canvasListeners.delete(callback);\n }\n }\n\n protected releaseEvent(): void {\n // 相应的事件remove在model中完成\n this._viewListeners.clear();\n this._windowListeners.clear();\n this._canvasListeners.clear();\n }\n\n release(): void {\n this.releaseEvent();\n this._option = this._container = null as any;\n // vgrammar release\n this._releaseModel();\n this._view?.release();\n this._view = null;\n this.isInited = false;\n this.isReleased = true;\n }\n\n releaseGrammar() {\n this._releaseModel();\n this._view?.removeAllGrammars();\n }\n\n protected _releaseModel() {\n // 释放model\n Object.keys(this._model).forEach(type => {\n Object.values(this._model[type] as IProductMap<IGrammarItem>).forEach(grammarItemMap => {\n Object.values(grammarItemMap).forEach((item: IGrammarItem) => {\n item.removeProduct(true); // 保留 vgrammar 语法元素,下面一起清空\n });\n });\n this._model[type] = {};\n });\n }\n\n /** 添加语法元素 */\n addGrammarItem(grammarItem: IGrammarItem) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n if (isNil(this._model[type][id])) {\n this._model[type][id] = {};\n }\n this._model[type][id][grammarItem.id] = grammarItem;\n }\n\n /** 删除语法元素 */\n removeGrammarItem(grammarItem: IGrammarItem, reserveVGrammarModel?: boolean) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n const map = this._model[type][id];\n if (isValid(map)) {\n delete map[grammarItem.id];\n if (Object.keys(map).length === 0) {\n delete this._model[type][id];\n }\n }\n if (!reserveVGrammarModel) {\n this._view?.removeGrammar(product);\n }\n }\n\n /** 更新语法元素间的依赖关系,返回是否全部成功更新 */\n updateDepend(items?: IGrammarItem[]): boolean {\n if (isValid(items) && items.length > 0) {\n // 局部更新依赖\n return items.every(item => item.updateDepend());\n }\n // 全局更新依赖\n Object.values(this._model).forEach(productMap => {\n Object.values(productMap).forEach(grammarItemMap => {\n const grammarItems = Object.values(grammarItemMap) as IGrammarItem[];\n // 获取编译产物\n const product = grammarItems[0].getProduct();\n\n // 获取编译产物的依赖项\n const dependList = grammarItems\n .reduce((depend, item) => {\n if (item.getDepend().length > 0) {\n return depend.concat(item.getDepend());\n }\n return depend;\n }, [] as IGrammarItem[])\n .filter(grammarItem => !!grammarItem)\n .map(grammarItem => grammarItem.getProduct());\n\n // 更新依赖\n product.depend(dependList);\n });\n });\n return true;\n }\n\n private _getGlobalThis() {\n return isTrueBrowser(this._option.mode) ? globalThis : this.getStage()?.window;\n }\n}\n"]}
|
package/cjs/compile/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compile/util.ts"],"names":[],"mappings":";;;AAEA,0CAAiD;
|
|
1
|
+
{"version":3,"sources":["../src/compile/util.ts"],"names":[],"mappings":";;;AAEA,0CAAiD;AAGjD,SAAgB,YAAY,CAAC,IAAgB;IAC3C,QAAQ,IAAI,EAAE;QACZ,KAAK,qBAAc,CAAC,iBAAiB,CAAC,CAAC;QACvC,KAAK,qBAAc,CAAC,gBAAgB,CAAC;YACnC,OAAO,SAAS,CAAC;QACnB,KAAK,qBAAc,CAAC,IAAI,CAAC;QACzB,KAAK,qBAAc,CAAC,MAAM;YACxB,OAAO,MAAM,CAAC;QAChB,KAAK,qBAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,qBAAc,CAAC,iBAAiB,CAAC;YACpC,OAAO,QAAQ,CAAC;QAClB,KAAK,qBAAc,CAAC,IAAI;YACtB,OAAO,MAAM,CAAC;QAChB,KAAK,qBAAc,CAAC,EAAE;YACpB,OAAO,IAAI,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,oCAiBC","file":"util.js","sourcesContent":["import type { RenderMode } from '../typings/spec';\n// eslint-disable-next-line no-duplicate-imports\nimport { RenderModeEnum } from '../typings/spec';\n\n// TODO: feishu => lark\nexport function toRenderMode(mode: RenderMode): any {\n switch (mode) {\n case RenderModeEnum['desktop-browser']:\n case RenderModeEnum['mobile-browser']:\n return 'browser';\n case RenderModeEnum.node:\n case RenderModeEnum.worker:\n return 'node';\n case RenderModeEnum.miniApp:\n case RenderModeEnum['desktop-miniApp']:\n return 'feishu';\n case RenderModeEnum.lynx:\n return 'lynx';\n case RenderModeEnum.wx:\n return 'wx';\n }\n return 'browser';\n}\n"]}
|
|
@@ -5,7 +5,6 @@ import type { TooltipData, IToolTipActual, TooltipActiveType, ITooltipHandler, I
|
|
|
5
5
|
import type { Tooltip } from '../tooltip';
|
|
6
6
|
import type { ITooltipSpec, TooltipHandlerParams } from '../interface';
|
|
7
7
|
import { TooltipResult } from '../interface';
|
|
8
|
-
import type { ITooltipStyle } from './interface';
|
|
9
8
|
import type { IGroup } from '@visactor/vrender-core';
|
|
10
9
|
import type { Compiler } from '../../../compile/compiler';
|
|
11
10
|
import type { IContainerSize, TooltipAttributes } from '@visactor/vrender-components';
|
|
@@ -22,13 +21,13 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
|
|
|
22
21
|
protected _env: "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "desktop-miniApp" | "lynx";
|
|
23
22
|
get env(): "desktop-browser" | "mobile-browser" | "node" | "worker" | "miniApp" | "wx" | "desktop-miniApp" | "lynx";
|
|
24
23
|
protected _component: Tooltip;
|
|
24
|
+
protected _attributes?: TooltipAttributes | null;
|
|
25
25
|
protected _chartContainer: Maybe<HTMLElement>;
|
|
26
26
|
protected _compiler: Compiler;
|
|
27
27
|
private _cacheViewSpec;
|
|
28
28
|
private _cacheActualTooltip;
|
|
29
|
-
protected _attributeCache?: TooltipAttributes | null;
|
|
30
|
-
protected _style: Partial<ITooltipStyle>;
|
|
31
29
|
protected _container: Maybe<IGroup | HTMLElement>;
|
|
30
|
+
protected _isReleased: boolean;
|
|
32
31
|
constructor(tooltipId: string, component: Tooltip);
|
|
33
32
|
showTooltip: (activeType: TooltipActiveType, data: TooltipData, params: TooltipHandlerParams) => TooltipResult;
|
|
34
33
|
protected changeTooltip: ChangeTooltipFunc;
|
|
@@ -44,7 +43,6 @@ export declare abstract class BaseTooltipHandler implements ITooltipHandler {
|
|
|
44
43
|
protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => IToolTipActual;
|
|
45
44
|
protected _getActualTooltipPosition: (actualTooltip: IToolTipActual, position: TooltipPosition | undefined, positionMode: TooltipPositionMode | undefined, params: TooltipHandlerParams, tooltipParentElement: HTMLElement, changePositionOnly: boolean) => ITooltipPositionActual;
|
|
46
45
|
protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined;
|
|
47
|
-
protected _getStyle(): Partial<ITooltipStyle>;
|
|
48
46
|
protected _getParentElement(spec: ITooltipSpec): HTMLElement;
|
|
49
47
|
getTooltipContainer(): IGroup | HTMLElement;
|
|
50
48
|
protected _initFromSpec(): void;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.BaseTooltipHandler = void 0;
|
|
6
6
|
|
|
7
|
-
const base_1 = require("../../../constant/base"), constants_1 = require("./constants"), typings_1 = require("../../../typings"), util_1 = require("../../../util"), utils_1 = require("./utils"), interface_1 = require("../interface"),
|
|
7
|
+
const base_1 = require("../../../constant/base"), constants_1 = require("./constants"), typings_1 = require("../../../typings"), util_1 = require("../../../util"), utils_1 = require("./utils"), interface_1 = require("../interface"), vutils_1 = require("@visactor/vutils"), attribute_1 = require("./utils/attribute");
|
|
8
8
|
|
|
9
9
|
class BaseTooltipHandler {
|
|
10
10
|
get id() {
|
|
@@ -14,7 +14,8 @@ class BaseTooltipHandler {
|
|
|
14
14
|
return this._env;
|
|
15
15
|
}
|
|
16
16
|
constructor(tooltipId, component) {
|
|
17
|
-
this._visible = !0, this._id = "", this.
|
|
17
|
+
this._visible = !0, this._id = "", this._attributes = null, this._isReleased = !1,
|
|
18
|
+
this.showTooltip = (activeType, data, params) => {
|
|
18
19
|
var _a;
|
|
19
20
|
let changePositionOnly = !!params.changePositionOnly;
|
|
20
21
|
return params.changePositionOnly && (null === (_a = this._cacheActualTooltip) || void 0 === _a ? void 0 : _a.activeType) === activeType || (changePositionOnly = !1,
|
|
@@ -22,7 +23,7 @@ class BaseTooltipHandler {
|
|
|
22
23
|
}, this._changeTooltip = (visible, params, changePositionOnly, activeType, data) => {
|
|
23
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
24
25
|
const tooltipSpec = this._component.getSpec();
|
|
25
|
-
if (!tooltipSpec) return interface_1.TooltipResult.failed;
|
|
26
|
+
if (this._isReleased || !tooltipSpec) return interface_1.TooltipResult.failed;
|
|
26
27
|
if (!visible) return this._cacheViewSpec = void 0, this._cacheActualTooltip = void 0,
|
|
27
28
|
tooltipSpec.handler ? null !== (_c = null === (_b = (_a = tooltipSpec.handler).hideTooltip) || void 0 === _b ? void 0 : _b.call(_a, params)) && void 0 !== _c ? _c : interface_1.TooltipResult.success : (this._updateTooltip(!1, params),
|
|
28
29
|
interface_1.TooltipResult.success);
|
|
@@ -43,6 +44,7 @@ class BaseTooltipHandler {
|
|
|
43
44
|
this._changeTooltipPosition(!!changePositionOnly, actualTooltip, spec, activeType, data, params));
|
|
44
45
|
}, this._changeTooltipPosition = (changePositionOnly, actualTooltip, spec, activeType, data, params) => {
|
|
45
46
|
var _a, _b, _c;
|
|
47
|
+
if (this._isReleased) return interface_1.TooltipResult.failed;
|
|
46
48
|
const event = params.event;
|
|
47
49
|
if (spec.handler) return null !== (_c = null === (_b = (_a = spec.handler).showTooltip) || void 0 === _b ? void 0 : _b.call(_a, activeType, data, params)) && void 0 !== _c ? _c : interface_1.TooltipResult.success;
|
|
48
50
|
const pattern = spec[activeType];
|
|
@@ -227,7 +229,8 @@ class BaseTooltipHandler {
|
|
|
227
229
|
var _a, _b, _c;
|
|
228
230
|
this._cacheViewSpec = void 0, this._cacheActualTooltip = void 0;
|
|
229
231
|
const spec = null !== (_a = this._component.getSpec()) && void 0 !== _a ? _a : {};
|
|
230
|
-
spec.handler ? null === (_c = (_b = spec.handler).release) || void 0 === _c || _c.call(_b) : this._removeTooltip()
|
|
232
|
+
spec.handler ? null === (_c = (_b = spec.handler).release) || void 0 === _c || _c.call(_b) : (this._removeTooltip(),
|
|
233
|
+
this._isReleased = !0);
|
|
231
234
|
}
|
|
232
235
|
_throttle(callback) {
|
|
233
236
|
const tooltipSpec = this._component.getSpec();
|
|
@@ -244,40 +247,14 @@ class BaseTooltipHandler {
|
|
|
244
247
|
});
|
|
245
248
|
}
|
|
246
249
|
_getTooltipBoxSize(actualTooltip, changePositionOnly) {
|
|
247
|
-
var _a, _b, _c, _d;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
_getStyle() {
|
|
255
|
-
var _a, _b, _c, _d, _e;
|
|
256
|
-
const tooltipSpec = this._component.getSpec(), {style: style = {}, enterable: enterable, transitionDuration: transitionDuration} = tooltipSpec, {panel: panel = {}, titleLabel: titleLabel, shape: shape, keyLabel: keyLabel, valueLabel: valueLabel, spaceRow: spaceRow} = style, {backgroundColor: backgroundColor, border: border, shadow: shadow, padding: padding} = panel, panelStyle = {
|
|
257
|
-
lineWidth: null !== (_a = null == border ? void 0 : border.width) && void 0 !== _a ? _a : 0,
|
|
258
|
-
shadow: !!shadow
|
|
259
|
-
};
|
|
260
|
-
(null == border ? void 0 : border.color) && (panelStyle.stroke = border.color),
|
|
261
|
-
backgroundColor && (panelStyle.fill = backgroundColor), shadow && (panelStyle.shadowColor = shadow.color,
|
|
262
|
-
panelStyle.shadowBlur = shadow.blur, panelStyle.shadowOffsetX = shadow.x, panelStyle.shadowOffsetY = shadow.y,
|
|
263
|
-
panelStyle.shadowSpread = shadow.spread);
|
|
264
|
-
const {radius: radius} = null != border ? border : {};
|
|
265
|
-
(0, util_1.isValid)(radius) && (panelStyle.cornerRadius = [ radius, radius, radius, radius ]);
|
|
266
|
-
const globalTheme = null === (_c = (_b = this._chartOption).getTheme) || void 0 === _c ? void 0 : _c.call(_b);
|
|
250
|
+
var _a, _b, _c, _d, _e, _f;
|
|
251
|
+
if (!changePositionOnly || (0, util_1.isNil)(this._attributes)) {
|
|
252
|
+
const globalTheme = null === (_b = (_a = this._chartOption).getTheme) || void 0 === _b ? void 0 : _b.call(_a);
|
|
253
|
+
this._attributes = (0, attribute_1.getTooltipAttributes)(actualTooltip, this._component.getSpec(), globalTheme);
|
|
254
|
+
}
|
|
267
255
|
return {
|
|
268
|
-
panel:
|
|
269
|
-
|
|
270
|
-
shape: {
|
|
271
|
-
fill: !0,
|
|
272
|
-
size: null !== (_d = null == shape ? void 0 : shape.size) && void 0 !== _d ? _d : 8,
|
|
273
|
-
spacing: null !== (_e = null == shape ? void 0 : shape.spacing) && void 0 !== _e ? _e : 6
|
|
274
|
-
},
|
|
275
|
-
key: (0, style_1.getTextAttributes)(keyLabel, globalTheme),
|
|
276
|
-
value: (0, style_1.getTextAttributes)(valueLabel, globalTheme),
|
|
277
|
-
padding: padding,
|
|
278
|
-
spaceRow: spaceRow,
|
|
279
|
-
enterable: enterable,
|
|
280
|
-
transitionDuration: transitionDuration
|
|
256
|
+
width: null === (_d = null === (_c = this._attributes) || void 0 === _c ? void 0 : _c.panel) || void 0 === _d ? void 0 : _d.width,
|
|
257
|
+
height: null === (_f = null === (_e = this._attributes) || void 0 === _e ? void 0 : _e.panel) || void 0 === _f ? void 0 : _f.height
|
|
281
258
|
};
|
|
282
259
|
}
|
|
283
260
|
_getParentElement(spec) {
|
|
@@ -287,7 +264,7 @@ class BaseTooltipHandler {
|
|
|
287
264
|
return this._container;
|
|
288
265
|
}
|
|
289
266
|
_initFromSpec() {
|
|
290
|
-
this._option = this._getDefaultOption(), this.
|
|
267
|
+
this._option = this._getDefaultOption(), this.changeTooltip = this._throttle(this._changeTooltip),
|
|
291
268
|
this.changeTooltipPosition = this._throttle(this._changeTooltipPosition);
|
|
292
269
|
}
|
|
293
270
|
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aAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAE/B,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;CACF;AAnqBD,gDAmqBC","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 } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipPositionMode } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport { isTrueBrowser, isValid, throttle, isNil } from '../../../util';\nimport type {\n TooltipData,\n IToolTipActual,\n TooltipActiveType,\n ITooltipHandler,\n ITooltipPattern,\n ITooltipPositionActual,\n TooltipPosition,\n ITooltipPositionPattern\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 {\n getShowContent,\n getTooltipSpecForShow,\n getActualTooltipPositionValue,\n getTooltipPatternValue,\n getScale,\n getHorizontalPositionType,\n getVerticalPositionType\n} from './utils';\nimport type { Tooltip, TooltipActualTitleContent } from '../tooltip';\nimport type { ISeries } from '../../../series/interface';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipResult } from '../interface';\nimport type { ITooltipPanelStyle, ITooltipStyle } from './interface';\nimport type { IGroup } from '@visactor/vrender-core';\nimport { getTextAttributes } from './utils/style';\nimport type { AABBBounds } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNumber, isObject, isValidNumber } from '@visactor/vutils';\nimport type { IElement } from '@visactor/vgrammar-core';\nimport type { IModel } from '../../../model/interface';\nimport type { Compiler } from '../../../compile/compiler';\nimport type { IContainerSize, TooltipAttributes } from '@visactor/vrender-components';\nimport { getTooltipAttributes } from './utils/attribute';\nimport type { DimensionEventParams } from '../../../event/events/dimension/interface';\nimport type { IChartOption } from '../../../chart/interface';\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 actualTooltip: IToolTipActual,\n spec: ITooltipSpec,\n activeType: TooltipActiveType,\n data: TooltipData,\n params: TooltipHandlerParams\n) => TooltipResult;\n\n/**\n * The tooltip handler class.\n */\nexport abstract class BaseTooltipHandler implements ITooltipHandler {\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 _id = '';\n public get id() {\n return this._id;\n }\n\n protected _env;\n public get env() {\n return this._env;\n }\n\n protected _component: Tooltip;\n\n protected _chartContainer: Maybe<HTMLElement>;\n protected _compiler: Compiler;\n\n private _cacheViewSpec: ITooltipSpec | undefined;\n private _cacheActualTooltip: IToolTipActual | undefined;\n\n protected _attributeCache?: TooltipAttributes | null = null;\n\n protected _style: Partial<ITooltipStyle>;\n\n // tooltip 容器\n protected _container!: Maybe<IGroup | HTMLElement>;\n\n /**\n * Create the tooltip handler.\n */\n constructor(tooltipId: string, component: 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._id = tooltipId; // 可能有多个 tooltip\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._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n }\n\n if (changePositionOnly && this._cacheViewSpec && this._cacheActualTooltip) {\n return this.changeTooltipPosition(\n changePositionOnly,\n this._cacheActualTooltip,\n this._cacheViewSpec,\n activeType,\n data,\n params\n );\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 (!tooltipSpec) {\n return TooltipResult.failed;\n }\n\n /** 关闭 tooltip */\n if (!visible) {\n this._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\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, actualTooltip, spec, activeType!, data!, params);\n };\n\n /** 改变 tooltip 位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltipPosition: ChangeTooltipPositionFunc;\n\n /** 改变 tooltip 位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltipPosition: ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n actualTooltip: IToolTipActual,\n spec: ITooltipSpec,\n activeType: TooltipActiveType,\n data: TooltipData,\n params: TooltipHandlerParams\n ) => {\n const event = params.event as MouseEvent;\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 getTooltipPatternValue(pattern.position, data, params),\n getTooltipPatternValue(pattern.positionMode, data, params),\n params,\n this._getParentElement(spec),\n 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._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n\n const spec = this._component.getSpec() ?? {};\n /** 用户自定义逻辑 */\n if (spec.handler) {\n spec.handler.release?.();\n return;\n }\n /** 默认逻辑 */\n this._removeTooltip();\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 };\n\n return actualTooltip;\n };\n\n /**\n * 计算实际的 tooltip 位置\n * @param actualTooltip\n * @param position\n * @param event\n * @returns\n */\n protected _getActualTooltipPosition = (\n actualTooltip: IToolTipActual,\n position: TooltipPosition | undefined,\n positionMode: TooltipPositionMode | undefined,\n params: TooltipHandlerParams,\n tooltipParentElement: HTMLElement,\n changePositionOnly: boolean\n ): ITooltipPositionActual => {\n const event = params.event as MouseEvent;\n const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } =\n this._getTooltipBoxSize(actualTooltip, changePositionOnly) ?? {};\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n const { offsetX, offsetY } = this._option;\n const tooltipSpec = this._component.getSpec();\n if (!tooltipSpec) {\n return invalidPosition;\n }\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 if (isObject(position)) {\n const { left: posLeft, right: posRight, top: posTop, bottom: posBottom } = position as ITooltipPositionPattern;\n left = getActualTooltipPositionValue(posLeft, event);\n top = getActualTooltipPositionValue(posTop, event);\n right = getActualTooltipPositionValue(posRight, event);\n bottom = getActualTooltipPositionValue(posBottom, event);\n } else if (\n isValid(position) &&\n positionMode !== TooltipPositionMode.pointer &&\n actualTooltip.activeType === 'mark'\n ) {\n isFixedPosition = true;\n const element = params.item as IElement;\n const model = params.model as IModel;\n const bounds = element?.getBounds() as AABBBounds;\n const startPoint = model?.getLayoutStartPoint();\n if (bounds && startPoint) {\n let { x1, y1, x2, y2 } = bounds;\n x1 += startPoint.x;\n x2 += startPoint.x;\n y1 += startPoint.y;\n y2 += startPoint.y;\n switch (getHorizontalPositionType(position)) {\n case 'left':\n left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n left = x2 + offsetX;\n break;\n case 'middle':\n left = (x1 + x2) / 2 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n }\n switch (getVerticalPositionType(position)) {\n case 'top':\n top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n top = y2 + offsetY;\n break;\n case 'middle':\n top = (y1 + y2) / 2 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n }\n }\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(position as TooltipFixedPosition, 'right')) {\n case 'middle':\n x = x0 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'left':\n x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\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(position as TooltipFixedPosition, 'bottom')) {\n case 'middle':\n y = y0 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'top':\n y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\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') === 'middle') {\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') === 'middle') {\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') === 'middle') {\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') === 'middle') {\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 'middle':\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 'middle':\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 return { x, y };\n };\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!changePositionOnly || isNil(this._attributeCache)) {\n this._attributeCache = getTooltipAttributes(actualTooltip, this._style);\n }\n return {\n width: this._attributeCache?.panel?.width,\n height: this._attributeCache?.panel?.height\n };\n }\n\n protected _getStyle(): Partial<ITooltipStyle> {\n const tooltipSpec = this._component.getSpec();\n const { style = {}, enterable, transitionDuration } = tooltipSpec as ITooltipSpec;\n\n const { panel = {}, titleLabel, shape, keyLabel, valueLabel, spaceRow } = style;\n const { backgroundColor, border, shadow, padding } = panel;\n\n // tooltip background style\n const panelStyle: ITooltipPanelStyle = {\n lineWidth: border?.width ?? 0,\n shadow: !!shadow\n };\n if (border?.color) {\n panelStyle.stroke = border.color as string;\n }\n if (backgroundColor) {\n panelStyle.fill = backgroundColor as string;\n }\n\n if (shadow) {\n panelStyle.shadowColor = shadow.color as string;\n panelStyle.shadowBlur = shadow.blur;\n panelStyle.shadowOffsetX = shadow.x;\n panelStyle.shadowOffsetY = shadow.y;\n panelStyle.shadowSpread = shadow.spread;\n }\n const { radius } = border ?? {};\n if (isValid(radius)) {\n panelStyle.cornerRadius = [radius, radius, radius, radius];\n }\n\n const globalTheme = this._chartOption.getTheme?.();\n\n return {\n panel: panelStyle,\n title: getTextAttributes(titleLabel, globalTheme),\n shape: {\n fill: true,\n size: shape?.size ?? 8,\n spacing: shape?.spacing ?? 6\n },\n key: getTextAttributes(keyLabel, globalTheme),\n value: getTextAttributes(valueLabel, globalTheme),\n padding,\n spaceRow,\n enterable,\n transitionDuration\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 this._style = this._getStyle();\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/component/tooltip/handler/base.ts"],"names":[],"mappings":";;;AAAA,iDAAmF;AAGnF,2CAA8C;AAG9C,8CAAuD;AAEvD,wCAAwE;AAcxE,mCAQiB;AAKjB,4CAA6C;AAI7C,6CAAqE;AAKrE,iDAAyD;AAwBzD,MAAsB,kBAAkB;IAatC,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAmBD,YAAY,SAAiB,EAAE,SAAkB;QAnCvC,aAAQ,GAAG,IAAI,CAAC;QAQhB,QAAG,GAAG,EAAE,CAAC;QAWT,gBAAW,GAA8B,IAAI,CAAC;QAW9C,gBAAW,GAAY,KAAK,CAAC;QAevC,gBAAW,GAAG,CAAC,UAA6B,EAAE,IAAiB,EAAE,MAA4B,EAAE,EAAE;;YAC/F,IAAI,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC;YACrD,IAAI,CAAC,MAAM,CAAC,kBAAkB,IAAI,CAAA,MAAA,IAAI,CAAC,mBAAmB,0CAAE,UAAU,MAAK,UAAU,EAAE;gBACrF,kBAAkB,GAAG,KAAK,CAAC;gBAC3B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;g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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;CACF;AAtnBD,gDAsnBC","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 } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipPositionMode } from '../../../typings';\n// eslint-disable-next-line no-duplicate-imports\nimport { isTrueBrowser, isValid, throttle, isNil } from '../../../util';\nimport type {\n TooltipData,\n IToolTipActual,\n TooltipActiveType,\n ITooltipHandler,\n ITooltipPattern,\n ITooltipPositionActual,\n TooltipPosition,\n ITooltipPositionPattern\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 {\n getShowContent,\n getTooltipSpecForShow,\n getActualTooltipPositionValue,\n getTooltipPatternValue,\n getScale,\n getHorizontalPositionType,\n getVerticalPositionType\n} from './utils';\nimport type { Tooltip, TooltipActualTitleContent } from '../tooltip';\nimport type { ISeries } from '../../../series/interface';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { TooltipResult } from '../interface';\nimport type { IGroup } from '@visactor/vrender-core';\nimport type { AABBBounds } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNumber, isObject, isValidNumber } from '@visactor/vutils';\nimport type { IElement } from '@visactor/vgrammar-core';\nimport type { IModel } from '../../../model/interface';\nimport type { Compiler } from '../../../compile/compiler';\nimport type { IContainerSize, TooltipAttributes } from '@visactor/vrender-components';\nimport { getTooltipAttributes } from './utils/attribute';\nimport type { DimensionEventParams } from '../../../event/events/dimension/interface';\nimport type { IChartOption } from '../../../chart/interface';\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 actualTooltip: IToolTipActual,\n spec: ITooltipSpec,\n activeType: TooltipActiveType,\n data: TooltipData,\n params: TooltipHandlerParams\n) => TooltipResult;\n\n/**\n * The tooltip handler class.\n */\nexport abstract class BaseTooltipHandler implements ITooltipHandler {\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 _id = '';\n public get id() {\n return this._id;\n }\n\n protected _env;\n public get env() {\n return this._env;\n }\n\n protected _component: Tooltip;\n protected _attributes?: TooltipAttributes | null = null;\n\n protected _chartContainer: Maybe<HTMLElement>;\n protected _compiler: Compiler;\n\n private _cacheViewSpec: ITooltipSpec | undefined;\n private _cacheActualTooltip: IToolTipActual | undefined;\n\n // tooltip 容器\n protected _container!: Maybe<IGroup | HTMLElement>;\n\n protected _isReleased: boolean = false;\n\n /**\n * Create the tooltip handler.\n */\n constructor(tooltipId: string, component: 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._id = tooltipId; // 可能有多个 tooltip\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._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n }\n\n if (changePositionOnly && this._cacheViewSpec && this._cacheActualTooltip) {\n return this.changeTooltipPosition(\n changePositionOnly,\n this._cacheActualTooltip,\n this._cacheViewSpec,\n activeType,\n data,\n params\n );\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._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\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, actualTooltip, spec, activeType!, data!, params);\n };\n\n /** 改变 tooltip 位置(带 throttle 版本),返回是否遇到异常 */\n protected changeTooltipPosition: ChangeTooltipPositionFunc;\n\n /** 改变 tooltip 位置(不带 throttle 版本),返回是否遇到异常 */\n protected _changeTooltipPosition: ChangeTooltipPositionFunc = (\n changePositionOnly: boolean,\n actualTooltip: IToolTipActual,\n spec: ITooltipSpec,\n activeType: TooltipActiveType,\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\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 getTooltipPatternValue(pattern.position, data, params),\n getTooltipPatternValue(pattern.positionMode, data, params),\n params,\n this._getParentElement(spec),\n 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._cacheViewSpec = undefined;\n this._cacheActualTooltip = undefined;\n\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 /* -----需要子类继承的方法开始----- */\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 };\n\n return actualTooltip;\n };\n\n /**\n * 计算实际的 tooltip 位置\n * @param actualTooltip\n * @param position\n * @param event\n * @returns\n */\n protected _getActualTooltipPosition = (\n actualTooltip: IToolTipActual,\n position: TooltipPosition | undefined,\n positionMode: TooltipPositionMode | undefined,\n params: TooltipHandlerParams,\n tooltipParentElement: HTMLElement,\n changePositionOnly: boolean\n ): ITooltipPositionActual => {\n const event = params.event as MouseEvent;\n const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } =\n this._getTooltipBoxSize(actualTooltip, changePositionOnly) ?? {};\n\n const invalidPosition = {\n x: Infinity,\n y: Infinity\n };\n\n const { offsetX, offsetY } = this._option;\n const tooltipSpec = this._component.getSpec();\n if (!tooltipSpec) {\n return invalidPosition;\n }\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 if (isObject(position)) {\n const { left: posLeft, right: posRight, top: posTop, bottom: posBottom } = position as ITooltipPositionPattern;\n left = getActualTooltipPositionValue(posLeft, event);\n top = getActualTooltipPositionValue(posTop, event);\n right = getActualTooltipPositionValue(posRight, event);\n bottom = getActualTooltipPositionValue(posBottom, event);\n } else if (\n isValid(position) &&\n positionMode !== TooltipPositionMode.pointer &&\n actualTooltip.activeType === 'mark'\n ) {\n isFixedPosition = true;\n const element = params.item as IElement;\n const model = params.model as IModel;\n const bounds = element?.getBounds() as AABBBounds;\n const startPoint = model?.getLayoutStartPoint();\n if (bounds && startPoint) {\n let { x1, y1, x2, y2 } = bounds;\n x1 += startPoint.x;\n x2 += startPoint.x;\n y1 += startPoint.y;\n y2 += startPoint.y;\n switch (getHorizontalPositionType(position)) {\n case 'left':\n left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\n left = x2 + offsetX;\n break;\n case 'middle':\n left = (x1 + x2) / 2 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n }\n switch (getVerticalPositionType(position)) {\n case 'top':\n top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\n top = y2 + offsetY;\n break;\n case 'middle':\n top = (y1 + y2) / 2 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n }\n }\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(position as TooltipFixedPosition, 'right')) {\n case 'middle':\n x = x0 - (tooltipBoxWidth * tooltipSizeScale) / 2;\n break;\n case 'left':\n x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;\n break;\n case 'right':\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(position as TooltipFixedPosition, 'bottom')) {\n case 'middle':\n y = y0 - (tooltipBoxHeight * tooltipSizeScale) / 2;\n break;\n case 'top':\n y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;\n break;\n case 'bottom':\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') === 'middle') {\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') === 'middle') {\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') === 'middle') {\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') === 'middle') {\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 'middle':\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 'middle':\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 return { x, y };\n };\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: IToolTipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!changePositionOnly || isNil(this._attributes)) {\n const globalTheme = this._chartOption.getTheme?.();\n this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), globalTheme);\n }\n return {\n width: this._attributes?.panel?.width,\n height: this._attributes?.panel?.height\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"]}
|
|
@@ -27,7 +27,7 @@ class CanvasTooltipHandler extends base_1.BaseTooltipHandler {
|
|
|
27
27
|
layerCanvas.style.pointerEvents = "none"), this._layer;
|
|
28
28
|
}
|
|
29
29
|
_removeTooltip() {
|
|
30
|
-
this._layer && this._layer.removeAllChild(), this.
|
|
30
|
+
this._layer && this._layer.removeAllChild(), this._attributes = null;
|
|
31
31
|
}
|
|
32
32
|
_updateTooltip(visible, params, actualTooltip) {
|
|
33
33
|
this._visible = visible;
|
|
@@ -39,7 +39,7 @@ class CanvasTooltipHandler extends base_1.BaseTooltipHandler {
|
|
|
39
39
|
})));
|
|
40
40
|
this._tooltipComponent || this._initTooltipComponent(stage);
|
|
41
41
|
const pos = null == actualTooltip ? void 0 : actualTooltip.position;
|
|
42
|
-
params.changePositionOnly ? (0, vutils_1.isValid)(pos) && this._tooltipComponent.setAttributes(pos) : this._tooltipComponent.setAttributes(Object.assign(Object.assign({}, this.
|
|
42
|
+
params.changePositionOnly ? (0, vutils_1.isValid)(pos) && this._tooltipComponent.setAttributes(pos) : this._tooltipComponent.setAttributes(Object.assign(Object.assign({}, this._attributes), pos)),
|
|
43
43
|
this._tooltipComponent.attribute.visible || (this._tooltipComponent.showAll(), this._tooltipComponent.setAttributes({
|
|
44
44
|
visibleAll: !0
|
|
45
45
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/tooltip/handler/canvas/canvas-tooltip-handler.ts"],"names":[],"mappings":";;;AAGA,kCAA6C;AAC7C,qEAA2E;AAC3E,6CAA2C;AAC3C,4CAAkD;AAMlD,MAAa,oBAAqB,SAAQ,yBAAkB;IAQ1D,YAAY,SAAiB,EAAE,SAAkB;;QAC/C,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAR9B,SAAI,GAAG,8BAAkB,CAAC,MAAM,CAAC;QAS/B,IAAI,CAAC,gBAAgB,GAAG,MAAC,IAAI,CAAC,YAAY,CAAC,UAAkB,0CAAE,eAAe,CAAC;IACjF,CAAC;IAEO,qBAAqB,CAAC,KAAY;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,IAAI,4BAAgB,CAAC;YAC5C,qBAAqB,EAAE,KAAK;YAC5B,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAqC,CAAC,CAAC;IACxD,CAAC;IAEO,SAAS,CAAC,KAAY;QAC5B,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,OAAO,IAAI,CAAC,MAAM,CAAC;SACpB;QAED,IAAI,CAA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BAAb,aAAa,CAAE,QAAQ,CAAC;QACpC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE;YAC9B,IAAI,CAAC,iBAAiB,CAAC,aAAa,iCAC/B,IAAI,CAAC,WAAW,GAChB,GAAG,EACN,CAAC;SACJ;aAAM,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC,EAAE;YACvB,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;SAC3C;QAED,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE;YAC7C,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;gBACnC,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;SACJ;IACH,CAAC;IAED,cAAc;;QACZ,OAAO,MAAA,IAAI,CAAC,iBAAiB,0CAAE,SAAS,CAAC,UAAU,CAAC;IACtD,CAAC;IAED,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AAhGD,oDAgGC","file":"canvas-tooltip-handler.js","sourcesContent":["import type { ILayer, INode, Stage } from '@visactor/vrender-core';\nimport type { IToolTipActual } from '../../../../typings/tooltip';\nimport type { TooltipHandlerParams } from '../../interface';\nimport { BaseTooltipHandler } from '../base';\nimport { Tooltip as TooltipComponent } from '@visactor/vrender-components';\nimport { isValid } from '@visactor/vutils';\nimport { TooltipHandlerType } from '../constants';\nimport type { Tooltip } from '../../tooltip';\n\n/**\n * The tooltip handler class.\n */\nexport class CanvasTooltipHandler extends BaseTooltipHandler {\n type = TooltipHandlerType.canvas;\n\n private _layer: ILayer;\n protected _el?: HTMLCanvasElement;\n protected _tooltipCanvasId?: string;\n protected _tooltipComponent: TooltipComponent;\n\n constructor(tooltipId: string, component: Tooltip) {\n super(tooltipId, component);\n this._tooltipCanvasId = (this._chartOption.modeParams as any)?.tooltipCanvasId;\n }\n\n private _initTooltipComponent(stage: Stage) {\n const layer = this._getLayer(stage);\n this._tooltipComponent = new TooltipComponent({\n autoCalculatePosition: false,\n autoMeasure: false\n });\n layer.add(this._tooltipComponent as unknown as INode);\n }\n\n private _getLayer(stage: Stage) {\n if (this._layer) {\n return this._layer;\n }\n\n this._layer = stage.createLayer(this._tooltipCanvasId);\n\n // 需要关闭 layer 对应的 canvas 的事件\n const layerCanvas = this._layer.layerHandler.canvas.nativeCanvas as HTMLCanvasElement;\n // TODO:待 vrender 支持\n if (layerCanvas && layerCanvas.style) {\n layerCanvas.style.touchAction = 'none';\n layerCanvas.style.pointerEvents = 'none';\n }\n\n return this._layer;\n }\n\n protected _removeTooltip() {\n if (this._layer) {\n this._layer.removeAllChild();\n // this._layer.render();\n }\n this._attributes = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual) {\n this._visible = visible;\n\n const stage = this._compiler.getStage();\n if (!stage) {\n return;\n }\n\n if (!visible) {\n if (this._tooltipComponent && this._tooltipComponent.attribute.visible) {\n this._tooltipComponent.hideAll();\n this._tooltipComponent.setAttributes({\n visibleAll: false\n });\n }\n return;\n }\n\n if (!this._tooltipComponent) {\n this._initTooltipComponent(stage);\n }\n\n const pos = actualTooltip?.position;\n if (!params.changePositionOnly) {\n this._tooltipComponent.setAttributes({\n ...this._attributes,\n ...pos\n });\n } else if (isValid(pos)) {\n this._tooltipComponent.setAttributes(pos);\n }\n\n if (!this._tooltipComponent.attribute.visible) {\n this._tooltipComponent.showAll();\n this._tooltipComponent.setAttributes({\n visibleAll: true\n });\n }\n }\n\n isTooltipShown() {\n return this._tooltipComponent?.attribute.visibleAll;\n }\n\n release() {\n super.release();\n this._layer?.release();\n }\n}\n"]}
|
|
@@ -32,7 +32,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
|
|
|
32
32
|
valueToHtml: this._option.sanitize,
|
|
33
33
|
getTooltipStyle: () => this._domStyle,
|
|
34
34
|
getTooltipActual: () => this._tooltipActual,
|
|
35
|
-
getTooltipAttributes: () => this.
|
|
35
|
+
getTooltipAttributes: () => this._attributes
|
|
36
36
|
}, [ tooltipSpec.className ], this.id);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -50,7 +50,7 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
|
|
|
50
50
|
} else this.setVisibility(visible);
|
|
51
51
|
}
|
|
52
52
|
_initStyle() {
|
|
53
|
-
this._domStyle = (0, util_1.getDomStyles)(this.
|
|
53
|
+
this._domStyle = (0, util_1.getDomStyles)(this._attributes);
|
|
54
54
|
}
|
|
55
55
|
_getParentElement(spec) {
|
|
56
56
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/tooltip/handler/dom/dom-tooltip-handler.ts"],"names":[],"mappings":";;;AAEA,kCAA6C;AAC7C,iCAAsC;AAEtC,yDAAqD;AACrD,4CAAmF;AAGnF,8CAAmD;AAKnD,MAAa,iBAAkB,SAAQ,yBAAkB;IAUvD,aAAa;;QACX,OAAO,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,aAAa,EAAE,CAAA,CAAC;IACvC,CAAC;IAED,aAAa,CAAC,MAAe;;QAE3B,IAAI,MAAM,KAAK,IAAI,CAAC,aAAa,EAAE,EAAE;YACnC,MAAA,IAAI,CAAC,KAAK,0CAAE,aAAa,CAAC,MAAM,CAAC,CAAC;SACnC;IACH,CAAC;IAED,YAAY,SAAiB,EAAE,SAAkB;QAC/C,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QArB9B,SAAI,GAAG,8BAAkB,CAAC,GAAG,CAAC;QAEpB,sBAAiB,GAAG,iBAAW,aAAX,iBAAW,uBAAX,iBAAW,CAAE,IAAI,CAAC;QAoB9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,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AC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,MAAA,aAAa,CAAC,QAAQ,mCAAI,EAAE,CAAC;YACtD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC9B,IAAI,EAAE,EAAE;gBAEN,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;aACvD;SACF;IACH,CAAC;IAES,UAAU;QAClB,IAAI,CAAC,SAAS,GAAG,IAAA,mBAAY,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;IAES,iBAAiB,CAAC,IAAkB;;QAC5C,OAAO,MAAA,IAAI,CAAC,UAAU,mCAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CACF;AAtGD,8CAsGC","file":"dom-tooltip-handler.js","sourcesContent":["import type { IToolTipActual } from '../../../../typings/tooltip';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../interface';\nimport { BaseTooltipHandler } from '../base';\nimport { getDomStyles } from './util';\nimport type { IDomTooltipStyle } from './interface';\nimport { TooltipModel } from './model/tooltip-model';\nimport { TOOLTIP_CONTAINER_EL_CLASS_NAME, TooltipHandlerType } from '../constants';\nimport type { Tooltip } from '../../tooltip';\nimport type { Maybe } from '@visactor/vutils';\nimport { domDocument } from '../../../../util/env';\n\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: IDomTooltipStyle;\n protected _tooltipActual?: IToolTipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n protected model: TooltipModel;\n\n getVisibility() {\n return !!this.model?.getVisibility();\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility()) {\n this.model?.setVisibility(_value);\n }\n }\n\n constructor(tooltipId: string, component: Tooltip) {\n super(tooltipId, component);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec();\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n this.model = new TooltipModel(\n this._container,\n {\n valueToHtml: this._option.sanitize,\n getTooltipStyle: () => this._domStyle,\n getTooltipActual: () => this._tooltipActual,\n getTooltipAttributes: () => this._attributes\n },\n [tooltipSpec.className],\n this.id\n );\n }\n }\n\n protected _removeTooltip() {\n this.model?.release();\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams, actualTooltip: IToolTipActual) {\n if (!visible || !this.model) {\n this.setVisibility(visible);\n } else {\n if (!params.changePositionOnly) {\n this._tooltipActual = actualTooltip;\n this._initStyle();\n\n this.model.initAll();\n this.model.setStyle();\n this.model.setContent();\n }\n this.setVisibility(visible);\n\n // 位置\n const { x = 0, y = 0 } = actualTooltip.position ?? {};\n const el = this.model.product;\n if (el) {\n // https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n el.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n }\n }\n }\n\n protected _initStyle() {\n this._domStyle = getDomStyles(this._attributes);\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n }\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Maybe } from '@visactor/vutils';
|
|
2
|
-
import type { ITooltipStyle } from '../interface';
|
|
3
2
|
import type { IDomTooltipStyle } from './interface';
|
|
4
3
|
import type { TooltipAttributes } from '@visactor/vrender-components';
|
|
5
4
|
export declare const getPixelPropertyStr: (num?: number | number[], defaultStr?: string) => string;
|
|
6
5
|
export declare const pixelPropertyStrToNumber: (str: string) => number | number[];
|
|
7
|
-
export declare function getDomStyles(
|
|
6
|
+
export declare function getDomStyles(attributes?: Maybe<TooltipAttributes>): IDomTooltipStyle;
|