@visactor/vchart 2.0.4-alpha.6 → 2.0.5-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +1494 -83
  3. package/build/index.js +1495 -82
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/range-area/range-area-transformer.js +2 -1
  7. package/cjs/chart/range-area/range-area-transformer.js.map +1 -1
  8. package/cjs/compile/compiler.js +4 -3
  9. package/cjs/compile/compiler.js.map +1 -1
  10. package/cjs/component/data-zoom/data-filter-base-component.d.ts +2 -0
  11. package/cjs/component/data-zoom/data-filter-base-component.js +15 -5
  12. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  13. package/cjs/component/data-zoom/interface.d.ts +1 -0
  14. package/cjs/component/data-zoom/interface.js.map +1 -1
  15. package/cjs/component/marker/mark-point/cartesian-mark-point.js +2 -2
  16. package/cjs/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
  17. package/cjs/core/factory.d.ts +4 -0
  18. package/cjs/core/factory.js +8 -2
  19. package/cjs/core/factory.js.map +1 -1
  20. package/cjs/core/index.d.ts +1 -1
  21. package/cjs/core/index.js +1 -1
  22. package/cjs/core/index.js.map +1 -1
  23. package/cjs/core/interface.d.ts +2 -0
  24. package/cjs/core/interface.js.map +1 -1
  25. package/cjs/core/vchart.d.ts +1 -0
  26. package/cjs/core/vchart.js +4 -1
  27. package/cjs/core/vchart.js.map +1 -1
  28. package/cjs/index.d.ts +1 -0
  29. package/cjs/index.js +11 -11
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/grid-layout/grid-layout.js +2 -0
  32. package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
  33. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  34. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +17 -17
  35. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  36. package/cjs/plugin/vchart/index.d.ts +2 -0
  37. package/cjs/plugin/vchart/index.js +21 -0
  38. package/cjs/plugin/vchart/index.js.map +1 -0
  39. package/cjs/plugin/vchart/interface.d.ts +16 -0
  40. package/cjs/plugin/vchart/interface.js +6 -0
  41. package/cjs/plugin/vchart/interface.js.map +1 -0
  42. package/cjs/plugin/vchart/plugin-service.d.ts +9 -0
  43. package/cjs/plugin/vchart/plugin-service.js +24 -0
  44. package/cjs/plugin/vchart/plugin-service.js.map +1 -0
  45. package/cjs/plugin/vchart/register.d.ts +2 -0
  46. package/cjs/plugin/vchart/register.js +12 -0
  47. package/cjs/plugin/vchart/register.js.map +1 -0
  48. package/cjs/plugin/vchart/rotate/index.d.ts +1 -0
  49. package/cjs/plugin/vchart/rotate/index.js +21 -0
  50. package/cjs/plugin/vchart/rotate/index.js.map +1 -0
  51. package/cjs/plugin/vchart/rotate/rotate.d.ts +18 -0
  52. package/cjs/plugin/vchart/rotate/rotate.js +67 -0
  53. package/cjs/plugin/vchart/rotate/rotate.js.map +1 -0
  54. package/cjs/series/word-cloud/base.js +4 -0
  55. package/cjs/series/word-cloud/base.js.map +1 -1
  56. package/cjs/typings/spec/common.d.ts +1 -0
  57. package/cjs/typings/spec/common.js.map +1 -1
  58. package/esm/chart/range-area/range-area-transformer.js +2 -1
  59. package/esm/chart/range-area/range-area-transformer.js.map +1 -1
  60. package/esm/compile/compiler.js +4 -3
  61. package/esm/compile/compiler.js.map +1 -1
  62. package/esm/component/data-zoom/data-filter-base-component.d.ts +2 -0
  63. package/esm/component/data-zoom/data-filter-base-component.js +16 -6
  64. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  65. package/esm/component/data-zoom/interface.d.ts +1 -0
  66. package/esm/component/data-zoom/interface.js.map +1 -1
  67. package/esm/component/marker/mark-point/cartesian-mark-point.js +2 -2
  68. package/esm/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
  69. package/esm/core/factory.d.ts +4 -0
  70. package/esm/core/factory.js +8 -1
  71. package/esm/core/factory.js.map +1 -1
  72. package/esm/core/index.d.ts +1 -1
  73. package/esm/core/index.js +1 -1
  74. package/esm/core/index.js.map +1 -1
  75. package/esm/core/interface.d.ts +2 -0
  76. package/esm/core/interface.js.map +1 -1
  77. package/esm/core/vchart.d.ts +1 -0
  78. package/esm/core/vchart.js +5 -0
  79. package/esm/core/vchart.js.map +1 -1
  80. package/esm/index.d.ts +1 -0
  81. package/esm/index.js +2 -0
  82. package/esm/index.js.map +1 -1
  83. package/esm/layout/grid-layout/grid-layout.js +2 -0
  84. package/esm/layout/grid-layout/grid-layout.js.map +1 -1
  85. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  86. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +17 -17
  87. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  88. package/esm/plugin/vchart/index.d.ts +2 -0
  89. package/esm/plugin/vchart/index.js +4 -0
  90. package/esm/plugin/vchart/index.js.map +1 -0
  91. package/esm/plugin/vchart/interface.d.ts +16 -0
  92. package/esm/plugin/vchart/interface.js +2 -0
  93. package/esm/plugin/vchart/interface.js.map +1 -0
  94. package/esm/plugin/vchart/plugin-service.d.ts +9 -0
  95. package/esm/plugin/vchart/plugin-service.js +16 -0
  96. package/esm/plugin/vchart/plugin-service.js.map +1 -0
  97. package/esm/plugin/vchart/register.d.ts +2 -0
  98. package/esm/plugin/vchart/register.js +6 -0
  99. package/esm/plugin/vchart/register.js.map +1 -0
  100. package/esm/plugin/vchart/rotate/index.d.ts +1 -0
  101. package/esm/plugin/vchart/rotate/index.js +2 -0
  102. package/esm/plugin/vchart/rotate/index.js.map +1 -0
  103. package/esm/plugin/vchart/rotate/rotate.d.ts +18 -0
  104. package/esm/plugin/vchart/rotate/rotate.js +62 -0
  105. package/esm/plugin/vchart/rotate/rotate.js.map +1 -0
  106. package/esm/series/word-cloud/base.js +4 -0
  107. package/esm/series/word-cloud/base.js.map +1 -1
  108. package/esm/typings/spec/common.d.ts +1 -0
  109. package/esm/typings/spec/common.js.map +1 -1
  110. package/package.json +8 -8
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAAsC;AAEtC,kBAAe,mBAAM,CAAC;AAEtB,yCAAuB;AAGvB,0CAAwB;AACxB,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,2CAAyB;AACzB,yCAAuB;AACvB,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AAExB,iDAA+B;AAC/B,sEAAoD;AACpD,gEAA8C;AAC9C,iDAA+B;AAC/B,4DAA0C;AAC1C,kDAAgC;AAEhC,8CAA4B;AAC5B,wDAAsC;AACtC,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAG7B,mDAAiC;AACjC,iEAA+C;AAC/C,8CAA4B;AAC5B,gDAA8B","file":"index.js","sourcesContent":["import { VChart } from './vchart-all';\n\nexport default VChart;\n\nexport * from './core';\n\n// chart model for extension\nexport * from './chart';\nexport * from './chart/base';\nexport * from './chart/cartesian';\nexport * from './chart/common';\nexport * from './series';\nexport * from './mark';\nexport * from './component';\nexport * from './layout';\nexport * from './env';\nexport * from './event';\n// plugin路径太深,如果直接引用,会导致tree-shaking失效\nexport * from './plugin/chart';\nexport * from './plugin/components/tooltip-handler';\nexport * from './plugin/components/axis-sync';\nexport * from './plugin/other';\nexport * from './plugin/base/base-plugin';\nexport * from './vrender-tools';\n// util\nexport * from './util/data';\nexport * from './util/spec/transform';\nexport * from './util/mark';\nexport * from './util/region';\nexport * from './util/scale';\n\n// base component model for extension\nexport * from './component/base';\nexport * from './compile/data/compilable-data';\nexport * from './animation';\nexport * from './interaction';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAAsC;AAEtC,kBAAe,mBAAM,CAAC;AAEtB,yCAAuB;AAGvB,0CAAwB;AACxB,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,yCAAuB;AACvB,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AAExB,iDAA+B;AAC/B,sEAAoD;AACpD,gEAA8C;AAC9C,iDAA+B;AAC/B,4DAA0C;AAC1C,kDAAgC;AAEhC,8CAA4B;AAC5B,wDAAsC;AACtC,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAG7B,mDAAiC;AACjC,iEAA+C;AAC/C,8CAA4B;AAC5B,gDAA8B","file":"index.js","sourcesContent":["import { VChart } from './vchart-all';\n\nexport default VChart;\n\nexport * from './core';\n\n// chart model for extension\nexport * from './chart';\nexport * from './chart/base';\nexport * from './chart/cartesian';\nexport * from './chart/common';\nexport * from './chart/stack';\nexport * from './series';\nexport * from './mark';\nexport * from './component';\nexport * from './layout';\nexport * from './env';\nexport * from './event';\n// plugin路径太深,如果直接引用,会导致tree-shaking失效\nexport * from './plugin/chart';\nexport * from './plugin/components/tooltip-handler';\nexport * from './plugin/components/axis-sync';\nexport * from './plugin/other';\nexport * from './plugin/base/base-plugin';\nexport * from './vrender-tools';\n// util\nexport * from './util/data';\nexport * from './util/spec/transform';\nexport * from './util/mark';\nexport * from './util/region';\nexport * from './util/scale';\n\n// base component model for extension\nexport * from './component/base';\nexport * from './compile/data/compilable-data';\nexport * from './animation';\nexport * from './interaction';\n"]}
@@ -55,6 +55,8 @@ class GridLayout {
55
55
  }));
56
56
  }
