@visactor/vrender-components 1.0.47-alpha.0 → 1.1.0-alpha.1

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 (142) hide show
  1. package/cjs/axis/base.js +9 -9
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/axis/circle.js +3 -3
  4. package/cjs/axis/circle.js.map +1 -1
  5. package/cjs/axis/grid/base.js +5 -5
  6. package/cjs/axis/grid/base.js.map +1 -1
  7. package/cjs/axis/line.js +6 -6
  8. package/cjs/axis/line.js.map +1 -1
  9. package/cjs/brush/brush.js +2 -2
  10. package/cjs/brush/brush.js.map +1 -1
  11. package/cjs/brush/config.js +2 -1
  12. package/cjs/checkbox/index.js +1 -2
  13. package/cjs/core/base.js +2 -2
  14. package/cjs/core/base.js.map +1 -1
  15. package/cjs/crosshair/sector.js +1 -2
  16. package/cjs/data-zoom/config.js +2 -1
  17. package/cjs/data-zoom/renderer.js.map +1 -1
  18. package/cjs/empty-tip/empty-tip.js.map +1 -1
  19. package/cjs/index.d.ts +1 -1
  20. package/cjs/index.js +1 -1
  21. package/cjs/index.js.map +1 -1
  22. package/cjs/label/arc.js +1 -1
  23. package/cjs/label/base.js +2 -2
  24. package/cjs/label/base.js.map +1 -1
  25. package/cjs/label-item/index.js +1 -1
  26. package/cjs/legend/base.js +2 -2
  27. package/cjs/legend/base.js.map +1 -1
  28. package/cjs/legend/discrete/discrete.js +10 -10
  29. package/cjs/legend/discrete/discrete.js.map +1 -1
  30. package/cjs/legend/size/size.js +3 -3
  31. package/cjs/legend/size/size.js.map +1 -1
  32. package/cjs/marker/arc-area.js +2 -2
  33. package/cjs/marker/arc-area.js.map +1 -1
  34. package/cjs/marker/area.js +2 -2
  35. package/cjs/marker/area.js.map +1 -1
  36. package/cjs/marker/base.js +4 -4
  37. package/cjs/marker/base.js.map +1 -1
  38. package/cjs/marker/point.d.ts +1 -1
  39. package/cjs/marker/point.js +6 -6
  40. package/cjs/marker/point.js.map +1 -1
  41. package/cjs/pager/pager.js +5 -5
  42. package/cjs/pager/pager.js.map +1 -1
  43. package/cjs/poptip/contribution.js +3 -10
  44. package/cjs/poptip/contribution.js.map +1 -1
  45. package/cjs/poptip/index.d.ts +1 -1
  46. package/cjs/poptip/index.js +2 -11
  47. package/cjs/poptip/index.js.map +1 -1
  48. package/cjs/poptip/module.d.ts +2 -2
  49. package/cjs/poptip/module.js +17 -10
  50. package/cjs/poptip/module.js.map +1 -1
  51. package/cjs/poptip/poptip-plugin.js +5 -12
  52. package/cjs/poptip/poptip-plugin.js.map +1 -1
  53. package/cjs/poptip/register.js.map +1 -1
  54. package/cjs/scrollbar/module.d.ts +2 -2
  55. package/cjs/scrollbar/module.js +13 -6
  56. package/cjs/scrollbar/module.js.map +1 -1
  57. package/cjs/scrollbar/scrollbar-plugin.js +5 -12
  58. package/cjs/scrollbar/scrollbar-plugin.js.map +1 -1
  59. package/cjs/segment/arc-segment.js +2 -2
  60. package/cjs/segment/arc-segment.js.map +1 -1
  61. package/cjs/segment/segment.js +5 -5
  62. package/cjs/segment/segment.js.map +1 -1
  63. package/cjs/slider/slider.d.ts +0 -1
  64. package/cjs/slider/slider.js +25 -20
  65. package/cjs/slider/slider.js.map +1 -1
  66. package/cjs/util/graphic-creator.d.ts +14 -0
  67. package/cjs/util/graphic-creator.js +22 -0
  68. package/cjs/util/graphic-creator.js.map +1 -0
  69. package/cjs/util/text.js +3 -3
  70. package/cjs/util/text.js.map +1 -1
  71. package/dist/index.es.js +11618 -11248
  72. package/es/axis/base.js +3 -1
  73. package/es/axis/base.js.map +1 -1
  74. package/es/axis/circle.js +1 -1
  75. package/es/axis/circle.js.map +1 -1
  76. package/es/axis/grid/base.js +1 -1
  77. package/es/axis/grid/base.js.map +1 -1
  78. package/es/axis/line.js +1 -1
  79. package/es/axis/line.js.map +1 -1
  80. package/es/brush/brush.js +1 -1
  81. package/es/brush/brush.js.map +1 -1
  82. package/es/brush/config.js +2 -1
  83. package/es/checkbox/index.js +1 -2
  84. package/es/core/base.js +2 -2
  85. package/es/core/base.js.map +1 -1
  86. package/es/crosshair/sector.js +1 -2
  87. package/es/data-zoom/config.js +2 -1
  88. package/es/data-zoom/renderer.js.map +1 -1
  89. package/es/empty-tip/empty-tip.js.map +1 -1
  90. package/es/index.d.ts +1 -1
  91. package/es/index.js +1 -1
  92. package/es/index.js.map +1 -1
  93. package/es/label/arc.js +1 -1
  94. package/es/label/base.js +3 -1
  95. package/es/label/base.js.map +1 -1
  96. package/es/label-item/index.js +1 -1
  97. package/es/legend/base.js +1 -1
  98. package/es/legend/base.js.map +1 -1
  99. package/es/legend/discrete/discrete.js +1 -1
  100. package/es/legend/discrete/discrete.js.map +1 -1
  101. package/es/legend/size/size.js +1 -1
  102. package/es/legend/size/size.js.map +1 -1
  103. package/es/marker/arc-area.js +1 -1
  104. package/es/marker/arc-area.js.map +1 -1
  105. package/es/marker/area.js +1 -1
  106. package/es/marker/area.js.map +1 -1
  107. package/es/marker/base.js +1 -1
  108. package/es/marker/base.js.map +1 -1
  109. package/es/marker/point.d.ts +1 -1
  110. package/es/marker/point.js +1 -1
  111. package/es/marker/point.js.map +1 -1
  112. package/es/pager/pager.js +1 -1
  113. package/es/pager/pager.js.map +1 -1
  114. package/es/poptip/contribution.js +2 -14
  115. package/es/poptip/contribution.js.map +1 -1
  116. package/es/poptip/index.d.ts +1 -1
  117. package/es/poptip/index.js +1 -1
  118. package/es/poptip/index.js.map +1 -1
  119. package/es/poptip/module.d.ts +2 -2
  120. package/es/poptip/module.js +14 -8
  121. package/es/poptip/module.js.map +1 -1
  122. package/es/poptip/poptip-plugin.js +5 -19
  123. package/es/poptip/poptip-plugin.js.map +1 -1
  124. package/es/poptip/register.js.map +1 -1
  125. package/es/scrollbar/module.d.ts +2 -2
  126. package/es/scrollbar/module.js +11 -5
  127. package/es/scrollbar/module.js.map +1 -1
  128. package/es/scrollbar/scrollbar-plugin.js +5 -13
  129. package/es/scrollbar/scrollbar-plugin.js.map +1 -1
  130. package/es/segment/arc-segment.js +1 -1
  131. package/es/segment/arc-segment.js.map +1 -1
  132. package/es/segment/segment.js +1 -1
  133. package/es/segment/segment.js.map +1 -1
  134. package/es/slider/slider.d.ts +0 -1
  135. package/es/slider/slider.js +15 -8
  136. package/es/slider/slider.js.map +1 -1
  137. package/es/util/graphic-creator.d.ts +14 -0
  138. package/es/util/graphic-creator.js +18 -0
  139. package/es/util/graphic-creator.js.map +1 -0
  140. package/es/util/text.js +3 -1
  141. package/es/util/text.js.map +1 -1
  142. package/package.json +11 -10
@@ -1,22 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
4
- var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
5
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
-
9
3
  Object.defineProperty(exports, "__esModule", {
10
4
  value: !0
11
5
  }), exports.PopTipRenderContribution = void 0;
12
6
 
13
- const vrender_core_1 = require("@visactor/vrender-core"), poptip_1 = require("./poptip"), vutils_1 = require("@visactor/vutils"), theme_1 = require("./theme");
7
+ const poptip_1 = require("./poptip"), vutils_1 = require("@visactor/vutils"), theme_1 = require("./theme");
14
8
 
15
9
  function wrapPoptip(target, source) {
16
10
  return (0, vutils_1.merge)(target, theme_1.theme.poptip, source), target;
17
11
  }
18
12
 
19
- let PopTipRenderContribution = class {
13
+ class PopTipRenderContribution {
20
14
  render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
21
15
  var _a, _b;
22
16
  if (1 === graphic._showPoptip) {
@@ -48,8 +42,7 @@ let PopTipRenderContribution = class {
48
42
  }), null === (_b = this.poptipComponent.parent) || void 0 === _b || _b.removeChild(this.poptipComponent),
49
43
  this.poptipComponent = null));
50
44
  }
51
- };
45
+ }
52
46
 
53
- PopTipRenderContribution = __decorate([ (0, vrender_core_1.injectable)() ], PopTipRenderContribution),
54
47
  exports.PopTipRenderContribution = PopTipRenderContribution;