57
57
  clearLayoutSize() {
58
+ this._gridInfo.colWidth && this.setSizeFromUserSetting(this._gridInfo.colWidth, this._colSize, this._col, this._chartLayoutRect.width),
59
+ this._gridInfo.rowHeight && this.setSizeFromUserSetting(this._gridInfo.rowHeight, this._rowSize, this._row, this._chartLayoutRect.height),
58
60
  this._colSize.forEach((c => {
59
61
  c.isLayoutSetting = !1, c.isUserSetting || (c.value = 0);
60
62
  })), this._rowSize.forEach((r => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/layout/grid-layout/grid-layout.ts"],"names":[],"mappings":";;;AAIA,6CAAsE;AAEtE,gDAA6C;AAQ7C,MAAa,UAAU;IAmBrB,YAAY,QAAyB,EAAE,GAAoB;QAjBnD,qBAAgB,GAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAG5D,SAAI,GAAW,CAAC,CAAC;QACjB,SAAI,GAAW,CAAC,CAAC;QASjB,gBAAW,GAAkC,IAAI,GAAG,EAAE,CAAC;QAK/D,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC;QAE7B,IAAI,CAAC,eAAe,EAAE,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Aa,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC/B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,CAAC,aAAa,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE7D,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;;AA5VH,gCA6VC;AA5VQ,eAAI,GAAG,MAAM,CAAC;AA8VvB,SAAS,SAAS,CAAC,IAAiB;IAClC,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC;AACvE,CAAC;AAEM,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,iBAAO,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B","file":"grid-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../../typings/params';\nimport type { IChart } from '../../chart/interface/chart';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, IGridLayoutSpec, ElementSpec, ILayoutItem } from '../interface';\nimport { isFunction, isValid, isValidNumber } from '@visactor/vutils';\nimport type { IRect } from '../../typings/space';\nimport { Factory } from '../../core/factory';\n\ntype GridSize = {\n value: number;\n isUserSetting: boolean;\n isLayoutSetting: boolean;\n};\n\nexport class GridLayout implements IBaseLayout {\n static type = 'grid';\n private _chartLayoutRect: IRect = { x: 0, y: 0, width: 1, height: 1 };\n private _chartViewBox: IBoundsLike;\n\n protected _col: number = 1;\n protected _row: number = 1;\n protected _colSize: GridSize[];\n protected _rowSize: GridSize[];\n\n protected _colElements: ILayoutItem[][];\n protected _rowElements: ILayoutItem[][];\n\n protected _gridInfo: IGridLayoutSpec;\n\n protected _elementMap: Map<ILayoutItem, ElementSpec> = new Map();\n\n protected _onError: (...args: any[]) => void;\n\n constructor(gridInfo: IGridLayoutSpec, ctx: utilFunctionCtx) {\n this.standardizationSpec(gridInfo);\n this._gridInfo = gridInfo;\n this._col = gridInfo.col;\n this._row = gridInfo.row;\n this._colSize = new Array(this._col).fill(null);\n this._rowSize = new Array(this._row).fill(null);\n this._colElements = new Array(this._col).fill([]);\n this._rowElements = new Array(this._row).fill([]);\n this._onError = ctx?.onError;\n\n this.initUserSetting();\n }\n\n protected standardizationSpec(gridInfo: IGridLayoutSpec) {\n gridInfo.col = gridInfo.col ?? 1;\n gridInfo.row = gridInfo.row ?? 1;\n gridInfo.elements = gridInfo.elements ?? [];\n }\n\n protected initUserSetting() {\n // 先对用户设置的宽高进行设置\n this._gridInfo.colWidth &&\n this.setSizeFromUserSetting(this._gridInfo.colWidth, this._colSize, this._col, this._chartLayoutRect.width);\n\n this._gridInfo.rowHeight &&\n this.setSizeFromUserSetting(this._gridInfo.rowHeight, this._rowSize, this._row, this._chartLayoutRect.height);\n // 其余位置默认填充0\n this._colSize.forEach((c, i) => {\n if (!c) {\n this._colSize[i] = {\n value: 0,\n isUserSetting: false,\n isLayoutSetting: false\n };\n }\n });\n this._rowSize.forEach((r, i) => {\n if (!r) {\n this._rowSize[i] = {\n value: 0,\n isUserSetting: false,\n isLayoutSetting: false\n };\n }\n });\n }\n\n /**\n * 设置用户设置的 colWidth 和 rowHeight\n */\n protected setSizeFromUserSetting(\n userSetting: {\n index: number;\n size: number | ((maxSize: number) => number);\n }[],\n gridSize: GridSize[],\n gridMax: number,\n maxSize: number\n ) {\n userSetting.forEach(userSet => {\n if (userSet.index < 0 && userSet.index >= gridMax) {\n return;\n }\n if (isValidNumber(userSet.size)) {\n gridSize[userSet.index] = {\n value: +userSet.size,\n isUserSetting: true,\n isLayoutSetting: false\n };\n } else if (isFunction(userSet.size)) {\n gridSize[userSet.index] = {\n value: userSet.size(maxSize),\n isUserSetting: true,\n isLayoutSetting: false\n };\n }\n });\n }\n\n protected clearLayoutSize() {\n // 其余位置默认填充0\n this._colSize.forEach(c => {\n c.isLayoutSetting = false;\n if (!c.isUserSetting) {\n c.value = 0;\n }\n });\n this._rowSize.forEach(r => {\n r.isLayoutSetting = false;\n if (!r.isUserSetting) {\n r.value = 0;\n }\n });\n }\n\n protected getItemGridInfo(item: ILayoutItem): ElementSpec {\n // map 中寻找\n const mapResult = this._elementMap.get(item);\n if (mapResult) {\n return mapResult;\n }\n // 配置中匹配\n let result: ElementSpec | undefined;\n result = this._gridInfo.elements?.find(e => {\n if ('modelId' in e && isValid(e.modelId)) {\n if (isValid(item.model.userId) && item.model.userId === e.modelId) {\n return true;\n }\n } else if ('modelKey' in e && isValid(e.modelKey) && 'modelIndex' in e && isValid(e.modelIndex)) {\n const specKey = item.model.specKey ?? item.model.type;\n if (specKey === e.modelKey && item.model.getSpecIndex() === e.modelIndex) {\n return true;\n }\n }\n return false;\n });\n // default\n if (!result) {\n result = {\n col: 0,\n colSpan: 1,\n row: 0,\n rowSpan: 1\n } as ElementSpec;\n }\n this._elementMap.set(item, result);\n return result;\n }\n\n protected getSizeFromGrid(spec: ElementSpec, type: 'col' | 'row'): number | undefined {\n const sizeList = type === 'col' ? this._colSize : this._rowSize;\n let result = 0;\n for (let index = spec[type]; index < spec[type] + (spec[`${type}Span`] ?? 1); index++) {\n result += sizeList[index].value;\n }\n return result;\n }\n\n protected getSizeFromUser(spec: ElementSpec, type: 'col' | 'row'): number | undefined {\n const sizeList = type === 'col' ? this._colSize : this._rowSize;\n if (!sizeList[spec[type]]?.isUserSetting) {\n return undefined;\n }\n let result = 0;\n for (let index = spec[type]; index < spec[type] + (spec[`${type}Span`] ?? 1); index++) {\n if (!sizeList[index].isUserSetting) {\n return undefined;\n }\n result += sizeList[index].value;\n }\n return result;\n }\n\n protected setItemLayoutSizeToGrid(item: ILayoutItem, gridSpec: ElementSpec) {\n if (isColItem(item)) {\n if (gridSpec.colSpan && gridSpec.colSpan > 1) {\n return;\n }\n if (this._colSize[gridSpec.col].isUserSetting) {\n return;\n }\n this._colSize[gridSpec.col].value = Math.max(\n this._colSize[gridSpec.col].value,\n item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight\n );\n this._colSize[gridSpec.col].isLayoutSetting = true;\n } else {\n if (gridSpec.rowSpan && gridSpec.rowSpan > 1) {\n return;\n }\n if (this._rowSize[gridSpec.row].isUserSetting) {\n return;\n }\n this._rowSize[gridSpec.row].value = Math.max(\n this._rowSize[gridSpec.row].value,\n item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom\n );\n this._rowSize[gridSpec.row].isLayoutSetting = true;\n }\n }\n\n protected layoutGrid(type: 'col' | 'row') {\n const gridSize = type === 'col' ? this._colSize : this._rowSize;\n let unSetSize = type === 'col' ? this._chartLayoutRect.width : this._chartLayoutRect.height;\n const willSize: GridSize[] = [];\n gridSize.forEach(s => {\n if (s.isUserSetting || s.isLayoutSetting) {\n unSetSize -= s.value;\n } else {\n willSize.push(s);\n }\n });\n if (unSetSize < 0) {\n console.warn(`layout content ${type} size bigger than chart`);\n }\n willSize.forEach(s => (s.value = unSetSize / willSize.length));\n }\n\n protected getItemPosition(item: ILayoutItem) {\n const gridSpec = this.getItemGridInfo(item);\n const point = { x: this._chartLayoutRect.x, y: this._chartLayoutRect.y };\n for (let col = 0; col < gridSpec.col; col++) {\n point.x += this._colSize[col].value;\n }\n for (let row = 0; row < gridSpec.row; row++) {\n point.y += this._rowSize[row].value;\n }\n point.x += item.layoutPaddingLeft + item.layoutOffsetX;\n point.y += item.layoutPaddingTop + item.layoutOffsetY;\n return point;\n }\n\n protected getItemLayoutRect(item: ILayoutItem) {\n const gridSpec = this.getItemGridInfo(item);\n // 先设置空间\n const rect = {\n width:\n (this.getSizeFromGrid(gridSpec, 'col') ?? this._chartLayoutRect.width) -\n item.layoutPaddingLeft -\n item.layoutPaddingRight,\n height:\n (this.getSizeFromGrid(gridSpec, 'row') ?? this._chartLayoutRect.height) -\n item.layoutPaddingTop -\n item.layoutPaddingBottom\n };\n return rect;\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n // 先清空旧布局信息\n this.clearLayoutSize();\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n\n // 剔除 region 后,其余元素先布局运算\n const normalItems = items.filter(item => item.layoutType === 'normal' && item.getModelVisible() !== false);\n const normalItemsCol = normalItems.filter(item => isColItem(item));\n const normalItemsRow = normalItems.filter(item => !isColItem(item));\n normalItems.forEach(item => {\n this.layoutOneItem(item, 'user', false);\n });\n\n // region 和 region 关联元素\n const regionsRelative = items.filter(x => x.layoutType === 'region-relative');\n const regionsRelativeCol = regionsRelative.filter(item => isColItem(item));\n const regionsRelativeRow = regionsRelative.filter(item => !isColItem(item));\n // 先进行 col 方向布局\n regionsRelativeCol.forEach(item => this.layoutOneItem(item, 'user', false));\n // 然后得到最终 col 信息 此时已经是最终 col 信息\n this.layoutGrid('col');\n // 再使用宽度信息辅助row方向排序\n // 此时普通占位元素,会因为布局宽度影响最终布局高度\n normalItemsRow.forEach(item => this.layoutOneItem(item, 'colGrid', false));\n regionsRelativeRow.forEach(item => {\n this.layoutOneItem(item, 'colGrid', false);\n });\n // 然后得到最终 row 信息\n this.layoutGrid('row');\n // 统一水平方向元素高度\n regionsRelativeRow.forEach(item => {\n this.layoutOneItem(item, 'grid', false);\n });\n // 再使用宽度信息,第二次次对 col 方向布局\n normalItemsCol.forEach(item => this.layoutOneItem(item, 'grid', false));\n regionsRelativeCol.forEach(item => {\n // 此时从布局逻辑可知,item的layoutRect会发生,将item的layoutTag设置为true\n this.layoutOneItem(item, 'grid', true);\n });\n this.layoutGrid('col');\n\n // region\n items.filter(x => x.layoutType === 'region').forEach(item => this.layoutOneItem(item, 'grid', false));\n\n // 再找出 absolute 元素,无需排序,在 compiler 层需要排序放置\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n\n // 最后基于grid 设置位置\n items\n .filter(x => x.layoutType !== 'absolute')\n .forEach(item => {\n item.setLayoutStartPosition(this.getItemPosition(item));\n });\n }\n\n /**\n *\n * 无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n\n private layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n });\n }\n\n protected layoutOneItem(item: ILayoutItem, sizeType: 'user' | 'grid' | 'colGrid' | 'rowGrid', ignoreTag: boolean) {\n const sizeCallRow =\n sizeType === 'rowGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);\n const sizeCallCol =\n sizeType === 'colGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);\n // 先获取 item 的 grid 信息\n const gridSpec = this.getItemGridInfo(item);\n // 先设置空间\n const computeRect = {\n width:\n (sizeCallCol(gridSpec, 'col') ?? this._chartLayoutRect.width) -\n item.layoutPaddingLeft -\n item.layoutPaddingRight,\n height:\n (sizeCallRow(gridSpec, 'row') ?? this._chartLayoutRect.height) -\n item.layoutPaddingTop -\n item.layoutPaddingBottom\n };\n const rect = item.computeBoundsInRect(computeRect);\n if (!isValidNumber(rect.width)) {\n rect.width = computeRect.width;\n }\n if (!isValidNumber(rect.height)) {\n rect.height = computeRect.height;\n }\n item.setLayoutRect(sizeType !== 'grid' ? rect : computeRect);\n // 设置大小到grid\n this.setItemLayoutSizeToGrid(item, gridSpec);\n }\n}\n\nfunction isColItem(item: ILayoutItem) {\n return item.layoutOrient === 'left' || item.layoutOrient === 'right';\n}\n\nexport const registerGridLayout = () => {\n Factory.registerLayout(GridLayout.type, GridLayout);\n};\n"]}
1
+ {"version":3,"sources":["../src/layout/grid-layout/grid-layout.ts"],"names":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rB,IAAI,CAAC,mBAAmB;SAC3B,CAAC;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACnD,IAAI,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;SAChC;QACD,IAAI,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC/B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,CAAC,aAAa,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE7D,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;;AAnWH,gCAoWC;AAnWQ,eAAI,GAAG,MAAM,CAAC;AAqWvB,SAAS,SAAS,CAAC,IAAiB;IAClC,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC;AACvE,CAAC;AAEM,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,iBAAO,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B","file":"grid-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../../typings/params';\nimport type { IChart } from '../../chart/interface/chart';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, IGridLayoutSpec, ElementSpec, ILayoutItem } from '../interface';\nimport { isFunction, isValid, isValidNumber } from '@visactor/vutils';\nimport type { IRect } from '../../typings/space';\nimport { Factory } from '../../core/factory';\n\ntype GridSize = {\n value: number;\n isUserSetting: boolean;\n isLayoutSetting: boolean;\n};\n\nexport class GridLayout implements IBaseLayout {\n static type = 'grid';\n private _chartLayoutRect: IRect = { x: 0, y: 0, width: 1, height: 1 };\n private _chartViewBox: IBoundsLike;\n\n protected _col: number = 1;\n protected _row: number = 1;\n protected _colSize: GridSize[];\n protected _rowSize: GridSize[];\n\n protected _colElements: ILayoutItem[][];\n protected _rowElements: ILayoutItem[][];\n\n protected _gridInfo: IGridLayoutSpec;\n\n protected _elementMap: Map<ILayoutItem, ElementSpec> = new Map();\n\n protected _onError: (...args: any[]) => void;\n\n constructor(gridInfo: IGridLayoutSpec, ctx: utilFunctionCtx) {\n this.standardizationSpec(gridInfo);\n this._gridInfo = gridInfo;\n this._col = gridInfo.col;\n this._row = gridInfo.row;\n this._colSize = new Array(this._col).fill(null);\n this._rowSize = new Array(this._row).fill(null);\n this._colElements = new Array(this._col).fill([]);\n this._rowElements = new Array(this._row).fill([]);\n this._onError = ctx?.onError;\n\n this.initUserSetting();\n }\n\n protected standardizationSpec(gridInfo: IGridLayoutSpec) {\n gridInfo.col = gridInfo.col ?? 1;\n gridInfo.row = gridInfo.row ?? 1;\n gridInfo.elements = gridInfo.elements ?? [];\n }\n\n protected initUserSetting() {\n // 先对用户设置的宽高进行设置\n this._gridInfo.colWidth &&\n this.setSizeFromUserSetting(this._gridInfo.colWidth, this._colSize, this._col, this._chartLayoutRect.width);\n\n this._gridInfo.rowHeight &&\n this.setSizeFromUserSetting(this._gridInfo.rowHeight, this._rowSize, this._row, this._chartLayoutRect.height);\n // 其余位置默认填充0\n this._colSize.forEach((c, i) => {\n if (!c) {\n this._colSize[i] = {\n value: 0,\n isUserSetting: false,\n isLayoutSetting: false\n };\n }\n });\n this._rowSize.forEach((r, i) => {\n if (!r) {\n this._rowSize[i] = {\n value: 0,\n isUserSetting: false,\n isLayoutSetting: false\n };\n }\n });\n }\n\n /**\n * 设置用户设置的 colWidth 和 rowHeight\n */\n protected setSizeFromUserSetting(\n userSetting: {\n index: number;\n size: number | ((maxSize: number) => number);\n }[],\n gridSize: GridSize[],\n gridMax: number,\n maxSize: number\n ) {\n userSetting.forEach(userSet => {\n if (userSet.index < 0 && userSet.index >= gridMax) {\n return;\n }\n if (isValidNumber(userSet.size)) {\n gridSize[userSet.index] = {\n value: +userSet.size,\n isUserSetting: true,\n isLayoutSetting: false\n };\n } else if (isFunction(userSet.size)) {\n gridSize[userSet.index] = {\n value: userSet.size(maxSize),\n isUserSetting: true,\n isLayoutSetting: false\n };\n }\n });\n }\n\n protected clearLayoutSize() {\n // 先对用户设置的宽高进行设置\n this._gridInfo.colWidth &&\n this.setSizeFromUserSetting(this._gridInfo.colWidth, this._colSize, this._col, this._chartLayoutRect.width);\n\n this._gridInfo.rowHeight &&\n this.setSizeFromUserSetting(this._gridInfo.rowHeight, this._rowSize, this._row, this._chartLayoutRect.height);\n\n // 其余位置默认填充0\n this._colSize.forEach(c => {\n c.isLayoutSetting = false;\n if (!c.isUserSetting) {\n c.value = 0;\n }\n });\n this._rowSize.forEach(r => {\n r.isLayoutSetting = false;\n if (!r.isUserSetting) {\n r.value = 0;\n }\n });\n }\n\n protected getItemGridInfo(item: ILayoutItem): ElementSpec {\n // map 中寻找\n const mapResult = this._elementMap.get(item);\n if (mapResult) {\n return mapResult;\n }\n // 配置中匹配\n let result: ElementSpec | undefined;\n result = this._gridInfo.elements?.find(e => {\n if ('modelId' in e && isValid(e.modelId)) {\n if (isValid(item.model.userId) && item.model.userId === e.modelId) {\n return true;\n }\n } else if ('modelKey' in e && isValid(e.modelKey) && 'modelIndex' in e && isValid(e.modelIndex)) {\n const specKey = item.model.specKey ?? item.model.type;\n if (specKey === e.modelKey && item.model.getSpecIndex() === e.modelIndex) {\n return true;\n }\n }\n return false;\n });\n // default\n if (!result) {\n result = {\n col: 0,\n colSpan: 1,\n row: 0,\n rowSpan: 1\n } as ElementSpec;\n }\n this._elementMap.set(item, result);\n return result;\n }\n\n protected getSizeFromGrid(spec: ElementSpec, type: 'col' | 'row'): number | undefined {\n const sizeList = type === 'col' ? this._colSize : this._rowSize;\n let result = 0;\n for (let index = spec[type]; index < spec[type] + (spec[`${type}Span`] ?? 1); index++) {\n result += sizeList[index].value;\n }\n return result;\n }\n\n protected getSizeFromUser(spec: ElementSpec, type: 'col' | 'row'): number | undefined {\n const sizeList = type === 'col' ? this._colSize : this._rowSize;\n if (!sizeList[spec[type]]?.isUserSetting) {\n return undefined;\n }\n let result = 0;\n for (let index = spec[type]; index < spec[type] + (spec[`${type}Span`] ?? 1); index++) {\n if (!sizeList[index].isUserSetting) {\n return undefined;\n }\n result += sizeList[index].value;\n }\n return result;\n }\n\n protected setItemLayoutSizeToGrid(item: ILayoutItem, gridSpec: ElementSpec) {\n if (isColItem(item)) {\n if (gridSpec.colSpan && gridSpec.colSpan > 1) {\n return;\n }\n if (this._colSize[gridSpec.col].isUserSetting) {\n return;\n }\n this._colSize[gridSpec.col].value = Math.max(\n this._colSize[gridSpec.col].value,\n item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight\n );\n this._colSize[gridSpec.col].isLayoutSetting = true;\n } else {\n if (gridSpec.rowSpan && gridSpec.rowSpan > 1) {\n return;\n }\n if (this._rowSize[gridSpec.row].isUserSetting) {\n return;\n }\n this._rowSize[gridSpec.row].value = Math.max(\n this._rowSize[gridSpec.row].value,\n item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom\n );\n this._rowSize[gridSpec.row].isLayoutSetting = true;\n }\n }\n\n protected layoutGrid(type: 'col' | 'row') {\n const gridSize = type === 'col' ? this._colSize : this._rowSize;\n let unSetSize = type === 'col' ? this._chartLayoutRect.width : this._chartLayoutRect.height;\n const willSize: GridSize[] = [];\n gridSize.forEach(s => {\n if (s.isUserSetting || s.isLayoutSetting) {\n unSetSize -= s.value;\n } else {\n willSize.push(s);\n }\n });\n if (unSetSize < 0) {\n console.warn(`layout content ${type} size bigger than chart`);\n }\n willSize.forEach(s => (s.value = unSetSize / willSize.length));\n }\n\n protected getItemPosition(item: ILayoutItem) {\n const gridSpec = this.getItemGridInfo(item);\n const point = { x: this._chartLayoutRect.x, y: this._chartLayoutRect.y };\n for (let col = 0; col < gridSpec.col; col++) {\n point.x += this._colSize[col].value;\n }\n for (let row = 0; row < gridSpec.row; row++) {\n point.y += this._rowSize[row].value;\n }\n point.x += item.layoutPaddingLeft + item.layoutOffsetX;\n point.y += item.layoutPaddingTop + item.layoutOffsetY;\n return point;\n }\n\n protected getItemLayoutRect(item: ILayoutItem) {\n const gridSpec = this.getItemGridInfo(item);\n // 先设置空间\n const rect = {\n width:\n (this.getSizeFromGrid(gridSpec, 'col') ?? this._chartLayoutRect.width) -\n item.layoutPaddingLeft -\n item.layoutPaddingRight,\n height:\n (this.getSizeFromGrid(gridSpec, 'row') ?? this._chartLayoutRect.height) -\n item.layoutPaddingTop -\n item.layoutPaddingBottom\n };\n return rect;\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n // 先清空旧布局信息\n this.clearLayoutSize();\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n\n // 剔除 region 后,其余元素先布局运算\n const normalItems = items.filter(item => item.layoutType === 'normal' && item.getModelVisible() !== false);\n const normalItemsCol = normalItems.filter(item => isColItem(item));\n const normalItemsRow = normalItems.filter(item => !isColItem(item));\n normalItems.forEach(item => {\n this.layoutOneItem(item, 'user', false);\n });\n\n // region 和 region 关联元素\n const regionsRelative = items.filter(x => x.layoutType === 'region-relative');\n const regionsRelativeCol = regionsRelative.filter(item => isColItem(item));\n const regionsRelativeRow = regionsRelative.filter(item => !isColItem(item));\n // 先进行 col 方向布局\n regionsRelativeCol.forEach(item => this.layoutOneItem(item, 'user', false));\n // 然后得到最终 col 信息 此时已经是最终 col 信息\n this.layoutGrid('col');\n // 再使用宽度信息辅助row方向排序\n // 此时普通占位元素,会因为布局宽度影响最终布局高度\n normalItemsRow.forEach(item => this.layoutOneItem(item, 'colGrid', false));\n regionsRelativeRow.forEach(item => {\n this.layoutOneItem(item, 'colGrid', false);\n });\n // 然后得到最终 row 信息\n this.layoutGrid('row');\n // 统一水平方向元素高度\n regionsRelativeRow.forEach(item => {\n this.layoutOneItem(item, 'grid', false);\n });\n // 再使用宽度信息,第二次次对 col 方向布局\n normalItemsCol.forEach(item => this.layoutOneItem(item, 'grid', false));\n regionsRelativeCol.forEach(item => {\n // 此时从布局逻辑可知,item的layoutRect会发生,将item的layoutTag设置为true\n this.layoutOneItem(item, 'grid', true);\n });\n this.layoutGrid('col');\n\n // region\n items.filter(x => x.layoutType === 'region').forEach(item => this.layoutOneItem(item, 'grid', false));\n\n // 再找出 absolute 元素,无需排序,在 compiler 层需要排序放置\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n\n // 最后基于grid 设置位置\n items\n .filter(x => x.layoutType !== 'absolute')\n .forEach(item => {\n item.setLayoutStartPosition(this.getItemPosition(item));\n });\n }\n\n /**\n *\n * 无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n\n private layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n });\n }\n\n protected layoutOneItem(item: ILayoutItem, sizeType: 'user' | 'grid' | 'colGrid' | 'rowGrid', ignoreTag: boolean) {\n const sizeCallRow =\n sizeType === 'rowGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);\n const sizeCallCol =\n sizeType === 'colGrid' || sizeType === 'grid' ? this.getSizeFromGrid.bind(this) : this.getSizeFromUser.bind(this);\n // 先获取 item 的 grid 信息\n const gridSpec = this.getItemGridInfo(item);\n // 先设置空间\n const computeRect = {\n width:\n (sizeCallCol(gridSpec, 'col') ?? this._chartLayoutRect.width) -\n item.layoutPaddingLeft -\n item.layoutPaddingRight,\n height:\n (sizeCallRow(gridSpec, 'row') ?? this._chartLayoutRect.height) -\n item.layoutPaddingTop -\n item.layoutPaddingBottom\n };\n const rect = item.computeBoundsInRect(computeRect);\n if (!isValidNumber(rect.width)) {\n rect.width = computeRect.width;\n }\n if (!isValidNumber(rect.height)) {\n rect.height = computeRect.height;\n }\n item.setLayoutRect(sizeType !== 'grid' ? rect : computeRect);\n // 设置大小到grid\n this.setItemLayoutSizeToGrid(item, gridSpec);\n }\n}\n\nfunction isColItem(item: ILayoutItem) {\n return item.layoutOrient === 'left' || item.layoutOrient === 'right';\n}\n\nexport const registerGridLayout = () => {\n Factory.registerLayout(GridLayout.type, GridLayout);\n};\n"]}
@@ -38,6 +38,6 @@ export declare class DomTooltipHandler extends BaseTooltipHandler {
38
38
  protected _getParentElement(spec: ITooltipSpec): HTMLElement;
39
39
  isTooltipShown(): boolean;
40
40
  reInit(): void;
41
- protected _updatePosition({ x, y }: ITooltipPositionActual): void;
41
+ protected _updatePosition({ x, y }: ITooltipPositionActual, resetTransition?: boolean): void;
42
42
  }
43
43
  export declare const registerDomTooltipHandler: () => void;
@@ -73,28 +73,26 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
73
73
  this._rootDom = null), this._container = null;
74
74
  }