55
48
  //# sourceMappingURL=contribution.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/contribution.ts"],"names":[],"mappings":";;;;;;;;;AAQA,yDAAoD;AACpD,qCAAkC;AAClC,6CAAyC;AACzC,mCAAgC;AAEhC,SAAS,UAAU,CAAC,MAA2B,EAAE,MAA2B;IAC1E,IAAA,cAAK,EAAC,MAAM,EAAE,aAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC;AAChB,CAAC;AAGM,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEnC,MAAM,CACJ,OAA6C,EAC7C,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH,EACnH,OAAa;;QAEb,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE;YAC7B,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAI,OAAO,CAAC,SAAiB,CAAC,MAAM,IAAI,EAAE,CAAC;YACvE,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE;gBACpE,OAAO;aACR;YACD,MAAM,SAAS,GAAG,EAAE,CAAC;YACrB,IAAA,cAAK,EACH,SAAS,EACT,eAAM,CAAC,iBAAiB,EACvB,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC,CAAE,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAC3E,CAAC;YAC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GAAG,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;oBACjC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC;gBACH,MAAA,IAAI,CAAC,eAAe,CAAC,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC/D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;aAC7B;SACF;IACH,CAAC;CACF,CAAA;AAtEY,wBAAwB;IADpC,IAAA,yBAAU,GAAE;GACA,wBAAwB,CAsEpC;AAtEY,4DAAwB","file":"contribution.js","sourcesContent":["import type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender-core';\nimport { injectable } from '@visactor/vrender-core';\nimport { PopTip } from './poptip';\nimport { merge } from '@visactor/vutils';\nimport { theme } from './theme';\n\nfunction wrapPoptip(target: Record<string, any>, source: Record<string, any>) {\n merge(target, theme.poptip, source);\n return target;\n}\n\n@injectable()\nexport class PopTipRenderContribution implements IInteractiveSubRenderContribution {\n declare poptipComponent: PopTip;\n render(\n graphic: IGraphic<Partial<IGraphicAttribute>>,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n options?: any\n ): void {\n if (graphic._showPoptip === 1) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip || {};\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n const attribute = {};\n merge(\n attribute,\n PopTip.defaultAttributes,\n (graphic.attribute as any).poptip ? (graphic.attribute as any).poptip : {}\n );\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip(attribute);\n } else {\n this.poptipComponent.initAttributes(attribute);\n }\n // 如果text图元没有配置title和content的话\n let poptip = (graphic.attribute as any).poptip || {};\n if (graphic.type === 'text' && poptip.title == null && poptip.content == null) {\n const out = {};\n wrapPoptip(out, poptip);\n poptip = out;\n poptip.content = poptip.content ?? (graphic.attribute as any).text;\n }\n const matrix = graphic.globalTransMatrix;\n this.poptipComponent.setAttributes({\n visibleAll: true,\n pickable: false,\n childrenPickable: false,\n // 默认使用bounds作为锚点\n poptipAnchor: 'bounds',\n ...poptip,\n x: matrix.e,\n y: matrix.f,\n positionBounds: graphic.globalAABBBounds\n });\n // 添加到交互层中\n drawContext.stage.tryInitInteractiveLayer();\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n } else if (graphic._showPoptip === 2) {\n graphic._showPoptip = 0;\n if (this.poptipComponent) {\n this.poptipComponent.setAttributes({\n visibleAll: false\n });\n this.poptipComponent.parent?.removeChild(this.poptipComponent);\n this.poptipComponent = null;\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/contribution.ts"],"names":[],"mappings":";;;AAQA,qCAAkC;AAClC,6CAAyC;AACzC,mCAAgC;AAEhC,SAAS,UAAU,CAAC,MAA2B,EAAE,MAA2B;IAC1E,IAAA,cAAK,EAAC,MAAM,EAAE,aAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAa,wBAAwB;IAEnC,MAAM,CACJ,OAA6C,EAC7C,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH,EACnH,OAAa;;QAEb,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC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ACnB,MAAM,KACT,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,cAAc,EAAE,OAAO,CAAC,gBAAgB,IACxC,CAAC;YAEH,WAAW,CAAC,KAAK,CAAC,uBAAuB,EAAE,CAAC;YAC5C,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;YAC5E,IAAI,gBAAgB,EAAE;gBACpB,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC5C;SACF;aAAM,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE;YACpC,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;oBACjC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC;gBACH,MAAA,IAAI,CAAC,eAAe,CAAC,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC/D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;aAC7B;SACF;IACH,CAAC;CACF;AAtED,4DAsEC","file":"contribution.js","sourcesContent":["import type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender-core';\nimport { PopTip } from './poptip';\nimport { merge } from '@visactor/vutils';\nimport { theme } from './theme';\n\nfunction wrapPoptip(target: Record<string, any>, source: Record<string, any>) {\n merge(target, theme.poptip, source);\n return target;\n}\n\nexport class PopTipRenderContribution implements IInteractiveSubRenderContribution {\n declare poptipComponent: PopTip;\n render(\n graphic: IGraphic<Partial<IGraphicAttribute>>,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n options?: any\n ): void {\n if (graphic._showPoptip === 1) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip || {};\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n const attribute = {};\n merge(\n attribute,\n PopTip.defaultAttributes,\n (graphic.attribute as any).poptip ? (graphic.attribute as any).poptip : {}\n );\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip(attribute);\n } else {\n this.poptipComponent.initAttributes(attribute);\n }\n // 如果text图元没有配置title和content的话\n let poptip = (graphic.attribute as any).poptip || {};\n if (graphic.type === 'text' && poptip.title == null && poptip.content == null) {\n const out = {};\n wrapPoptip(out, poptip);\n poptip = out;\n poptip.content = poptip.content ?? (graphic.attribute as any).text;\n }\n const matrix = graphic.globalTransMatrix;\n this.poptipComponent.setAttributes({\n visibleAll: true,\n pickable: false,\n childrenPickable: false,\n // 默认使用bounds作为锚点\n poptipAnchor: 'bounds',\n ...poptip,\n x: matrix.e,\n y: matrix.f,\n positionBounds: graphic.globalAABBBounds\n });\n // 添加到交互层中\n drawContext.stage.tryInitInteractiveLayer();\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n } else if (graphic._showPoptip === 2) {\n graphic._showPoptip = 0;\n if (this.poptipComponent) {\n this.poptipComponent.setAttributes({\n visibleAll: false\n });\n this.poptipComponent.parent?.removeChild(this.poptipComponent);\n this.poptipComponent = null;\n }\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export * from './poptip';
2
2
  export * from './type';
3
3
  export { setPoptipTheme } from './register';
4
- export { loadPoptip } from './module';
4
+ export * from './module';
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.loadPoptip = exports.setPoptipTheme = void 0, __exportStar(require("./poptip"), exports),
20
+ }), exports.setPoptipTheme = void 0, __exportStar(require("./poptip"), exports),
21
21
  __exportStar(require("./type"), exports);
22
22
 
23
23
  var register_1 = require("./register");
@@ -27,14 +27,5 @@ Object.defineProperty(exports, "setPoptipTheme", {
27
27
  get: function() {
28
28
  return register_1.setPoptipTheme;
29
29
  }
30
- });
31
-
32
- var module_1 = require("./module");
33
-
34
- Object.defineProperty(exports, "loadPoptip", {
35
- enumerable: !0,
36
- get: function() {
37
- return module_1.loadPoptip;
38
- }
39
- });
30
+ }), __exportStar(require("./module"), exports);
40
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,mCAAsC;AAA7B,oGAAA,UAAU,OAAA","file":"index.js","sourcesContent":["export * from './poptip';\nexport * from './type';\nexport { setPoptipTheme } from './register';\nexport { loadPoptip } from './module';\n"]}
1
+ {"version":3,"sources":["../src/poptip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,2CAAyB","file":"index.js","sourcesContent":["export * from './poptip';\nexport * from './type';\nexport { setPoptipTheme } from './register';\nexport * from './module';\n"]}
@@ -1,3 +1,3 @@
1
- import { ContainerModule } from '@visactor/vrender-core';
2
- export declare const popTipModule: ContainerModule;
1
+ import { type IApp } from '@visactor/vrender-core';
2
+ export declare function installPoptipToApp(app: IApp): void;
3
3
  export declare function loadPoptip(): void;
@@ -2,20 +2,27 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.loadPoptip = exports.popTipModule = void 0;
5
+ }), exports.loadPoptip = exports.installPoptipToApp = void 0;
6
6
 
7
7
  const vrender_core_1 = require("@visactor/vrender-core"), contribution_1 = require("./contribution"), poptip_plugin_1 = require("./poptip-plugin");
8
8
 
9
+ function bindPoptip(container) {
10
+ container.isBound(contribution_1.PopTipRenderContribution) || (container.bind(contribution_1.PopTipRenderContribution).toSelf().inSingletonScope(),
11
+ container.bind(vrender_core_1.InteractiveSubRenderContribution).toService(contribution_1.PopTipRenderContribution)),
12
+ container.isBound(poptip_plugin_1.PopTipPlugin) || (container.bind(poptip_plugin_1.PopTipPlugin).toSelf(),
13
+ container.bind(vrender_core_1.AutoEnablePlugins).toService(poptip_plugin_1.PopTipPlugin)),
14
+ container.isBound(poptip_plugin_1.PopTipForClipedTextPlugin) || (container.bind(poptip_plugin_1.PopTipForClipedTextPlugin).toSelf(),
15
+ container.bind(vrender_core_1.AutoEnablePlugins).toService(poptip_plugin_1.PopTipForClipedTextPlugin));
16
+ }
17
+
18
+ function installPoptipToApp(app) {
19
+ (0, vrender_core_1.configureRuntimeApplicationForApp)(app), bindPoptip((0, vrender_core_1.getRuntimeInstallerBindingContext)()),
20
+ (0, vrender_core_1.refreshRuntimeInstallerContributions)(), (0, vrender_core_1.installRuntimeGraphicRenderersToApp)(app);
21
+ }
22
+
9
23
  function loadPoptip() {
10
- vrender_core_1.container.load(exports.popTipModule);
24
+ bindPoptip((0, vrender_core_1.getLegacyBindingContext)());
11
25
  }
12
26
 
13
- exports.popTipModule = new vrender_core_1.ContainerModule(((bind, unbind, isBound, rebind) => {
14
- isBound(contribution_1.PopTipRenderContribution) || (bind(contribution_1.PopTipRenderContribution).toSelf().inSingletonScope(),
15
- bind(vrender_core_1.InteractiveSubRenderContribution).toService(contribution_1.PopTipRenderContribution)),
16
- isBound(poptip_plugin_1.PopTipPlugin) || (bind(poptip_plugin_1.PopTipPlugin).toSelf(),
17
- bind(vrender_core_1.AutoEnablePlugins).toService(poptip_plugin_1.PopTipPlugin)),
18
- isBound(poptip_plugin_1.PopTipForClipedTextPlugin) || (bind(poptip_plugin_1.PopTipForClipedTextPlugin).toSelf(),
19
- bind(vrender_core_1.AutoEnablePlugins).toService(poptip_plugin_1.PopTipForClipedTextPlugin));
20
- })), exports.loadPoptip = loadPoptip;
27
+ exports.installPoptipToApp = installPoptipToApp, exports.loadPoptip = loadPoptip;
21
28
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/module.ts"],"names":[],"mappings":";;;AAAA,yDAKgC;AAChC,iDAA0D;AAC1D,mDAA0E;AAE7D,QAAA,YAAY,GAAG,IAAI,8BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAChF,IAAI,CAAC,OAAO,CAAC,uCAAwB,CAAC,EAAE;QACtC,IAAI,CAAC,uCAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC3D,IAAI,CAAC,+CAAgC,CAAC,CAAC,SAAS,CAAC,uCAAwB,CAAC,CAAC;KAC5E;IACD,IAAI,CAAC,OAAO,CAAC,4BAAY,CAAC,EAAE;QAC1B,IAAI,CAAC,4BAAY,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,4BAAY,CAAC,CAAC;KACjD;IACD,IAAI,CAAC,OAAO,CAAC,yCAAyB,CAAC,EAAE;QACvC,IAAI,CAAC,yCAAyB,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,yCAAyB,CAAC,CAAC;KAC9D;AACH,CAAC,CAAC,CAAC;AAEH,SAAgB,UAAU;IACxB,wBAAS,CAAC,IAAI,CAAC,oBAAY,CAAC,CAAC;AAC/B,CAAC;AAFD,gCAEC","file":"module.js","sourcesContent":["import {\n InteractiveSubRenderContribution,\n AutoEnablePlugins,\n ContainerModule,\n container\n} from '@visactor/vrender-core';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin, PopTipForClipedTextPlugin } from './poptip-plugin';\n\nexport const popTipModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (!isBound(PopTipRenderContribution)) {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n }\n if (!isBound(PopTipPlugin)) {\n bind(PopTipPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n }\n if (!isBound(PopTipForClipedTextPlugin)) {\n bind(PopTipForClipedTextPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);\n }\n});\n\nexport function loadPoptip() {\n container.load(popTipModule);\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/module.ts"],"names":[],"mappings":";;;AAAA,yDASgC;AAChC,iDAA0D;AAC1D,mDAA0E;AAE1E,SAAS,UAAU,CAAC,SAAyF;IAC3G,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,uCAAwB,CAAC,EAAE;QAChD,SAAS,CAAC,IAAI,CAAC,uCAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACrE,SAAS,CAAC,IAAI,CAAC,+CAAgC,CAAC,CAAC,SAAS,CAAC,uCAAwB,CAAC,CAAC;KACtF;IACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,4BAAY,CAAC,EAAE;QACpC,SAAS,CAAC,IAAI,CAAC,4BAAY,CAAC,CAAC,MAAM,EAAE,CAAC;QACtC,SAAS,CAAC,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,4BAAY,CAAC,CAAC;KAC3D;IACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,yCAAyB,CAAC,EAAE;QACjD,SAAS,CAAC,IAAI,CAAC,yCAAyB,CAAC,CAAC,MAAM,EAAE,CAAC;QACnD,SAAS,CAAC,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,yCAAyB,CAAC,CAAC;KACxE;AACH,CAAC;AAED,SAAgB,kBAAkB,CAAC,GAAS;IAC1C,IAAA,gDAAiC,EAAC,GAAG,CAAC,CAAC;IACvC,UAAU,CAAC,IAAA,gDAAiC,GAAE,CAAC,CAAC;IAChD,IAAA,mDAAoC,GAAE,CAAC;IACvC,IAAA,kDAAmC,EAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AALD,gDAKC;AAED,SAAgB,UAAU;IACxB,UAAU,CAAC,IAAA,sCAAuB,GAAE,CAAC,CAAC;AACxC,CAAC;AAFD,gCAEC","file":"module.js","sourcesContent":["import {\n AutoEnablePlugins,\n InteractiveSubRenderContribution,\n configureRuntimeApplicationForApp,\n getLegacyBindingContext,\n getRuntimeInstallerBindingContext,\n installRuntimeGraphicRenderersToApp,\n refreshRuntimeInstallerContributions,\n type IApp\n} from '@visactor/vrender-core';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin, PopTipForClipedTextPlugin } from './poptip-plugin';\n\nfunction bindPoptip(container: Pick<ReturnType<typeof getRuntimeInstallerBindingContext>, 'bind' | 'isBound'>) {\n if (!container.isBound(PopTipRenderContribution)) {\n container.bind(PopTipRenderContribution).toSelf().inSingletonScope();\n container.bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n }\n if (!container.isBound(PopTipPlugin)) {\n container.bind(PopTipPlugin).toSelf();\n container.bind(AutoEnablePlugins).toService(PopTipPlugin);\n }\n if (!container.isBound(PopTipForClipedTextPlugin)) {\n container.bind(PopTipForClipedTextPlugin).toSelf();\n container.bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);\n }\n}\n\nexport function installPoptipToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n bindPoptip(getRuntimeInstallerBindingContext());\n refreshRuntimeInstallerContributions();\n installRuntimeGraphicRenderersToApp(app);\n}\n\nexport function loadPoptip() {\n bindPoptip(getLegacyBindingContext());\n}\n"]}
@@ -1,11 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
4
- var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
5
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
-
9
3
  Object.defineProperty(exports, "__esModule", {
10
4
  value: !0
11
5
  }), exports.PopTipForClipedTextPlugin = exports.PopTipPlugin = exports.PopTipPluginBase = void 0;