75
75
  _updateTooltip(visible, params) {
76
- var _a, _b, _c;
76
+ var _a, _b;
77
77
  if (visible && this._rootDom) {
78
78
  const {tooltipSpec: tooltipSpec, activeTooltipSpec: activeTooltipSpec} = params;
79
79
  params.changePositionOnly || (this._tooltipActual = activeTooltipSpec);
80
- const currentVisible = this.getVisibility(), el = this._rootDom;
80
+ const el = this._rootDom;
81
81
  if (el) {
82
82
  const {x: x = 0, y: y = 0} = null !== (_a = activeTooltipSpec.position) && void 0 !== _a ? _a : {};
83
- if (tooltipSpec.updateElement) {
84
- this._updatePosition(null !== (_b = this._cacheCustomTooltipPosition) && void 0 !== _b ? _b : {
85
- x: x,
86
- y: y
87
- }), tooltipSpec.updateElement(el, activeTooltipSpec, params);
88
- const position = this._getActualTooltipPosition(activeTooltipSpec, params, {
89
- width: el.offsetWidth,
90
- height: el.offsetHeight
91
- });
92
- this._updatePosition(position), this._cacheCustomTooltipPosition = position;
93
- } else this._rootDom.style.transitionDuration = currentVisible ? null !== (_c = this._domStyle.panel.transitionDuration) && void 0 !== _c ? _c : "initial" : "0ms",
94
- this._updatePosition({
83
+ let position = {
95
84
  x: x,
96
85
  y: y
97
- });
86
+ };
87
+ const currentVisible = this.getVisibility();
88
+ tooltipSpec.updateElement && (this._updatePosition(null !== (_b = this._cacheCustomTooltipPosition) && void 0 !== _b ? _b : {
89
+ x: x,
90
+ y: y
91
+ }), tooltipSpec.updateElement(el, activeTooltipSpec, params), position = this._getActualTooltipPosition(activeTooltipSpec, params, {
92
+ width: el.offsetWidth,
93
+ height: el.offsetHeight
94
+ }), this._cacheCustomTooltipPosition = position), !currentVisible && visible && (this._rootDom.style.transition = "none",
95
+ this._updatePosition(position, !1), this._rootDom.getBoundingClientRect()), this._updatePosition(position);
98
96
  }
99
97
  this.setVisibility(visible);
100
98
  } else this.setVisibility(visible), this._cacheCustomTooltipPosition = void 0;
@@ -198,8 +196,10 @@ class DomTooltipHandler extends base_1.BaseTooltipHandler {
198
196
  super.reInit(), this._initStyle(), this._rootDom && (0, style_1.setStyleToDom)(this._rootDom, this._domStyle.panel),
199
197
  this.getVisibility() && (this._updateDomStringByCol(this._tooltipActual), this._updateDomStyle("height", !1));
200
198
  }
201
- _updatePosition({x: x, y: y}) {
202
- this._rootDom && (this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`);
199
+ _updatePosition({x: x, y: y}, resetTransition = !0) {
200
+ this._rootDom && (this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`,
201
+ resetTransition && "" !== this._rootDom.style.transition && (this._rootDom.style.transition = "",
202
+ Object.assign(this._rootDom.style, this._domStyle.panel)));
203
203
  }
204
204
  }