@@ -47,15 +41,15 @@ class PopTipPluginBase {
47
41
 
48
42
  exports.PopTipPluginBase = PopTipPluginBase;
49
43
 
50
- let PopTipPlugin = class extends PopTipPluginBase {
44
+ class PopTipPlugin extends PopTipPluginBase {
51
45
  constructor() {
52
46
  super(...arguments), this.name = "poptip", this.key = this.name + this._uid;
53
47
  }
54
- };
48
+ }
55
49
 
56
- PopTipPlugin = __decorate([ (0, vrender_core_1.injectable)() ], PopTipPlugin), exports.PopTipPlugin = PopTipPlugin;
50
+ exports.PopTipPlugin = PopTipPlugin;
57
51
 
58
- let PopTipForClipedTextPlugin = class extends PopTipPluginBase {
52
+ class PopTipForClipedTextPlugin extends PopTipPluginBase {
59
53
  constructor() {
60
54
  super(...arguments), this.name = "poptipForText", this.key = this.name + this._uid,
61
55
  this.pointerlave = e => {
@@ -78,8 +72,7 @@ let PopTipForClipedTextPlugin = class extends PopTipPluginBase {
78
72
  const {stage: stage} = this.pluginService;
79
73
  super.deactivate(context), stage.removeEventListener("pointerleave", this.pointerlave);
80
74
  }
81
- };
75
+ }
82
76
 
83
- PopTipForClipedTextPlugin = __decorate([ (0, vrender_core_1.injectable)() ], PopTipForClipedTextPlugin),
84
77
  exports.PopTipForClipedTextPlugin = PopTipForClipedT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;YACvB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;YACrC,IAAI,CAAC,CAAC,MAAM,KAAK,KAAK,EAAE;gBACtB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;aAClB;QACH,CAAC,CAAC;IAoBJ,CAAC;IAhCC,QAAQ,CAAC,OAAuB;QAC9B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QAErC,KAAK,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAQD,QAAQ,CAAC,OAAiB;QACxB,OAAO,CACL,OAAO,CAAC,IAAI,KAAK,MAAM;YACvB,CAAC,OAAO,CAAC,MAAM;YACf,OAAO,CAAC,WAAW;YACnB,CAAC,OAAO,CAAC,SAAS;YACjB,OAAe,CAAC,SAAS,CAAC,uBAAuB,CACnD,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,OAAiB;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1B,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AApCY,yBAAyB;IADrC,IAAA,yBAAU,GAAE;GACA,yBAAyB,CAoCrC;AApCY,8DAAyB","file":"poptip-plugin.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator, injectable } from '@visactor/vrender-core';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\nexport abstract class PopTipPluginBase {\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n }\n\n needHide(graphic: IGraphic) {\n return graphic.isContainer || !graphic.attribute;\n }\n\n needShow(graphic: IGraphic) {\n return !!(graphic.attribute as any).poptip;\n }\n\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (this.needHide(graphic)) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n if (this.needShow(graphic)) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n }\n}\n\n@injectable()\nexport class PopTipPlugin extends PopTipPluginBase implements IPlugin {\n name: 'poptip' = 'poptip';\n key: string = this.name + this._uid;\n}\n\n@injectable()\nexport class PopTipForClipedTextPlugin extends PopTipPluginBase implements IPlugin {\n name: 'poptipForText' = 'poptipForText';\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n super.activate(context);\n\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerleave', this.pointerlave);\n }\n pointerlave = (e: any) => {\n const { stage } = this.pluginService;\n if (e.target === stage) {\n this.unpoptip(e);\n }\n };\n\n needHide(graphic: IGraphic) {\n return (\n graphic.type !== 'text' ||\n !graphic.cliped ||\n graphic.isContainer ||\n !graphic.attribute ||\n (graphic as any).attribute.disableAutoClipedPoptip\n );\n }\n needShow(graphic: IGraphic): boolean {\n return true;\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n super.deactivate(context);\n stage.removeEventListener('pointerleave', this.pointerlave);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/poptip-plugin.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AAInD,MAAsB,gBAAgB;IAAtC;QACE,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,wBAAS,CAAC,kBAAkB,EAAE,CAAC;QAkB9C,WAAM,GAAG,CAAC,CAAwB,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAa,CAAC;YAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAC1B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO;aACR;YAED,IAAI,OAAO,KAAK,IAAI,CAAC,aAAa,EAAE;gBAClC,OAAO;aACR;YACD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAC1B,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAC1B,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;aACzB;YAED,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACrC,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,CAAC,CAAC;aACpC;YAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;gBACvB,OAAO;aACR;YACD,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YACrC,IAAI,CAA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,CAAC,CAAM,EAAE,EAAE;YACvB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;YACrC,IAAI,CAAC,CAAC,MAAM,KAAK,KAAK,EAAE;gBACtB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;aAClB;QACH,CAAC,CAAC;IAoBJ,CAAC;IAhCC,QAAQ,CAAC,OAAuB;QAC9B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QAErC,KAAK,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAQD,QAAQ,CAAC,OAAiB;QACxB,OAAO,CACL,OAAO,CAAC,IAAI,KAAK,MAAM;YACvB,CAAC,OAAO,CAAC,MAAM;YACf,OAAO,CAAC,WAAW;YACnB,CAAC,OAAO,CAAC,SAAS;YACjB,OAAe,CAAC,SAAS,CAAC,uBAAuB,CACnD,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,OAAiB;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1B,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF;AApCD,8DAoCC","file":"poptip-plugin.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator } from '@visactor/vrender-core';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\nexport abstract class PopTipPluginBase {\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n }\n\n needHide(graphic: IGraphic) {\n return graphic.isContainer || !graphic.attribute;\n }\n\n needShow(graphic: IGraphic) {\n return !!(graphic.attribute as any).poptip;\n }\n\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (this.needHide(graphic)) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n if (this.needShow(graphic)) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n }\n}\n\nexport class PopTipPlugin extends PopTipPluginBase implements IPlugin {\n name: 'poptip' = 'poptip';\n key: string = this.name + this._uid;\n}\n\nexport class PopTipForClipedTextPlugin extends PopTipPluginBase implements IPlugin {\n name: 'poptipForText' = 'poptipForText';\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n super.activate(context);\n\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerleave', this.pointerlave);\n }\n pointerlave = (e: any) => {\n const { stage } = this.pluginService;\n if (e.target === stage) {\n this.unpoptip(e);\n }\n };\n\n needHide(graphic: IGraphic) {\n return (\n graphic.type !== 'text' ||\n !graphic.cliped ||\n graphic.isContainer ||\n !graphic.attribute ||\n (graphic as any).attribute.disableAutoClipedPoptip\n );\n }\n needShow(graphic: IGraphic): boolean {\n return true;\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n super.deactivate(context);\n stage.removeEventListener('pointerleave', this.pointerlave);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/register.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,mCAA+C;AAC/C,yDAAmG;AAEnG,SAAgB,mBAAmB;IACjC,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IACf,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;AACjB,CAAC;AALD,kDAKC;AAED,SAAgB,cAAc,CAAC,kBAAoC;IACjE,IAAA,cAAK,EAAC,aAAK,CAAC,MAAM,EAAE,qBAAa,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC;AAFD,wCAEC","file":"register.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { PopTipAttributes } from './type';\nimport { DEFAULT_THEME, theme } from './theme';\nimport { registerGroup, registerRect, registerSymbol, registerText } from '@visactor/vrender-kits';\n\nexport function loadPoptipComponent() {\n registerGroup();\n registerText();\n registerSymbol();\n registerRect();\n}\n\nexport function setPoptipTheme(defaultPoptipTheme: PopTipAttributes) {\n merge(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/register.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,mCAA+C;AAC/C,yDAAmG;AAEnG,SAAgB,mBAAmB;IACjC,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,2BAAY,GAAE,CAAC;IACf,IAAA,6BAAc,GAAE,CAAC;IACjB,IAAA,2BAAY,GAAE,CAAC;AACjB,CAAC;AALD,kDAKC;AAED,SAAgB,cAAc,CAAC,kBAAoC;IACjE,IAAA,cAAK,EAAC,aAAK,CAAC,MAAM,EAAE,qBAAa,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC;AAFD,wCAEC","file":"register.js","sourcesContent":["import { merge } from '@visactor/vutils';\nimport type { PopTipAttributes } from './type';\nimport { DEFAULT_THEME, theme } from './theme';\nimport { registerGroup, registerRect, registerSymbol, registerText } from '@visactor/vrender-kits';\n\nexport function loadPoptipComponent() {\n registerGroup();\n registerText();\n registerSymbol();\n registerRect();\n}\n\nexport function setPoptipTheme(defaultPoptipTheme: PopTipAttributes) {\n merge(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { ContainerModule } from '@visactor/vrender-core';
2
- export declare const scrollbarModule: ContainerModule;
1
+ import { type IApp } from '@visactor/vrender-core';
2
+ export declare function installScrollbarToApp(app: IApp): void;
3
3
  export declare function loadScrollbar(): void;
@@ -2,16 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.loadScrollbar = exports.scrollbarModule = void 0;
5
+ }), exports.loadScrollbar = exports.installScrollbarToApp = void 0;
6
6
 
7
7
  const vrender_core_1 = require("@visactor/vrender-core"), scrollbar_plugin_1 = require("./scrollbar-plugin");
8
8
 
9
+ function bindScrollbar(container) {
10
+ container.isBound(scrollbar_plugin_1.ScrollBarPlugin) || (container.bind(scrollbar_plugin_1.ScrollBarPlugin).toSelf(),
11
+ container.bind(vrender_core_1.AutoEnablePlugins).toService(scrollbar_plugin_1.ScrollBarPlugin));
12
+ }
13
+
14
+ function installScrollbarToApp(app) {
15
+ (0, vrender_core_1.configureRuntimeApplicationForApp)(app), bindScrollbar((0, vrender_core_1.getRuntimeInstallerBindingContext)()),
16
+ (0, vrender_core_1.refreshRuntimeInstallerContributions)();
17
+ }
18
+
9
19
  function loadScrollbar() {
10
- vrender_core_1.container.load(exports.scrollbarModule);
20
+ bindScrollbar((0, vrender_core_1.getLegacyBindingContext)());
11
21
  }
12
22
 
13
- exports.scrollbarModule = new vrender_core_1.ContainerModule(((bind, unbind, isBound, rebind) => {
14
- isBound(scrollbar_plugin_1.ScrollBarPlugin) || (bind(scrollbar_plugin_1.ScrollBarPlugin).toSelf(),
15
- bind(vrender_core_1.AutoEnablePlugins).toService(scrollbar_plugin_1.ScrollBarPlugin));
16
- })), exports.loadScrollbar = loadScrollbar;
23
+ exports.installScrollbarToApp = installScrollbarToApp, exports.loadScrollbar = loadScrollbar;
17
24
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scrollbar/module.ts"],"names":[],"mappings":";;;AAAA,yDAAuF;AACvF,yDAAqD;AAExC,QAAA,eAAe,GAAG,IAAI,8BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACnF,IAAI,CAAC,OAAO,CAAC,kCAAe,CAAC,EAAE;QAC7B,IAAI,CAAC,kCAAe,CAAC,CAAC,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,kCAAe,CAAC,CAAC;KACpD;AACH,CAAC,CAAC,CAAC;AAEH,SAAgB,aAAa;IAC3B,wBAAS,CAAC,IAAI,CAAC,uBAAe,CAAC,CAAC;AAClC,CAAC;AAFD,sCAEC","file":"module.js","sourcesContent":["import { AutoEnablePlugins, ContainerModule, container } from '@visactor/vrender-core';\nimport { ScrollBarPlugin } from './scrollbar-plugin';\n\nexport const scrollbarModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (!isBound(ScrollBarPlugin)) {\n bind(ScrollBarPlugin).toSelf();\n bind(AutoEnablePlugins).toService(ScrollBarPlugin);\n }\n});\n\nexport function loadScrollbar() {\n container.load(scrollbarModule);\n}\n"]}
1
+ {"version":3,"sources":["../src/scrollbar/module.ts"],"names":[],"mappings":";;;AAAA,yDAOgC;AAChC,yDAAqD;AAErD,SAAS,aAAa,CAAC,SAAyF;IAC9G,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,kCAAe,CAAC,EAAE;QACvC,SAAS,CAAC,IAAI,CAAC,kCAAe,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,SAAS,CAAC,IAAI,CAAC,gCAAiB,CAAC,CAAC,SAAS,CAAC,kCAAe,CAAC,CAAC;KAC9D;AACH,CAAC;AAED,SAAgB,qBAAqB,CAAC,GAAS;IAC7C,IAAA,gDAAiC,EAAC,GAAG,CAAC,CAAC;IACvC,aAAa,CAAC,IAAA,gDAAiC,GAAE,CAAC,CAAC;IACnD,IAAA,mDAAoC,GAAE,CAAC;AACzC,CAAC;AAJD,sDAIC;AAED,SAAgB,aAAa;IAC3B,aAAa,CAAC,IAAA,sCAAuB,GAAE,CAAC,CAAC;AAC3C,CAAC;AAFD,sCAEC","file":"module.js","sourcesContent":["import {\n AutoEnablePlugins,\n configureRuntimeApplicationForApp,\n getLegacyBindingContext,\n getRuntimeInstallerBindingContext,\n refreshRuntimeInstallerContributions,\n type IApp\n} from '@visactor/vrender-core';\nimport { ScrollBarPlugin } from './scrollbar-plugin';\n\nfunction bindScrollbar(container: Pick<ReturnType<typeof getRuntimeInstallerBindingContext>, 'bind' | 'isBound'>) {\n if (!container.isBound(ScrollBarPlugin)) {\n container.bind(ScrollBarPlugin).toSelf();\n container.bind(AutoEnablePlugins).toService(ScrollBarPlugin);\n }\n}\n\nexport function installScrollbarToApp(app: IApp): void {\n configureRuntimeApplicationForApp(app);\n bindScrollbar(getRuntimeInstallerBindingContext());\n refreshRuntimeInstallerContributions();\n}\n\nexport function loadScrollbar() {\n bindScrollbar(getLegacyBindingContext());\n}\n"]}
@@ -1,18 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var ScrollBarPlugin_1, __decorate = this && this.__decorate || function(decorators, target, key, desc) {
4
- var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
5
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
-
9
3
  Object.defineProperty(exports, "__esModule", {
10
4
  value: !0
11
5
  }), exports.ScrollBarPlugin = void 0;
12
6
 
13
7
  const vrender_core_1 = require("@visactor/vrender-core"), scrollbar_1 = require("./scrollbar"), vutils_1 = require("@visactor/vutils"), constant_1 = require("../constant");
14
8
 
15
- let ScrollBarPlugin = ScrollBarPlugin_1 = class {
9
+ class ScrollBarPlugin {
16
10
  constructor() {
17
11
  this.name = "scrollbar", this.activeEvent = "onRegister", this._uid = vrender_core_1.Generator.GenAutoIncrementId(),
18
12
  this.key = this.name + this._uid, this.scroll = e => {
@@ -64,7 +58,7 @@ let ScrollBarPlugin = ScrollBarPlugin_1 = class {
64
58
  this.pluginService = context;
65
59
  const {stage: stage} = this.pluginService;
66
60
  this.childrenBounds = new vutils_1.AABBBounds, stage.addEventListener("wheel", this.scroll),
67
- this.params = ScrollBarPlugin_1.defaultParams;
61
+ this.params = ScrollBarPlugin.defaultParams;
68
62
  }
69
63
  initEventOfScrollbar(scrollContainer, scrollbar, isHorozntal) {
70
64
  scrollContainer.addEventListener("pointerover", (() => {
@@ -165,10 +159,9 @@ let ScrollBarPlugin = ScrollBarPlugin_1 = class {
165
159
  const {stage: stage} = this.pluginService;
166
160
  stage.removeEventListener("wheel", this.scroll);
167
161
  }
168
- };
162
+ }
169
163
 
170
- ScrollBarPlugin.defaultParams = {
164
+ exports.ScrollBarPlugin = ScrollBarPlugin, ScrollBarPlugin.defaultParams = {
171
165
  timeout: 500
172
- }, ScrollBarPlugin = ScrollBarPlugin_1 = __decorate([ (0, vrender_core_1.injectable)() ], ScrollBarPlugin),
173
- exports.ScrollBarPlugin = ScrollBarPlugin;
166
+ };
174
167
  //# sourceMappingURL=scrollbar-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scrollbar/scrollbar-plugin.ts"],"names":[],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,CAAC;QAEH,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE;YACzB,IAAI,KAAK,EAAE;gBACT,KAAK,GAAG,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC;aACxC;YAED,IAAI,KAAK,EAAE;gBACT,KAAK,GAAG,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;aAC1C;SACF;QAED,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAW,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAClE,CAAC;IAGD,kBAAkB,CAAC,OAAiB;QAClC,IAAI,CAAC,GAAG,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE;YACR,MAAM,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAE1C,IAAI,GAAG,EAAE;gBACP,OAAO,GAAG,CAAC;aACZ;YACD,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;SACd;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAa,CAAC,CAAC;IACzD,CAAC;;AA5TM,6BAAa,GAAY;IAC9B,OAAO,EAAE,GAAG;CACb,CAAC;AAZS,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAuU3B;AAvUY,0CAAe","file":"scrollbar-plugin.js","sourcesContent":["import type { IGraphic, IGroup, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator, injectable } from '@visactor/vrender-core';\nimport { ScrollBar } from './scrollbar';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds, abs, Bounds } from '@visactor/vutils';\nimport { SCROLLBAR_EVENT } from '../constant';\nimport type { ScrollBarAttributes } from './type';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\ntype IParams = {\n timeout?: number; // 消失的timeout\n bufferV?: number; // 判定是否出现滚动条的buffer\n bufferH?: number; // 判定是否出现滚动条的buffer\n};\n\n@injectable()\nexport class ScrollBarPlugin implements IPlugin {\n name: 'scrollbar' = 'scrollbar';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n scrollContainer?: { g: IGroup; showH: boolean; showV: boolean };\n scrollContainerBounds: IAABBBounds;\n childrenBounds: IAABBBounds;\n\n static defaultParams: IParams = {\n timeout: 500\n };\n\n params: IParams;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n this.childrenBounds = new AABBBounds();\n stage.addEventListener('wheel', this.scroll as any);\n this.params = ScrollBarPlugin.defaultParams;\n }\n scroll = (e: { deltaX: number; deltaY: number; target: IGraphic }) => {\n // 计算子元素的bounds\n const graphic = e.target as any;\n // childrenBounds.set(0, 0, scrollContainer.AABBBounds.width(), scrollContainer.AABBBounds.height());\n\n const data = this.getScrollContainer(graphic);\n\n if (!data && !this.scrollContainer) {\n return;\n }\n\n if (!data && this.scrollContainer) {\n if (!this.scrollContainer.g.stage || this.scrollContainer.g.stage !== graphic.stage) {\n return;\n }\n const newScrollContainer = this.formatScrollContainer(this.scrollContainer.g);\n\n if (!newScrollContainer) {\n this.clearScrollbar(this.scrollContainer.g, 'all');\n // 删除老的scrollbar\n return;\n }\n if (this.scrollContainer.showH && !newScrollContainer.showH) {\n this.clearScrollbar(this.scrollContainer.g, 'horizontal');\n }\n\n if (this.scrollContainer.showV && !newScrollContainer.showV) {\n this.clearScrollbar(this.scrollContainer.g, 'vertical');\n }\n\n this.scrollContainer = newScrollContainer;\n } else if (data && this.scrollContainer && data.g !== this.scrollContainer.g) {\n this.clearScrollbar(this.scrollContainer.g, 'all');\n }\n\n this.scrollContainer = data ?? this.scrollContainer;\n if (!data) {\n return;\n }\n const scrollContainer = data.g;\n if (!scrollContainer) {\n return;\n }\n const { width, height, scrollX = 0, scrollY = 0 } = scrollContainer.attribute;\n let newScrollX = scrollX;\n let newScrollY = scrollY;\n let { showH, showV } = data;\n this.scrollContainerBounds = new Bounds().set(\n 0,\n 0,\n scrollContainer.attribute.width,\n scrollContainer.attribute.height\n );\n if (showH && showH) {\n if (abs(e.deltaX) > abs(e.deltaY)) {\n showH = showH && true;\n showV = showV && false;\n } else {\n showH = showH && false;\n showV = showV && true;\n }\n }\n\n const scrollWidth = this.childrenBounds.width();\n const scrollHeight = this.childrenBounds.height();\n\n if (showH) {\n newScrollX = scrollX - (e.deltaX ?? 0);\n if (newScrollX > 0) {\n newScrollX = 0;\n } else if (newScrollX < width - scrollWidth) {\n newScrollX = width - scrollWidth;\n }\n }\n\n if (showV) {\n newScrollY = scrollY - (e.deltaY ?? 0);\n if (newScrollY > 0) {\n newScrollY = 0;\n } else if (newScrollY < height - scrollHeight) {\n newScrollY = height - scrollHeight;\n }\n }\n\n scrollContainer.setAttributes({\n scrollX: newScrollX,\n scrollY: newScrollY\n });\n this.addOrUpdateScroll(showH, showV, scrollContainer.parent, scrollContainer);\n };\n\n handleScrollBarChange = (params: any) => {\n if (\n !this.scrollContainer ||\n !this.scrollContainerBounds ||\n !this.childrenBounds ||\n !params ||\n !params.target ||\n !params.detail ||\n !params.detail.value\n ) {\n return;\n }\n const scrollbar = params.target;\n const newRange = params.detail.value;\n\n if (scrollbar.attribute.direction === 'horizontal') {\n const scrollWidth = this.childrenBounds.width();\n\n this.scrollContainer.g.setAttributes({ scrollX: -newRange[0] * scrollWidth });\n } else {\n const scrollHeight = this.childrenBounds.height();\n\n this.scrollContainer.g.setAttributes({ scrollY: -newRange[0] * scrollHeight });\n }\n };\n\n initEventOfScrollbar(scrollContainer: IGroup, scrollbar: IGroup, isHorozntal?: boolean) {\n scrollContainer.addEventListener('pointerover', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollContainer.addEventListener('pointermove', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollContainer.addEventListener('pointerout', () => {\n scrollbar.setAttribute('visibleAll', false);\n });\n scrollbar.addEventListener('pointerover', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollbar.addEventListener('pointerout', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n\n scrollbar.addEventListener('scrollUp', this.handleScrollBarChange);\n scrollbar.addEventListener(SCROLLBAR_EVENT, this.handleScrollBarChange);\n }\n\n addOrUpdateScroll(showH: boolean, showV: boolean, container: IGroup, scrollContainer: IGroup) {\n if (showH) {\n const { scrollBar: hScrollbar, isUpdate } = this.addOrUpdateHScroll(scrollContainer, container, true);\n\n if (!isUpdate) {\n this.initEventOfScrollbar(scrollContainer, hScrollbar, true);\n }\n } else {\n this.clearScrollbar(scrollContainer, 'horizontal');\n }\n if (showV) {\n const { scrollBar: vScrollbar, isUpdate } = this.addOrUpdateHScroll(scrollContainer, container, false);\n\n if (!isUpdate) {\n this.initEventOfScrollbar(scrollContainer, vScrollbar, false);\n }\n } else {\n this.clearScrollbar(scrollContainer, 'vertical');\n }\n }\n\n getDirection(isHorozntal?: boolean) {\n return isHorozntal ? 'horizontal' : 'vertical';\n }\n\n addOrUpdateHScroll(scrollContainer: IGroup, container: IGroup, isHorozntal?: boolean) {\n const direction = this.getDirection(isHorozntal);\n const name = `${scrollContainer.name ?? scrollContainer._uid}_${this.getDirection(isHorozntal)}_${this.name}`;\n const scrollbars = container.children.filter((g: ScrollBar) => g.name === name);\n let isUpdate = true;\n let scrollBar = scrollbars[0] as ScrollBar;\n\n const { y = 0, dy = 0, x = 0, dx = 0, height, width, zIndex = 0 } = this.scrollContainer.g.attribute;\n const attrs: Partial<ScrollBarAttributes> = {\n x: 0,\n y: 0,\n direction,\n zIndex: zIndex + 1,\n visibleAll: true,\n padding: [2, 0],\n railStyle: {\n fill: 'rgba(0, 0, 0, .1)'\n },\n range: [0, 0.05]\n };\n\n if (isHorozntal) {\n attrs.width = this.scrollContainerBounds.width();\n attrs.height = 12;\n } else {\n attrs.height = this.scrollContainerBounds.height();\n attrs.width = 12;\n }\n\n if (!scrollBar) {\n isUpdate = false;\n\n scrollBar = new ScrollBar(attrs as ScrollBarAttributes);\n scrollBar.name = name;\n container.add(scrollBar);\n (scrollBar as any).isScrollBar = true;\n } else if (scrollbars.length > 1) {\n scrollbars.forEach((child: IGraphic, index: number) => {\n if (index) {\n child.parent?.removeChild(child);\n }\n });\n }\n const childrenBounds = this.childrenBounds;\n\n const { scrollX, scrollY } = scrollContainer.attribute;\n if (isHorozntal) {\n const ratio = Math.min(this.scrollContainerBounds.width() / childrenBounds.width(), 1);\n const start = Math.max(Math.min(scrollX / this.childrenBounds.width(), 0), ratio - 1);\n attrs.x = x + dx;\n attrs.y = y + dy + height - (attrs.height ?? 0);\n attrs.range = [-start, -start + ratio];\n } else {\n const ratio = Math.min(this.scrollContainerBounds.height() / childrenBounds.height(), 1);\n const start = Math.max(Math.min(scrollY / this.childrenBounds.height(), 0), ratio - 1);\n attrs.x = x + dx + width - this.scrollContainerBounds.width();\n attrs.y = y + dy;\n attrs.range = [-start, -start + ratio];\n }\n\n scrollBar.setAttributes(attrs);\n return {\n scrollBar,\n isUpdate\n };\n }\n\n clearScrollbar(scrollContainer: IGroup, type: 'horizontal' | 'vertical' | 'all') {\n if (!scrollContainer.parent) {\n return;\n }\n const scrollbarBars = scrollContainer.parent.children.filter((child: IGroup) => {\n return (child as any).isScrollBar && (type === 'all' || (child.attribute as any).direction === type);\n });\n\n scrollbarBars.forEach((child: IGraphic) => {\n child.parent.removeChild(child);\n });\n }\n\n formatScrollContainer(g: IGraphic) {\n if (!g || g.type !== 'group' || !g.attribute) {\n return null;\n }\n\n const { overflow, width, height } = (g as IGroup).attribute;\n\n if (!overflow || overflow === 'hidden') {\n return null;\n }\n\n let showH = false;\n let showV = false;\n\n if (overflow === 'scroll') {\n showH = true;\n showV = true;\n } else {\n showH = overflow === 'scroll-x';\n showV = !showH;\n }\n\n const childrenBounds = this.childrenBounds;\n\n childrenBounds.clear();\n g.forEachChildren((g: IGraphic) => {\n childrenBounds.union(g.AABBBounds);\n });\n\n if (!g.AABBBounds.empty()) {\n if (showH) {\n showH = width < childrenBounds.width();\n }\n\n if (showV) {\n showV = height < childrenBounds.height();\n }\n }\n\n return showH || showV ? { g: g as IGroup, showH, showV } : null;\n }\n\n // 获取响应滚动的元素\n getScrollContainer(graphic: IGraphic): { g: IGroup; showH: boolean; showV: boolean } | null {\n let g = graphic;\n while (g) {\n const res = this.formatScrollContainer(g);\n\n if (res) {\n return res;\n }\n g = g.parent;\n }\n return null;\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('wheel', this.scroll as any);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/scrollbar/scrollbar-plugin.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AACnD,2CAAwC;AAExC,6CAA2D;AAC3D,0CAA8C;AAW9C,MAAa,eAAe;IAA5B;QACE,SAAI,GAAgB,WAAW,CAAC;QAChC,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,wBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAmBpC,WAAM,GAAG,CAAC,CAAuD,EAAE,EAAE;;YAEnE,MAAM,OAAO,GAAG,CAAC,CAAC,MAAa,CAAC;YAGhC,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAE9C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBAClC,OAAO;aACR;YAED,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK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AM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,MAAa,CAAC,CAAC;IACzD,CAAC;;AAtUH,0CAuUC;AA7TQ,6BAAa,GAAY;IAC9B,OAAO,EAAE,GAAG;CACb,CAAC","file":"scrollbar-plugin.js","sourcesContent":["import type { IGraphic, IGroup, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator } from '@visactor/vrender-core';\nimport { ScrollBar } from './scrollbar';\nimport type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds, abs, Bounds } from '@visactor/vutils';\nimport { SCROLLBAR_EVENT } from '../constant';\nimport type { ScrollBarAttributes } from './type';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\ntype IParams = {\n timeout?: number; // 消失的timeout\n bufferV?: number; // 判定是否出现滚动条的buffer\n bufferH?: number; // 判定是否出现滚动条的buffer\n};\n\nexport class ScrollBarPlugin implements IPlugin {\n name: 'scrollbar' = 'scrollbar';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n scrollContainer?: { g: IGroup; showH: boolean; showV: boolean };\n scrollContainerBounds: IAABBBounds;\n childrenBounds: IAABBBounds;\n\n static defaultParams: IParams = {\n timeout: 500\n };\n\n params: IParams;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n this.childrenBounds = new AABBBounds();\n stage.addEventListener('wheel', this.scroll as any);\n this.params = ScrollBarPlugin.defaultParams;\n }\n scroll = (e: { deltaX: number; deltaY: number; target: IGraphic }) => {\n // 计算子元素的bounds\n const graphic = e.target as any;\n // childrenBounds.set(0, 0, scrollContainer.AABBBounds.width(), scrollContainer.AABBBounds.height());\n\n const data = this.getScrollContainer(graphic);\n\n if (!data && !this.scrollContainer) {\n return;\n }\n\n if (!data && this.scrollContainer) {\n if (!this.scrollContainer.g.stage || this.scrollContainer.g.stage !== graphic.stage) {\n return;\n }\n const newScrollContainer = this.formatScrollContainer(this.scrollContainer.g);\n\n if (!newScrollContainer) {\n this.clearScrollbar(this.scrollContainer.g, 'all');\n // 删除老的scrollbar\n return;\n }\n if (this.scrollContainer.showH && !newScrollContainer.showH) {\n this.clearScrollbar(this.scrollContainer.g, 'horizontal');\n }\n\n if (this.scrollContainer.showV && !newScrollContainer.showV) {\n this.clearScrollbar(this.scrollContainer.g, 'vertical');\n }\n\n this.scrollContainer = newScrollContainer;\n } else if (data && this.scrollContainer && data.g !== this.scrollContainer.g) {\n this.clearScrollbar(this.scrollContainer.g, 'all');\n }\n\n this.scrollContainer = data ?? this.scrollContainer;\n if (!data) {\n return;\n }\n const scrollContainer = data.g;\n if (!scrollContainer) {\n return;\n }\n const { width, height, scrollX = 0, scrollY = 0 } = scrollContainer.attribute;\n let newScrollX = scrollX;\n let newScrollY = scrollY;\n let { showH, showV } = data;\n this.scrollContainerBounds = new Bounds().set(\n 0,\n 0,\n scrollContainer.attribute.width,\n scrollContainer.attribute.height\n );\n if (showH && showH) {\n if (abs(e.deltaX) > abs(e.deltaY)) {\n showH = showH && true;\n showV = showV && false;\n } else {\n showH = showH && false;\n showV = showV && true;\n }\n }\n\n const scrollWidth = this.childrenBounds.width();\n const scrollHeight = this.childrenBounds.height();\n\n if (showH) {\n newScrollX = scrollX - (e.deltaX ?? 0);\n if (newScrollX > 0) {\n newScrollX = 0;\n } else if (newScrollX < width - scrollWidth) {\n newScrollX = width - scrollWidth;\n }\n }\n\n if (showV) {\n newScrollY = scrollY - (e.deltaY ?? 0);\n if (newScrollY > 0) {\n newScrollY = 0;\n } else if (newScrollY < height - scrollHeight) {\n newScrollY = height - scrollHeight;\n }\n }\n\n scrollContainer.setAttributes({\n scrollX: newScrollX,\n scrollY: newScrollY\n });\n this.addOrUpdateScroll(showH, showV, scrollContainer.parent, scrollContainer);\n };\n\n handleScrollBarChange = (params: any) => {\n if (\n !this.scrollContainer ||\n !this.scrollContainerBounds ||\n !this.childrenBounds ||\n !params ||\n !params.target ||\n !params.detail ||\n !params.detail.value\n ) {\n return;\n }\n const scrollbar = params.target;\n const newRange = params.detail.value;\n\n if (scrollbar.attribute.direction === 'horizontal') {\n const scrollWidth = this.childrenBounds.width();\n\n this.scrollContainer.g.setAttributes({ scrollX: -newRange[0] * scrollWidth });\n } else {\n const scrollHeight = this.childrenBounds.height();\n\n this.scrollContainer.g.setAttributes({ scrollY: -newRange[0] * scrollHeight });\n }\n };\n\n initEventOfScrollbar(scrollContainer: IGroup, scrollbar: IGroup, isHorozntal?: boolean) {\n scrollContainer.addEventListener('pointerover', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollContainer.addEventListener('pointermove', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollContainer.addEventListener('pointerout', () => {\n scrollbar.setAttribute('visibleAll', false);\n });\n scrollbar.addEventListener('pointerover', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n scrollbar.addEventListener('pointerout', () => {\n scrollbar.setAttribute('visibleAll', true);\n });\n\n scrollbar.addEventListener('scrollUp', this.handleScrollBarChange);\n scrollbar.addEventListener(SCROLLBAR_EVENT, this.handleScrollBarChange);\n }\n\n addOrUpdateScroll(showH: boolean, showV: boolean, container: IGroup, scrollContainer: IGroup) {\n if (showH) {\n const { scrollBar: hScrollbar, isUpdate } = this.addOrUpdateHScroll(scrollContainer, container, true);\n\n if (!isUpdate) {\n this.initEventOfScrollbar(scrollContainer, hScrollbar, true);\n }\n } else {\n this.clearScrollbar(scrollContainer, 'horizontal');\n }\n if (showV) {\n const { scrollBar: vScrollbar, isUpdate } = this.addOrUpdateHScroll(scrollContainer, container, false);\n\n if (!isUpdate) {\n this.initEventOfScrollbar(scrollContainer, vScrollbar, false);\n }\n } else {\n this.clearScrollbar(scrollContainer, 'vertical');\n }\n }\n\n getDirection(isHorozntal?: boolean) {\n return isHorozntal ? 'horizontal' : 'vertical';\n }\n\n addOrUpdateHScroll(scrollContainer: IGroup, container: IGroup, isHorozntal?: boolean) {\n const direction = this.getDirection(isHorozntal);\n const name = `${scrollContainer.name ?? scrollContainer._uid}_${this.getDirection(isHorozntal)}_${this.name}`;\n const scrollbars = container.children.filter((g: ScrollBar) => g.name === name);\n let isUpdate = true;\n let scrollBar = scrollbars[0] as ScrollBar;\n\n const { y = 0, dy = 0, x = 0, dx = 0, height, width, zIndex = 0 } = this.scrollContainer.g.attribute;\n const attrs: Partial<ScrollBarAttributes> = {\n x: 0,\n y: 0,\n direction,\n zIndex: zIndex + 1,\n visibleAll: true,\n padding: [2, 0],\n railStyle: {\n fill: 'rgba(0, 0, 0, .1)'\n },\n range: [0, 0.05]\n };\n\n if (isHorozntal) {\n attrs.width = this.scrollContainerBounds.width();\n attrs.height = 12;\n } else {\n attrs.height = this.scrollContainerBounds.height();\n attrs.width = 12;\n }\n\n if (!scrollBar) {\n isUpdate = false;\n\n scrollBar = new ScrollBar(attrs as ScrollBarAttributes);\n scrollBar.name = name;\n container.add(scrollBar);\n (scrollBar as any).isScrollBar = true;\n } else if (scrollbars.length > 1) {\n scrollbars.forEach((child: IGraphic, index: number) => {\n if (index) {\n child.parent?.removeChild(child);\n }\n });\n }\n const childrenBounds = this.childrenBounds;\n\n const { scrollX, scrollY } = scrollContainer.attribute;\n if (isHorozntal) {\n const ratio = Math.min(this.scrollContainerBounds.width() / childrenBounds.width(), 1);\n const start = Math.max(Math.min(scrollX / this.childrenBounds.width(), 0), ratio - 1);\n attrs.x = x + dx;\n attrs.y = y + dy + height - (attrs.height ?? 0);\n attrs.range = [-start, -start + ratio];\n } else {\n const ratio = Math.min(this.scrollContainerBounds.height() / childrenBounds.height(), 1);\n const start = Math.max(Math.min(scrollY / this.childrenBounds.height(), 0), ratio - 1);\n attrs.x = x + dx + width - this.scrollContainerBounds.width();\n attrs.y = y + dy;\n attrs.range = [-start, -start + ratio];\n }\n\n scrollBar.setAttributes(attrs);\n return {\n scrollBar,\n isUpdate\n };\n }\n\n clearScrollbar(scrollContainer: IGroup, type: 'horizontal' | 'vertical' | 'all') {\n if (!scrollContainer.parent) {\n return;\n }\n const scrollbarBars = scrollContainer.parent.children.filter((child: IGroup) => {\n return (child as any).isScrollBar && (type === 'all' || (child.attribute as any).direction === type);\n });\n\n scrollbarBars.forEach((child: IGraphic) => {\n child.parent.removeChild(child);\n });\n }\n\n formatScrollContainer(g: IGraphic) {\n if (!g || g.type !== 'group' || !g.attribute) {\n return null;\n }\n\n const { overflow, width, height } = (g as IGroup).attribute;\n\n if (!overflow || overflow === 'hidden') {\n return null;\n }\n\n let showH = false;\n let showV = false;\n\n if (overflow === 'scroll') {\n showH = true;\n showV = true;\n } else {\n showH = overflow === 'scroll-x';\n showV = !showH;\n }\n\n const childrenBounds = this.childrenBounds;\n\n childrenBounds.clear();\n g.forEachChildren((g: IGraphic) => {\n childrenBounds.union(g.AABBBounds);\n });\n\n if (!g.AABBBounds.empty()) {\n if (showH) {\n showH = width < childrenBounds.width();\n }\n\n if (showV) {\n showV = height < childrenBounds.height();\n }\n }\n\n return showH || showV ? { g: g as IGroup, showH, showV } : null;\n }\n\n // 获取响应滚动的元素\n getScrollContainer(graphic: IGraphic): { g: IGroup; showH: boolean; showV: boolean } | null {\n let g = graphic;\n while (g) {\n const res = this.formatScrollContainer(g);\n\n if (res) {\n return res;\n }\n g = g.parent;\n }\n return null;\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('wheel', this.scroll as any);\n }\n}\n"]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.ArcSegment = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core"), register_1 = require("./register"), segment_1 = require("./segment");
7
+ const vutils_1 = require("@visactor/vutils"), graphic_creator_1 = require("../util/graphic-creator"), register_1 = require("./register"), segment_1 = require("./segment");
8
8
 
9
9
  (0, register_1.loadArcSegmentComponent)();
10
10
 
@@ -45,7 +45,7 @@ class ArcSegment extends segment_1.Segment {
45
45
  this._mainSegmentPoints = [ startPoint, endPoint ];
46
46
  const startSymbolShape = this._renderSymbol(startSymbol, this._mainSegmentPoints, "start"), endSymbolShape = this._renderSymbol(endSymbol, this._mainSegmentPoints, "end");
47
47
  this.startSymbol = startSymbolShape, this.endSymbol = endSymbolShape;
48
- const line = vrender_core_1.graphicCreator.arc(Object.assign({
48
+ const line = graphic_creator_1.graphicCreator.arc(Object.assign({
49
49
  x: center.x,
50
50
  y: center.y,
51
51
  startAngle: startAngle,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/segment/arc-segment.ts"],"names":[],"mappings":";;;AAGA,6CAAkD;AAGlD,yDAAwD;AAIxD,yCAAqD;AACrD,uCAAoC;AAEpC,IAAA,kCAAuB,GAAE,CAAC;AAC1B,MAAa,UAAW,SAAQ,iBAAO;IAMrC,YAAY,UAAgC,EAAE,OAA0B;QACtE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,iBAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAN9F,SAAI,GAAG,aAAa,CAAC;QACrB,QAAG,GAAG,aAAa,CAAC;QAEpB,iBAAY,GAAY,KAAK,CAAC;IAI9B,CAAC;IAKD,aAAa;QAEX,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAIpG,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GA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AAG,GAAG,IAAI,CAAC,IAAI,OAAO,CAAC;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACxC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AA3GD,gCA2GC","file":"arc-segment.js","sourcesContent":["/**\n * @description 标签组件\n */\nimport { isEmpty, merge } from '@visactor/vutils';\nimport type { IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport type { ArcSegmentAttributes, SymbolAttributes } from './type';\nimport type { Point } from '../core/type';\nimport type { ComponentOptions } from '../interface';\nimport { loadArcSegmentComponent } from './register';\nimport { Segment } from './segment';\n\nloadArcSegmentComponent();\nexport class ArcSegment extends Segment {\n name = 'arc-segment';\n key = 'arc-segment';\n line?: IArc;\n isReverseArc: boolean = false;\n\n constructor(attributes: ArcSegmentAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, Segment.defaultAttributes, attributes));\n }\n\n /**\n * 外部获取segment起点切线正方向\n */\n getStartAngle() {\n // 如果是顺时针弧, start切线方向 = 弧度方向 - Math.PI / 2, 反之相反\n const tangAng = this.isReverseArc ? this._startAngle + Math.PI / 2 : this._startAngle - Math.PI / 2;\n\n // 经过刚刚的计算角度范围: [0, 360] => [-90, 270] 或 [0, 450]\n // 将其规范范围到[0, 360]\n return tangAng < 0 ? tangAng + Math.PI * 2 : tangAng > Math.PI * 2 ? tangAng - Math.PI * 2 : tangAng;\n }\n\n /**\n * 外部获取segment终点切线正方向\n */\n getEndAngle() {\n // 如果是顺时针弧, end切线方向 = 弧度方向 + Math.PI / 2, 反之相反\n const tangAng = this.isReverseArc ? this._endAngle - Math.PI / 2 : this._endAngle + Math.PI / 2;\n\n // 经过刚刚的计算角度范围: [0, 360] => [-90, 270] 或 [0, 450]\n // 将其规范范围到[0, 360]\n return tangAng < 0 ? tangAng + Math.PI * 2 : tangAng > Math.PI * 2 ? tangAng - Math.PI * 2 : tangAng;\n }\n\n getMainSegmentPoints() {\n return this._mainSegmentPoints;\n }\n\n protected _computeStartRotate(angle: number) {\n return this.isReverseArc ? angle + Math.PI : angle;\n }\n\n protected _computeEndRotate(angle: number) {\n return this.isReverseArc ? angle : angle + Math.PI;\n }\n\n protected render() {\n this.removeAllChild(true);\n this._reset();\n const {\n // points,\n startSymbol,\n endSymbol,\n lineStyle,\n state,\n visible = true,\n radius,\n startAngle,\n endAngle,\n center\n } = this.attribute as ArcSegmentAttributes;\n\n if (!visible) {\n return;\n }\n\n this._startAngle = startAngle;\n this._endAngle = endAngle;\n this.isReverseArc = startAngle > endAngle;\n\n // 绘制start和end symbol\n const startPoint: Point = {\n x: center.x + radius * Math.cos(this._startAngle),\n y: center.y + radius * Math.sin(this._startAngle)\n };\n const endPoint: Point = {\n x: center.x + radius * Math.cos(this._endAngle),\n y: center.y + radius * Math.sin(this._endAngle)\n };\n this._mainSegmentPoints = [startPoint, endPoint];\n\n const startSymbolShape = this._renderSymbol(startSymbol as SymbolAttributes, this._mainSegmentPoints, 'start');\n const endSymbolShape = this._renderSymbol(endSymbol as SymbolAttributes, this._mainSegmentPoints, 'end');\n\n this.startSymbol = startSymbolShape;\n this.endSymbol = endSymbolShape;\n\n const line = graphicCreator.arc({\n x: center.x,\n y: center.y,\n // startAngle: Math.PI + 0.5,\n // endAngle: 0,\n startAngle,\n endAngle,\n innerRadius: radius,\n outerRadius: radius,\n ...lineStyle\n });\n\n line.name = `${this.name}-line`;\n line.id = this._getNodeId('arc');\n if (!isEmpty(state?.line)) {\n line.states = [].concat(state.line)[0];\n }\n this.add(line);\n this.line = line;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/segment/arc-segment.ts"],"names":[],"mappings":";;;AAGA,6CAAkD;AAGlD,6DAAyD;AAIzD,yCAAqD;AACrD,uCAAoC;AAEpC,IAAA,kCAAuB,GAAE,CAAC;AAC1B,MAAa,UAAW,SAAQ,iBAAO;IAMrC,YAAY,UAAgC,EAAE,OAA0B;QACtE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,iBAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAN9F,SAAI,GAAG,aAAa,CAAC;QACrB,QAAG,GAAG,aAAa,CAAC;QAEpB,iBAAY,GAAY,KAAK,CAAC;IAI9B,CAAC;IAKD,aAAa;QAEX,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAIpG,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACvG,CAAC;IAKD,WAAW;QAET,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,CA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C;SACxC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AA3GD,gCA2GC","file":"arc-segment.js","sourcesContent":["/**\n * @description 标签组件\n */\nimport { isEmpty, merge } from '@visactor/vutils';\nimport type { IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '../util/graphic-creator';\nimport type { ArcSegmentAttributes, SymbolAttributes } from './type';\nimport type { Point } from '../core/type';\nimport type { ComponentOptions } from '../interface';\nimport { loadArcSegmentComponent } from './register';\nimport { Segment } from './segment';\n\nloadArcSegmentComponent();\nexport class ArcSegment extends Segment {\n name = 'arc-segment';\n key = 'arc-segment';\n line?: IArc;\n isReverseArc: boolean = false;\n\n constructor(attributes: ArcSegmentAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, Segment.defaultAttributes, attributes));\n }\n\n /**\n * 外部获取segment起点切线正方向\n */\n getStartAngle() {\n // 如果是顺时针弧, start切线方向 = 弧度方向 - Math.PI / 2, 反之相反\n const tangAng = this.isReverseArc ? this._startAngle + Math.PI / 2 : this._startAngle - Math.PI / 2;\n\n // 经过刚刚的计算角度范围: [0, 360] => [-90, 270] 或 [0, 450]\n // 将其规范范围到[0, 360]\n return tangAng < 0 ? tangAng + Math.PI * 2 : tangAng > Math.PI * 2 ? tangAng - Math.PI * 2 : tangAng;\n }\n\n /**\n * 外部获取segment终点切线正方向\n */\n getEndAngle() {\n // 如果是顺时针弧, end切线方向 = 弧度方向 + Math.PI / 2, 反之相反\n const tangAng = this.isReverseArc ? this._endAngle - Math.PI / 2 : this._endAngle + Math.PI / 2;\n\n // 经过刚刚的计算角度范围: [0, 360] => [-90, 270] 或 [0, 450]\n // 将其规范范围到[0, 360]\n return tangAng < 0 ? tangAng + Math.PI * 2 : tangAng > Math.PI * 2 ? tangAng - Math.PI * 2 : tangAng;\n }\n\n getMainSegmentPoints() {\n return this._mainSegmentPoints;\n }\n\n protected _computeStartRotate(angle: number) {\n return this.isReverseArc ? angle + Math.PI : angle;\n }\n\n protected _computeEndRotate(angle: number) {\n return this.isReverseArc ? angle : angle + Math.PI;\n }\n\n protected render() {\n this.removeAllChild(true);\n this._reset();\n const {\n // points,\n startSymbol,\n endSymbol,\n lineStyle,\n state,\n visible = true,\n radius,\n startAngle,\n endAngle,\n center\n } = this.attribute as ArcSegmentAttributes;\n\n if (!visible) {\n return;\n }\n\n this._startAngle = startAngle;\n this._endAngle = endAngle;\n this.isReverseArc = startAngle > endAngle;\n\n // 绘制start和end symbol\n const startPoint: Point = {\n x: center.x + radius * Math.cos(this._startAngle),\n y: center.y + radius * Math.sin(this._startAngle)\n };\n const endPoint: Point = {\n x: center.x + radius * Math.cos(this._endAngle),\n y: center.y + radius * Math.sin(this._endAngle)\n };\n this._mainSegmentPoints = [startPoint, endPoint];\n\n const startSymbolShape = this._renderSymbol(startSymbol as SymbolAttributes, this._mainSegmentPoints, 'start');\n const endSymbolShape = this._renderSymbol(endSymbol as SymbolAttributes, this._mainSegmentPoints, 'end');\n\n this.startSymbol = startSymbolShape;\n this.endSymbol = endSymbolShape;\n\n const line = graphicCreator.arc({\n x: center.x,\n y: center.y,\n // startAngle: Math.PI + 0.5,\n // endAngle: 0,\n startAngle,\n endAngle,\n innerRadius: radius,\n outerRadius: radius,\n ...lineStyle\n });\n\n line.name = `${this.name}-line`;\n line.id = this._getNodeId('arc');\n if (!isEmpty(state?.line)) {\n line.states = [].concat(state.line)[0];\n }\n this.add(line);\n this.line = line;\n }\n}\n"]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Segment = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core"), base_1 = require("../core/base"), register_1 = require("./register"), vutils_2 = require("@visactor/vutils");
7
+ const vutils_1 = require("@visactor/vutils"), graphic_creator_1 = require("../util/graphic-creator"), base_1 = require("../core/base"), register_1 = require("./register"), vutils_2 = require("@visactor/vutils");
8
8
 
9
9
  (0, register_1.loadSegmentComponent)();
10
10
 
@@ -36,7 +36,7 @@ class Segment extends base_1.AbstractComponent {
36
36
  }
37
37
  points.forEach(((point, index) => {
38
38
  var _a, _b;
39
- const line = vrender_core_1.graphicCreator.line(Object.assign(Object.assign({
39
+ const line = graphic_creator_1.graphicCreator.line(Object.assign(Object.assign({
40
40
  points: point
41
41
  }, (0, vutils_1.isArray)(lineStyle) ? null !== (_a = lineStyle[index]) && void 0 !== _a ? _a : lineStyle[lineStyle.length - 1] : lineStyle), {
42
42
  fill: !1
@@ -46,8 +46,8 @@ class Segment extends base_1.AbstractComponent {
46
46
  this.add(line), this.lines.push(line);
47
47
  }));
48
48
  } else {
49
- let lineCreator = vrender_core_1.graphicCreator.line;
50
- (0, vutils_1.array)(lineStyle)[0].cornerRadius && (lineCreator = vrender_core_1.graphicCreator.polygon);
49
+ let lineCreator = graphic_creator_1.graphicCreator.line;
50
+ (0, vutils_1.array)(lineStyle)[0].cornerRadius && (lineCreator = graphic_creator_1.graphicCreator.polygon);
51
51
  const line = lineCreator(Object.assign(Object.assign({
52
52
  points: this._clipPoints(this.attribute.points)
53
53
  }, (0, vutils_1.array)(lineStyle)[0]), {
@@ -77,7 +77,7 @@ class Segment extends base_1.AbstractComponent {
77
77
  }, rotate = this._computeStartRotate(this._startAngle)) : (position = {
78
78
  x: end.x + ((0, vutils_1.isValidNumber)(endAngle) ? refX * Math.cos(endAngle) + refY * Math.cos(endAngle - Math.PI / 2) : 0),
79
79
  y: end.y + ((0, vutils_1.isValidNumber)(endAngle) ? refX * Math.sin(endAngle) + refY * Math.sin(endAngle - Math.PI / 2) : 0)
80
- }, rotate = this._computeEndRotate(this._endAngle)), symbol = vrender_core_1.graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
80
+ }, rotate = this._computeEndRotate(this._endAngle)), symbol = graphic_creator_1.graphicCreator.symbol(Object.assign(Object.assign(Object.assign({}, position), {
81
81
  symbolType: symbolType,
82
82
  size: size,
83
83
  angle: autoRotate ? rotate + refAngle : 0,