205
205
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom-tooltip-handler.ts"],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I,CAAC,cAAc,CAAC,CAAC;YAChD,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;SACvC;IACH,CAAC;IAES,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAA0B;QACxD,IAAI,IAAI,CAAC,QAAQ,EAAE;YAEjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;SAClE;IACH,CAAC;;AA/YH,8CAgZC;AA/YiB,sBAAI,GAAG,6BAAkB,CAAC,GAAG,CAAC;AAiZzC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,kCAAuB,EAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","file":"dom-tooltip-handler.js","sourcesContent":["import type { ITooltipActual, ITooltipPositionActual } from '../../../typings/tooltip';\nimport { BaseTooltipHandler } from './base';\nimport { getDomStyle, getTextStyle, setStyleToDom } from './utils/style';\nimport {\n TOOLTIP_CONTAINER_EL_CLASS_NAME,\n DEFAULT_TOOLTIP_Z_INDEX,\n TOOLTIP_PREFIX,\n TOOLTIP_CONTENT_BOX_CLASS_NAME,\n TOOLTIP_TITLE_CLASS_NAME\n} from './constants';\nimport { type Maybe, isValid } from '@visactor/vutils';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { domDocument } from '../../../util/env';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../../component/tooltip';\nimport type { IComponentPluginService } from '../interface';\nimport { registerComponentPlugin } from '../register';\nimport type { ILayoutPoint } from '../../../typings';\nimport { TooltipHandlerType } from '../../../component/tooltip/constant';\nimport { getSvgHtml } from './utils/svg';\nimport { formatContent } from './utils/common';\nimport { token } from '../../../theme/token';\nimport { calcLayoutNumber } from '../../../util/space';\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.dom;\n readonly type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: {\n panelPadding?: number[];\n panel: Partial<CSSStyleDeclaration>;\n row: Partial<CSSStyleDeclaration>;\n title: Partial<CSSStyleDeclaration>;\n shape: Partial<CSSStyleDeclaration>;\n key: Partial<CSSStyleDeclaration>;\n value: Partial<CSSStyleDeclaration>;\n };\n protected _rootDom?: HTMLElement;\n protected _tooltipActual?: ITooltipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n /** 自定义 tooltip 的位置缓存 */\n protected _cacheCustomTooltipPosition: ILayoutPoint;\n\n getVisibility() {\n return this._rootDom ? this._rootDom.style.visibility === 'visible' : false;\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility() && this._rootDom) {\n this._rootDom.style.visibility = _value ? 'visible' : 'hidden';\n }\n }\n\n getRootDom() {\n return this._rootDom;\n }\n\n constructor() {\n super(DomTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement && parentElement.children && parentElement.children.length) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX;\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n }\n }\n\n initRootDom() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const tooltipElement = document.createElement('div');\n const themeFontFamily = this._chartOption?.getTheme('fontFamily');\n\n setStyleToDom(tooltipElement, {\n left: '0',\n top: '0',\n pointerEvents: 'none',\n padding: '12px',\n position: 'absolute',\n zIndex: DEFAULT_TOOLTIP_Z_INDEX,\n fontFamily: (themeFontFamily ?? token.fontFamily) as string,\n fontSize: '11px',\n borderRadius: '3px',\n borderStyle: 'solid',\n lineHeight: 'initial',\n background: '#fff',\n boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.1)',\n maxWidth: '100wh',\n maxHeight: '100vh',\n visibility: 'hidden',\n ...this._domStyle.panel\n } as CSSStyleDeclaration);\n tooltipElement.classList.add(tooltipSpec.className);\n tooltipElement.setAttribute('vchart-tooltip-id', `${this.id}`);\n this._container.appendChild(tooltipElement);\n this._rootDom = tooltipElement;\n }\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!this._rootDom) {\n this.initRootDom();\n }\n if (!changePositionOnly) {\n this._updateDomStringByCol(actualTooltip);\n }\n\n this._updateDomStyle('height', changePositionOnly);\n\n const rect = this._rootDom?.getBoundingClientRect();\n\n return {\n width: rect?.width,\n height: rect?.height\n };\n }\n\n protected _removeTooltip() {\n if (this._rootDom && this._rootDom.parentNode) {\n this._rootDom.parentNode.removeChild(this._rootDom);\n this._rootDom = null;\n }\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n if (!visible || !this._rootDom) {\n this.setVisibility(visible);\n this._cacheCustomTooltipPosition = undefined;\n } else {\n const { tooltipSpec, activeTooltipSpec } = params;\n\n if (!params.changePositionOnly) {\n this._tooltipActual = activeTooltipSpec;\n }\n const currentVisible = this.getVisibility();\n\n // 位置\n const el = this._rootDom;\n if (el) {\n const { x = 0, y = 0 } = activeTooltipSpec.position ?? {};\n if (tooltipSpec.updateElement) {\n // 此处先设定一次位置,防止页面暂时出现滚动条(优先设置上次的位置)\n this._updatePosition(this._cacheCustomTooltipPosition ?? { x, y });\n // 更新 tooltip dom\n tooltipSpec.updateElement(el, activeTooltipSpec, params);\n // 重新计算 tooltip 位置\n const position = this._getActualTooltipPosition(activeTooltipSpec, params, {\n width: el.offsetWidth,\n height: el.offsetHeight\n });\n // 更新位置\n this._updatePosition(position);\n // 更新缓存\n this._cacheCustomTooltipPosition = position;\n } else {\n if (!currentVisible) {\n // 当从隐藏切换到显示的时候,需要先设置一次 transition 为 0ms,防止出现从一个非常远的初始位置进行动画\n this._rootDom.style.transitionDuration = '0ms';\n } else {\n this._rootDom.style.transitionDuration = this._domStyle.panel.transitionDuration ?? 'initial';\n }\n this._updatePosition({ x, y });\n }\n }\n this.setVisibility(visible);\n }\n }\n\n protected _initStyle() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n\n this._domStyle = getDomStyle(tooltipSpec);\n }\n\n protected _updateDomStringByCol(actualTooltip?: ITooltipActual) {\n const { title = {}, content } = actualTooltip;\n const hasContent = content && content.length;\n const rowStyle = this._domStyle.row;\n const chilren = [...(this._rootDom.children as any)] as HTMLElement[];\n let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));\n\n if (!titleDom && title.visible !== false) {\n titleDom = document.createElement('h2');\n const span = document.createElement('span');\n titleDom.appendChild(span);\n\n titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);\n\n // 将 titleDom 插入到 this._rootDom 中作为第一个节点\n if (this._rootDom.firstChild) {\n this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);\n } else {\n this._rootDom.appendChild(titleDom);\n }\n }\n\n if (titleDom && title.visible !== false) {\n setStyleToDom(titleDom, {\n ...this._domStyle.title,\n ...(hasContent ? rowStyle : { marginBottom: '0px' }),\n marginTop: '0px'\n });\n (titleDom.firstChild as HTMLElement).innerHTML = `${title.value ?? ''}`;\n } else if (titleDom && title.visible === false) {\n titleDom.parentNode.removeChild(titleDom);\n }\n\n const columns = ['shape', 'key', 'value'];\n\n if (!contentDom && hasContent) {\n contentDom = document.createElement('div');\n\n columns.forEach(col => {\n const colDiv = document.createElement('div');\n\n colDiv.classList.add(`${TOOLTIP_PREFIX}-column`);\n colDiv.classList.add(`${TOOLTIP_PREFIX}-${col}-column`);\n colDiv.setAttribute('data-col', col);\n contentDom.appendChild(colDiv);\n });\n\n contentDom.classList.add(TOOLTIP_CONTENT_BOX_CLASS_NAME);\n this._rootDom.appendChild(contentDom);\n }\n\n if (contentDom && hasContent) {\n const columnDivs = [...(contentDom.children as any)] as HTMLElement[];\n setStyleToDom(contentDom, { whiteSpace: 'nowrap' });\n\n columnDivs.forEach((colDiv, index) => {\n const colName = colDiv.getAttribute('data-col');\n\n if (colName && columns.includes(colName)) {\n const hideColumn = colName === 'shape' && content.every(c => !c.hasShape || !c.shapeType);\n\n setStyleToDom(colDiv, {\n ...(this._domStyle as any)[colName],\n display: hideColumn ? 'none' : 'inline-block',\n verticalAlign: 'top'\n });\n const rows = [...(colDiv.children as any)] as HTMLElement[];\n\n // 删除多余的行\n rows.slice(content.length).forEach(extraRow => {\n extraRow.parentNode.removeChild(extraRow);\n });\n\n content.forEach((entry, index) => {\n let row = rows[index];\n\n if (!row) {\n row = document.createElement('div');\n row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);\n colDiv.appendChild(row);\n }\n const styleByRow = {\n ...rowStyle\n };\n\n if (index === content.length - 1) {\n styleByRow.marginBottom = '0px';\n }\n\n styleByRow.display = entry.visible === false ? 'none' : 'block';\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n styleByRow.height = 'initial';\n\n if (colName === 'key') {\n row.innerHTML = formatContent(entry.key);\n if (entry.keyStyle) {\n getTextStyle(entry.keyStyle, styleByRow);\n }\n } else if (colName === 'value') {\n row.innerHTML = formatContent(entry.value);\n if (entry.valueStyle) {\n getTextStyle(entry.valueStyle, styleByRow);\n }\n } else if (colName === 'shape') {\n row.innerHTML = getSvgHtml(entry, `${this.id}_${index}`);\n }\n\n setStyleToDom(row, styleByRow);\n });\n }\n });\n } else if (contentDom && !hasContent) {\n contentDom.parentNode.removeChild(contentDom);\n }\n }\n protected _updateDomStyle(sizeKey: 'width' | 'height' = 'width', refreshSize: boolean) {\n const rootDom = this._rootDom;\n const contentDom = [...(rootDom.children as any)].find(child =>\n child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME)\n );\n const titleDom = [...(rootDom.children as any)].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n\n if (contentDom) {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const contentStyle: Partial<CSSStyleDeclaration> = {};\n const titleLabel = tooltipSpec.style?.titleLabel;\n const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;\n\n if (autoFixTitleWidth && titleDom) {\n const maxWidth = [...(contentDom.children as any)].reduce((res, col) => {\n return sizeKey === 'height'\n ? res + col.getBoundingClientRect().width\n : Math.max(res, col.getBoundingClientRect().width);\n }, 0);\n\n if (maxWidth > 0) {\n titleDom.style.maxWidth = `${maxWidth}px`;\n // 需要再计算一次,因为之前可能因为没有设置maxWidth, content的dom被撑宽了\n titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;\n }\n }\n\n if (isValid(tooltipSpec?.style?.maxContentHeight)) {\n const titleHeight =\n titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)\n ? titleDom.getBoundingClientRect().height + (tooltipSpec.style.spaceRow ?? 0)\n : 0;\n const viewRect = (this._chartOption as any).getChartViewRect();\n const maxHeight = calcLayoutNumber(\n tooltipSpec.style.maxContentHeight,\n Math.min(viewRect.height, document.body.clientHeight) -\n titleHeight -\n (this._domStyle.panelPadding ? this._domStyle.panelPadding[0] + this._domStyle.panelPadding[1] : 0)\n );\n\n if (maxHeight > 0) {\n contentStyle.maxHeight = `${maxHeight}px`;\n contentStyle.overflowY = 'auto';\n // todo 让内容宽度往外阔一点,给滚动条留出位置\n contentStyle.width = `calc(100% + ${\n this._domStyle.panelPadding ? this._domStyle.panelPadding[1] + 'px' : '10px'\n })`;\n\n setStyleToDom(contentDom as HTMLElement, contentStyle);\n }\n }\n\n const rows = contentDom.children;\n const widthByCol: number[] = [];\n if (rows) {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n if (refreshSize) {\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n cols[j].style[sizeKey] = 'initial';\n }\n\n const width = cols[j].getBoundingClientRect()[sizeKey];\n if (widthByCol[j] === undefined || widthByCol[j] < width) {\n widthByCol[j] = width;\n }\n }\n }\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n (cols[j] as HTMLElement).style[sizeKey] = `${widthByCol[j]}px`;\n }\n }\n }\n }\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n if (this._rootDom) {\n setStyleToDom(this._rootDom, this._domStyle.panel);\n }\n\n if (this.getVisibility()) {\n this._updateDomStringByCol(this._tooltipActual);\n this._updateDomStyle('height', false);\n }\n }\n\n protected _updatePosition({ x, y }: ITooltipPositionActual) {\n if (this._rootDom) {\n // translate3d 性能较好:https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n }\n }\n}\n\nexport const registerDomTooltipHandler = () => {\n registerComponentPlugin(DomTooltipHandler);\n};\n"]}
1
+ {"version":3,"sources":["../src/plugin/components/tooltip-handler/dom-tooltip-handler.ts"],"names":[],"mappings":";;;AACA,iCAA4C;AAC5C,yCAAyE;AACzE,2CAMqB;AACrB,6CAAuD;AAEvD,2CAAgD;AAGhD,0CAAsD;AAEtD,kEAAyE;AACzE,qCAA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ChF,IAAI,IAAI,CAAC,QAAQ,EAAE;YAEjB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;YACjE,IAAI,eAAe,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE,EAAE;gBAC5D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC;gBACpC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aAC1D;SACF;IACH,CAAC;;AAhZH,8CAiZC;AAhZiB,sBAAI,GAAG,6BAAkB,CAAC,GAAG,CAAC;AAkZzC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,kCAAuB,EAAC,iBAAiB,CAAC,CAAC;AAC7C,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","file":"dom-tooltip-handler.js","sourcesContent":["import type { ITooltipActual, ITooltipPositionActual } from '../../../typings/tooltip';\nimport { BaseTooltipHandler } from './base';\nimport { getDomStyle, getTextStyle, setStyleToDom } from './utils/style';\nimport {\n TOOLTIP_CONTAINER_EL_CLASS_NAME,\n DEFAULT_TOOLTIP_Z_INDEX,\n TOOLTIP_PREFIX,\n TOOLTIP_CONTENT_BOX_CLASS_NAME,\n TOOLTIP_TITLE_CLASS_NAME\n} from './constants';\nimport { type Maybe, isValid } from '@visactor/vutils';\nimport type { IContainerSize } from '@visactor/vrender-components';\nimport { domDocument } from '../../../util/env';\nimport type { ITooltipSpec, TooltipHandlerParams } from '../../../component/tooltip';\nimport type { IComponentPluginService } from '../interface';\nimport { registerComponentPlugin } from '../register';\nimport type { ILayoutPoint } from '../../../typings';\nimport { TooltipHandlerType } from '../../../component/tooltip/constant';\nimport { getSvgHtml } from './utils/svg';\nimport { formatContent } from './utils/common';\nimport { token } from '../../../theme/token';\nimport { calcLayoutNumber } from '../../../util/space';\n/**\n * The tooltip handler class.\n */\nexport class DomTooltipHandler extends BaseTooltipHandler {\n static readonly type = TooltipHandlerType.dom;\n readonly type = TooltipHandlerType.dom;\n\n protected _tooltipContainer = domDocument?.body;\n protected _domStyle: {\n panelPadding?: number[];\n panel: Partial<CSSStyleDeclaration>;\n row: Partial<CSSStyleDeclaration>;\n title: Partial<CSSStyleDeclaration>;\n shape: Partial<CSSStyleDeclaration>;\n key: Partial<CSSStyleDeclaration>;\n value: Partial<CSSStyleDeclaration>;\n };\n protected _rootDom?: HTMLElement;\n protected _tooltipActual?: ITooltipActual;\n protected declare _container: Maybe<HTMLDivElement>;\n\n /** 自定义 tooltip 的位置缓存 */\n protected _cacheCustomTooltipPosition: ILayoutPoint;\n\n getVisibility() {\n return this._rootDom ? this._rootDom.style.visibility === 'visible' : false;\n }\n\n setVisibility(_value: boolean) {\n // 这里做个节流\n if (_value !== this.getVisibility() && this._rootDom) {\n this._rootDom.style.visibility = _value ? 'visible' : 'hidden';\n }\n }\n\n getRootDom() {\n return this._rootDom;\n }\n\n constructor() {\n super(DomTooltipHandler.type);\n }\n\n onAdd(service: IComponentPluginService<any>): void {\n super.onAdd(service);\n this._initStyle();\n this.initEl();\n }\n\n initEl() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const parentElement = tooltipSpec.parentElement as HTMLElement | HTMLCanvasElement;\n if (domDocument && parentElement && parentElement.children && parentElement.children.length) {\n for (let i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].classList.contains(TOOLTIP_CONTAINER_EL_CLASS_NAME)) {\n this._container = parentElement.children[i] as HTMLDivElement;\n break;\n }\n }\n if (!this._container) {\n this._container = domDocument.createElement('div');\n this._container.style.position = 'relative';\n this._container.style.zIndex = DEFAULT_TOOLTIP_Z_INDEX;\n this._container.classList.add(TOOLTIP_CONTAINER_EL_CLASS_NAME);\n parentElement.appendChild(this._container);\n }\n }\n }\n\n initRootDom() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const tooltipElement = document.createElement('div');\n const themeFontFamily = this._chartOption?.getTheme('fontFamily');\n setStyleToDom(tooltipElement, {\n left: '0',\n top: '0',\n pointerEvents: 'none',\n padding: '12px',\n position: 'absolute',\n zIndex: DEFAULT_TOOLTIP_Z_INDEX,\n fontFamily: (themeFontFamily ?? token.fontFamily) as string,\n fontSize: '11px',\n borderRadius: '3px',\n borderStyle: 'solid',\n lineHeight: 'initial',\n background: '#fff',\n boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.1)',\n maxWidth: '100wh',\n maxHeight: '100vh',\n visibility: 'hidden',\n ...this._domStyle.panel\n } as CSSStyleDeclaration);\n tooltipElement.classList.add(tooltipSpec.className);\n tooltipElement.setAttribute('vchart-tooltip-id', `${this.id}`);\n this._container.appendChild(tooltipElement);\n this._rootDom = tooltipElement;\n }\n\n // 计算 tooltip 内容区域的宽高,并缓存结果\n protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined {\n if (!this._rootDom) {\n this.initRootDom();\n }\n if (!changePositionOnly) {\n this._updateDomStringByCol(actualTooltip);\n }\n\n this._updateDomStyle('height', changePositionOnly);\n\n const rect = this._rootDom?.getBoundingClientRect();\n\n return {\n width: rect?.width,\n height: rect?.height\n };\n }\n\n protected _removeTooltip() {\n if (this._rootDom && this._rootDom.parentNode) {\n this._rootDom.parentNode.removeChild(this._rootDom);\n this._rootDom = null;\n }\n this._container = null;\n }\n\n protected _updateTooltip(visible: boolean, params: TooltipHandlerParams) {\n if (!visible || !this._rootDom) {\n this.setVisibility(visible);\n this._cacheCustomTooltipPosition = undefined;\n } else {\n const { tooltipSpec, activeTooltipSpec } = params;\n\n if (!params.changePositionOnly) {\n this._tooltipActual = activeTooltipSpec;\n }\n // 位置\n const el = this._rootDom;\n if (el) {\n const { x = 0, y = 0 } = activeTooltipSpec.position ?? {};\n let position = { x, y };\n const currentVisible = this.getVisibility();\n if (tooltipSpec.updateElement) {\n // 此处先设定一次位置,防止页面暂时出现滚动条(优先设置上次的位置)\n this._updatePosition(this._cacheCustomTooltipPosition ?? { x, y });\n // 更新 tooltip dom\n tooltipSpec.updateElement(el, activeTooltipSpec, params);\n // 重新计算 tooltip 位置\n position = this._getActualTooltipPosition(activeTooltipSpec, params, {\n width: el.offsetWidth,\n height: el.offsetHeight\n });\n // 更新缓存\n this._cacheCustomTooltipPosition = position;\n }\n // 首次从false展示需要先设置一次位置,防止出现从一个非常远的初始位置进行动画\n if (!currentVisible && visible) {\n this._rootDom.style.transition = 'none';\n this._updatePosition(position, false);\n this._rootDom.getBoundingClientRect();\n }\n // 更新位置\n this._updatePosition(position);\n }\n this.setVisibility(visible);\n }\n }\n\n protected _initStyle() {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n\n this._domStyle = getDomStyle(tooltipSpec);\n }\n\n protected _updateDomStringByCol(actualTooltip?: ITooltipActual) {\n const { title = {}, content } = actualTooltip;\n const hasContent = content && content.length;\n const rowStyle = this._domStyle.row;\n const chilren = [...(this._rootDom.children as any)] as HTMLElement[];\n let titleDom = chilren.find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n let contentDom = chilren.find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));\n\n if (!titleDom && title.visible !== false) {\n titleDom = document.createElement('h2');\n const span = document.createElement('span');\n titleDom.appendChild(span);\n\n titleDom.classList.add(TOOLTIP_TITLE_CLASS_NAME);\n\n // 将 titleDom 插入到 this._rootDom 中作为第一个节点\n if (this._rootDom.firstChild) {\n this._rootDom.insertBefore(titleDom, this._rootDom.firstChild);\n } else {\n this._rootDom.appendChild(titleDom);\n }\n }\n\n if (titleDom && title.visible !== false) {\n setStyleToDom(titleDom, {\n ...this._domStyle.title,\n ...(hasContent ? rowStyle : { marginBottom: '0px' }),\n marginTop: '0px'\n });\n (titleDom.firstChild as HTMLElement).innerHTML = `${title.value ?? ''}`;\n } else if (titleDom && title.visible === false) {\n titleDom.parentNode.removeChild(titleDom);\n }\n\n const columns = ['shape', 'key', 'value'];\n\n if (!contentDom && hasContent) {\n contentDom = document.createElement('div');\n\n columns.forEach(col => {\n const colDiv = document.createElement('div');\n\n colDiv.classList.add(`${TOOLTIP_PREFIX}-column`);\n colDiv.classList.add(`${TOOLTIP_PREFIX}-${col}-column`);\n colDiv.setAttribute('data-col', col);\n contentDom.appendChild(colDiv);\n });\n\n contentDom.classList.add(TOOLTIP_CONTENT_BOX_CLASS_NAME);\n this._rootDom.appendChild(contentDom);\n }\n\n if (contentDom && hasContent) {\n const columnDivs = [...(contentDom.children as any)] as HTMLElement[];\n setStyleToDom(contentDom, { whiteSpace: 'nowrap' });\n\n columnDivs.forEach((colDiv, index) => {\n const colName = colDiv.getAttribute('data-col');\n\n if (colName && columns.includes(colName)) {\n const hideColumn = colName === 'shape' && content.every(c => !c.hasShape || !c.shapeType);\n\n setStyleToDom(colDiv, {\n ...(this._domStyle as any)[colName],\n display: hideColumn ? 'none' : 'inline-block',\n verticalAlign: 'top'\n });\n const rows = [...(colDiv.children as any)] as HTMLElement[];\n\n // 删除多余的行\n rows.slice(content.length).forEach(extraRow => {\n extraRow.parentNode.removeChild(extraRow);\n });\n\n content.forEach((entry, index) => {\n let row = rows[index];\n\n if (!row) {\n row = document.createElement('div');\n row.classList.add(`${TOOLTIP_PREFIX}-${colName}`);\n colDiv.appendChild(row);\n }\n const styleByRow = {\n ...rowStyle\n };\n\n if (index === content.length - 1) {\n styleByRow.marginBottom = '0px';\n }\n\n styleByRow.display = entry.visible === false ? 'none' : 'block';\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n styleByRow.height = 'initial';\n\n if (colName === 'key') {\n row.innerHTML = formatContent(entry.key);\n if (entry.keyStyle) {\n getTextStyle(entry.keyStyle, styleByRow);\n }\n } else if (colName === 'value') {\n row.innerHTML = formatContent(entry.value);\n if (entry.valueStyle) {\n getTextStyle(entry.valueStyle, styleByRow);\n }\n } else if (colName === 'shape') {\n row.innerHTML = getSvgHtml(entry, `${this.id}_${index}`);\n }\n\n setStyleToDom(row, styleByRow);\n });\n }\n });\n } else if (contentDom && !hasContent) {\n contentDom.parentNode.removeChild(contentDom);\n }\n }\n protected _updateDomStyle(sizeKey: 'width' | 'height' = 'width', refreshSize: boolean) {\n const rootDom = this._rootDom;\n const contentDom = [...(rootDom.children as any)].find(child =>\n child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME)\n );\n const titleDom = [...(rootDom.children as any)].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));\n\n if (contentDom) {\n const tooltipSpec = this._component.getSpec() as ITooltipSpec;\n const contentStyle: Partial<CSSStyleDeclaration> = {};\n const titleLabel = tooltipSpec.style?.titleLabel;\n const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;\n\n if (autoFixTitleWidth && titleDom) {\n const maxWidth = [...(contentDom.children as any)].reduce((res, col) => {\n return sizeKey === 'height'\n ? res + col.getBoundingClientRect().width\n : Math.max(res, col.getBoundingClientRect().width);\n }, 0);\n\n if (maxWidth > 0) {\n titleDom.style.maxWidth = `${maxWidth}px`;\n // 需要再计算一次,因为之前可能因为没有设置maxWidth, content的dom被撑宽了\n titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;\n }\n }\n\n if (isValid(tooltipSpec?.style?.maxContentHeight)) {\n const titleHeight =\n titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)\n ? titleDom.getBoundingClientRect().height + (tooltipSpec.style.spaceRow ?? 0)\n : 0;\n const viewRect = (this._chartOption as any).getChartViewRect();\n const maxHeight = calcLayoutNumber(\n tooltipSpec.style.maxContentHeight,\n Math.min(viewRect.height, document.body.clientHeight) -\n titleHeight -\n (this._domStyle.panelPadding ? this._domStyle.panelPadding[0] + this._domStyle.panelPadding[1] : 0)\n );\n\n if (maxHeight > 0) {\n contentStyle.maxHeight = `${maxHeight}px`;\n contentStyle.overflowY = 'auto';\n // todo 让内容宽度往外阔一点,给滚动条留出位置\n contentStyle.width = `calc(100% + ${\n this._domStyle.panelPadding ? this._domStyle.panelPadding[1] + 'px' : '10px'\n })`;\n\n setStyleToDom(contentDom as HTMLElement, contentStyle);\n }\n }\n\n const rows = contentDom.children;\n const widthByCol: number[] = [];\n if (rows) {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n if (refreshSize) {\n // 每次更新,需要更新单元格的高度,防止同步高度的时候没有更新\n cols[j].style[sizeKey] = 'initial';\n }\n\n const width = cols[j].getBoundingClientRect()[sizeKey];\n if (widthByCol[j] === undefined || widthByCol[j] < width) {\n widthByCol[j] = width;\n }\n }\n }\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const cols = row.children ?? ([] as HTMLElement[]);\n\n for (let j = 0; j < cols.length; j++) {\n (cols[j] as HTMLElement).style[sizeKey] = `${widthByCol[j]}px`;\n }\n }\n }\n }\n }\n\n protected _getParentElement(spec: ITooltipSpec): HTMLElement {\n return this._container ?? super._getParentElement(spec);\n }\n\n isTooltipShown() {\n return this.getVisibility();\n }\n\n reInit() {\n super.reInit();\n this._initStyle();\n if (this._rootDom) {\n setStyleToDom(this._rootDom, this._domStyle.panel);\n }\n\n if (this.getVisibility()) {\n this._updateDomStringByCol(this._tooltipActual);\n this._updateDomStyle('height', false);\n }\n }\n\n protected _updatePosition({ x, y }: ITooltipPositionActual, resetTransition = true) {\n if (this._rootDom) {\n // translate3d 性能较好:https://stackoverflow.com/questions/22111256/translate3d-vs-translate-performance\n this._rootDom.style.transform = `translate3d(${x}px, ${y}px, 0)`;\n if (resetTransition && this._rootDom.style.transition !== '') {\n this._rootDom.style.transition = '';\n Object.assign(this._rootDom.style, this._domStyle.panel);\n }\n }\n }\n}\n\nexport const registerDomTooltipHandler = () => {\n registerComponentPlugin(DomTooltipHandler);\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './register';
2
+ export * from './interface';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __exportStar = this && this.__exportStar || function(m, exports) {
15
+ for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
+ };
17
+
18
+ Object.defineProperty(exports, "__esModule", {
19
+ value: !0
20
+ }), __exportStar(require("./register"), exports), __exportStar(require("./interface"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/vchart/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B","file":"index.js","sourcesContent":["export * from './register';\nexport * from './interface';\n"]}
@@ -0,0 +1,16 @@
1
+ import type { IVChart } from '../../core/interface';
2
+ import type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';
3
+ export interface IVChartPlugin<T extends IVChartPluginService = any> extends IBasePlugin<T> {
4
+ specKey?: string;
5
+ onInit?: (service: T) => MaybePromise<void>;
6
+ }
7
+ export interface IVChartPluginConstructor {
8
+ readonly pluginType: 'vchart';
9
+ readonly specKey?: string;
10
+ readonly type: string;
11
+ new (): IVChartPlugin;
12
+ }
13
+ export interface IVChartPluginService<T extends IVChartPlugin = any> extends IBasePluginService<T> {
14
+ globalInstance: IVChart;
15
+ onInit?: () => MaybePromise<void>;
16
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/vchart/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IVChart } from '../../core/interface';\nimport type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';\n\nexport interface IVChartPlugin<T extends IVChartPluginService = any> extends IBasePlugin<T> {\n specKey?: string;\n onInit?: (service: T) => MaybePromise<void>;\n}\n\nexport interface IVChartPluginConstructor {\n readonly pluginType: 'vchart';\n readonly specKey?: string;\n readonly type: string;\n new (): IVChartPlugin;\n}\n\nexport interface IVChartPluginService<T extends IVChartPlugin = any> extends IBasePluginService<T> {\n globalInstance: IVChart;\n onInit?: () => MaybePromise<void>;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { IVChartPlugin, IVChartPluginService } from './interface';
2
+ import type { IVChart } from '../../core';
3
+ import { BasePluginService } from '../base/base-plugin-service';
4
+ export declare class VChartPluginService<T extends IVChartPlugin = IVChartPlugin> extends BasePluginService<T> implements IVChartPluginService<T> {
5
+ globalInstance: IVChart;
6
+ constructor(globalInstance: IVChart);
7
+ onInit(): void;
8
+ releaseAll(): void;
9
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.VChartPluginService = void 0;
6
+
7
+ const base_plugin_service_1 = require("../base/base-plugin-service");
8
+
9
+ class VChartPluginService extends base_plugin_service_1.BasePluginService {
10
+ constructor(globalInstance) {
11
+ super(), this.globalInstance = globalInstance;
12
+ }
13
+ onInit() {
14
+ this._plugins.forEach((plugin => {
15
+ plugin.onInit && plugin.onInit(this);
16
+ }));
17
+ }
18
+ releaseAll() {
19
+ super.releaseAll(), this.globalInstance = null;
20
+ }
21
+ }
22
+
23
+ exports.VChartPluginService = VChartPluginService;
24
+ //# sourceMappingURL=plugin-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/vchart/plugin-service.ts"],"names":[],"mappings":";;;AAEA,qEAAgE;AAEhE,MAAa,mBACX,SAAQ,uCAAoB;IAK5B,YAAY,cAAuB;QACjC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,KAAK,CAAC,UAAU,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF;AArBD,kDAqBC","file":"plugin-service.js","sourcesContent":["import type { IVChartPlugin, IVChartPluginService } from './interface';\nimport type { IVChart } from '../../core';\nimport { BasePluginService } from '../base/base-plugin-service';\n\nexport class VChartPluginService<T extends IVChartPlugin = IVChartPlugin>\n extends BasePluginService<T>\n implements IVChartPluginService<T>\n{\n globalInstance: IVChart;\n\n constructor(globalInstance: IVChart) {\n super();\n this.globalInstance = globalInstance;\n }\n\n onInit() {\n this._plugins.forEach(plugin => {\n plugin.onInit && plugin.onInit(this);\n });\n }\n\n releaseAll(): void {\n super.releaseAll();\n this.globalInstance = null;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { IVChartPluginConstructor } from './interface';
2
+ export declare const registerVChartPlugin: (plugin: IVChartPluginConstructor) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerVChartPlugin = void 0;
6
+
7
+ const factory_1 = require("../../core/factory"), registerVChartPlugin = plugin => {
8
+ factory_1.Factory.registerVChartPlugin(plugin.type, plugin);
9
+ };
10
+
11
+ exports.registerVChartPlugin = registerVChartPlugin;
12
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/vchart/register.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAGtC,MAAM,oBAAoB,GAAG,CAAC,MAAgC,EAAE,EAAE;IACvE,iBAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B","file":"register.js","sourcesContent":["import { Factory } from '../../core/factory';\nimport type { IVChartPluginConstructor } from './interface';\n\nexport const registerVChartPlugin = (plugin: IVChartPluginConstructor) => {\n Factory.registerVChartPlugin(plugin.type, plugin);\n};\n"]}
@@ -0,0 +1 @@
1
+ export * from './rotate';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __exportStar = this && this.__exportStar || function(m, exports) {
15
+ for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
16
+ };
17
+
18
+ Object.defineProperty(exports, "__esModule", {
19
+ value: !0
20
+ }), __exportStar(require("./rotate"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/vchart/rotate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB","file":"index.js","sourcesContent":["export * from './rotate';\n"]}
@@ -0,0 +1,18 @@
1
+ import { BasePlugin } from '../../base/base-plugin';
2
+ import type { IVChartPlugin, IVChartPluginService } from '../interface';
3
+ export declare class RotatePlugin extends BasePlugin implements IVChartPlugin {
4
+ static readonly pluginType: 'vchart';
5
+ static readonly specKey = "rotate";
6
+ static readonly type: string;
7
+ readonly type: string;
8
+ private rotateDegree;
9
+ private matrix;
10
+ private vglobal_mapToCanvasPoint;
11
+ private _vchart;
12
+ constructor();
13
+ onInit(service: IVChartPluginService): void;
14
+ rotate90WithTransform: (rotateDom: HTMLElement) => void;
15
+ cancelTransform: (rotateDom: HTMLElement) => void;
16
+ release(): void;
17
+ }
18
+ export declare const registerRotatePlugin: () => void;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.registerRotatePlugin = exports.RotatePlugin = void 0;
6
+
7
+ const base_plugin_1 = require("../../base/base-plugin"), register_1 = require("../register"), vrender_core_1 = require("@visactor/vrender-core");
8
+
9
+ class RotatePlugin extends base_plugin_1.BasePlugin {
10
+ constructor() {
11
+ super(RotatePlugin.type), this.type = "rotatePlugin", this.rotate90WithTransform = rotateDom => {
12
+ this.rotateDegree = 90;
13
+ const rotateCenter = rotateDom.clientWidth < rotateDom.clientHeight ? Math.max(rotateDom.clientWidth, rotateDom.clientHeight) / 2 : Math.min(rotateDom.clientWidth, rotateDom.clientHeight) / 2, domRect = this._vchart.getContainer().getBoundingClientRect(), x1 = domRect.left, y1 = domRect.top, x2 = domRect.right, y2 = domRect.bottom;
14
+ rotateDom.style.transform = "rotate(90deg)", rotateDom.style.transformOrigin = `${rotateCenter}px ${rotateCenter}px`;
15
+ const getRect = () => ({
16
+ x1: x1,
17
+ y1: y1,
18
+ x2: x2,
19
+ y2: y2
20
+ }), getMatrix = () => {
21
+ const viewPortWidth = ("undefined" != typeof window ? {
22
+ width: window.innerWidth || document.documentElement.clientWidth,
23
+ height: window.innerHeight || document.documentElement.clientHeight
24
+ } : vrender_core_1.vglobal && "getViewportSize" in vrender_core_1.vglobal && vrender_core_1.vglobal.getViewportSize ? vrender_core_1.vglobal.getViewportSize() : rotateDom.getBoundingClientRect()).width, domRect = this._vchart.getContainer().getBoundingClientRect(), x1 = domRect.top, y1 = viewPortWidth - domRect.right, matrix = vrender_core_1.matrixAllocate.allocate(1, 0, 0, 1, 0, 0);
25
+ matrix.translate(x1, y1);
26
+ const centerX = rotateCenter - x1, centerY = rotateCenter - y1;
27
+ return matrix.translate(centerX, centerY), matrix.rotate(Math.PI / 2), matrix.translate(-centerX, -centerY),
28
+ this.matrix = matrix, matrix;
29
+ };
30
+ (0, vrender_core_1.registerGlobalEventTransformer)(vrender_core_1.vglobal, this._vchart.getContainer(), getMatrix, getRect, vrender_core_1.transformPointForCanvas),
31
+ (0, vrender_core_1.registerWindowEventTransformer)(this._vchart.getStage().window, this._vchart.getContainer(), getMatrix, getRect, vrender_core_1.transformPointForCanvas),
32
+ this.vglobal_mapToCanvasPoint = vrender_core_1.vglobal.mapToCanvasPoint, vrender_core_1.vglobal.mapToCanvasPoint = vrender_core_1.mapToCanvasPointForCanvas;
33
+ }, this.cancelTransform = rotateDom => {
34
+ this.rotateDegree = 0, rotateDom.style.transform = "none", rotateDom.style.transformOrigin = "none";
35
+ const domRect = this._vchart.getContainer().getBoundingClientRect(), x1 = domRect.left, y1 = domRect.top, x2 = domRect.right, y2 = domRect.bottom, getRect = () => ({
36
+ x1: x1,
37
+ y1: y1,
38
+ x2: x2,
39
+ y2: y2
40
+ }), getMatrix = () => {
41
+ const matrix = vrender_core_1.matrixAllocate.allocate(1, 0, 0, 1, 0, 0);
42
+ return matrix.translate(x1, y1), matrix;
43
+ };
44
+ (0, vrender_core_1.registerGlobalEventTransformer)(vrender_core_1.vglobal, this._vchart.getContainer(), getMatrix, getRect, vrender_core_1.transformPointForCanvas),
45
+ (0, vrender_core_1.registerWindowEventTransformer)(this._vchart.getStage().window, this._vchart.getContainer(), getMatrix, getRect, vrender_core_1.transformPointForCanvas),
46
+ vrender_core_1.vglobal.mapToCanvasPoint = this.vglobal_mapToCanvasPoint;
47
+ };
48
+ }
49
+ onInit(service) {
50
+ const {globalInstance: vchart} = service;
51
+ vchart && (this._vchart = vchart, vchart.rotate90WithTransform = this.rotate90WithTransform,
52
+ vchart.cancelTransform = this.cancelTransform);
53
+ }
54
+ release() {
55
+ this._vchart = null, this.vglobal_mapToCanvasPoint = null, this.matrix = null, super.release();
56
+ }
57
+ }
58
+
59
+ exports.RotatePlugin = RotatePlugin, RotatePlugin.pluginType = "vchart", RotatePlugin.specKey = "rotate",
60
+ RotatePlugin.type = "rotatePlugin";
61
+
62
+ const registerRotatePlugin = () => {
63
+ (0, register_1.registerVChartPlugin)(RotatePlugin);
64
+ };
65
+
66
+ exports.registerRotatePlugin = registerRotatePlugin;
67
+ //# sourceMappingURL=rotate.js.map