@visactor/vrender-components 0.13.2-alpha.2 → 0.13.2

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 (71) hide show
  1. package/cjs/core/type.js +1 -2
  2. package/cjs/crosshair/circle.js +2 -1
  3. package/cjs/index.d.ts +1 -1
  4. package/cjs/index.js +1 -1
  5. package/cjs/index.js.map +1 -1
  6. package/cjs/indicator/type.js +1 -2
  7. package/cjs/label/symbol.js +2 -1
  8. package/cjs/marker/area.js +1 -1
  9. package/cjs/marker/base.js +1 -2
  10. package/cjs/marker/config.js +1 -1
  11. package/cjs/marker/index.js +1 -1
  12. package/cjs/marker/line.js +1 -1
  13. package/cjs/marker/point.js +1 -1
  14. package/cjs/marker/type.js +1 -1
  15. package/cjs/pager/pager.js +2 -1
  16. package/cjs/pager/type.js +1 -1
  17. package/cjs/player/base-player.js +1 -1
  18. package/cjs/player/constant.js +1 -1
  19. package/cjs/player/continuous-player.js +1 -1
  20. package/cjs/player/discrete-player.js +1 -1
  21. package/cjs/player/index.js +1 -1
  22. package/cjs/player/utils.js +1 -1
  23. package/cjs/poptip/contribution.js +25 -9
  24. package/cjs/poptip/contribution.js.map +1 -1
  25. package/cjs/poptip/poptip-plugin.d.ts +13 -0
  26. package/cjs/poptip/poptip-plugin.js +39 -5
  27. package/cjs/poptip/poptip-plugin.js.map +1 -1
  28. package/cjs/poptip/register.d.ts +2 -1
  29. package/cjs/poptip/register.js +7 -6
  30. package/cjs/poptip/register.js.map +1 -1
  31. package/cjs/poptip/theme.d.ts +4 -0
  32. package/cjs/poptip/theme.js +26 -0
  33. package/cjs/poptip/theme.js.map +1 -0
  34. package/dist/index.js +117 -13
  35. package/dist/index.min.js +1 -1
  36. package/es/core/type.js +1 -2
  37. package/es/crosshair/circle.js +2 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/index.js.map +1 -1
  41. package/es/indicator/type.js +1 -2
  42. package/es/label/symbol.js +2 -1
  43. package/es/marker/area.js +1 -1
  44. package/es/marker/base.js +1 -2
  45. package/es/marker/config.js +1 -1
  46. package/es/marker/index.js +1 -1
  47. package/es/marker/line.js +1 -1
  48. package/es/marker/point.js +1 -1
  49. package/es/marker/type.js +1 -1
  50. package/es/pager/pager.js +2 -1
  51. package/es/pager/type.js +1 -1
  52. package/es/player/base-player.js +1 -1
  53. package/es/player/constant.js +1 -1
  54. package/es/player/continuous-player.js +1 -1
  55. package/es/player/discrete-player.js +1 -1
  56. package/es/player/index.js +1 -1
  57. package/es/player/utils.js +1 -1
  58. package/es/poptip/contribution.js +28 -8
  59. package/es/poptip/contribution.js.map +1 -1
  60. package/es/poptip/poptip-plugin.d.ts +13 -0
  61. package/es/poptip/poptip-plugin.js +39 -4
  62. package/es/poptip/poptip-plugin.js.map +1 -1
  63. package/es/poptip/register.d.ts +2 -1
  64. package/es/poptip/register.js +9 -4
  65. package/es/poptip/register.js.map +1 -1
  66. package/es/poptip/theme.d.ts +4 -0
  67. package/es/poptip/theme.js +22 -0
  68. package/es/poptip/theme.js.map +1 -0
  69. package/package.json +4 -4
  70. package/dist/vrender-components.js.js +0 -1
  71. package/dist/vrender-components.js.min.js +0 -1
package/es/core/type.js CHANGED
@@ -1,2 +1 @@
1
- export { };
2
- //# sourceMappingURL=type.js.map
1
+ export { };
@@ -24,4 +24,5 @@ CircleCrosshair.defaultAttributes = {
24
24
  lineWidth: 1,
25
25
  lineDash: [ 2 ]
26
26
  }
27
- };
27
+ };
28
+ //# sourceMappingURL=circle.js.map
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.13.2-alpha.2";
1
+ export declare const version = "0.13.2";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.13.2-alpha.2";
1
+ export const version = "0.13.2";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.13.2-alpha.2\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.13.2\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
@@ -1,2 +1 @@
1
- export { };
2
- //# sourceMappingURL=type.js.map
1
+ export { };
@@ -62,4 +62,5 @@ SymbolLabel.defaultAttributes = {
62
62
  position: "top",
63
63
  offset: 5,
64
64
  pickable: !1
65
- };
65
+ };
66
+ //# sourceMappingURL=symbol.js.map
package/es/marker/area.js CHANGED
@@ -70,4 +70,4 @@ export class MarkArea extends Marker {
70
70
  }
71
71
 
72
72
  MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
73
- //# sourceMappingURL=area.js.map
73
+ //# sourceMappingURL=area.js.map
package/es/marker/base.js CHANGED
@@ -12,5 +12,4 @@ export class Marker extends AbstractComponent {
12
12
  group.name = "marker-container", this.add(group), this._container = group, this.initMarker(group);
13
13
  }
14
14
  }
15
- }
16
- //# sourceMappingURL=base.js.map
15
+ }
@@ -229,4 +229,4 @@ export const DEFAULT_MARK_POINT_TEXT_STYLE_MAP = {
229
229
  textBaseline: "middle"
230
230
  }
231
231
  };
232
- //# sourceMappingURL=config.js.map
232
+ //# sourceMappingURL=config.js.map
@@ -5,4 +5,4 @@ export * from "./line";
5
5
  export * from "./area";
6
6
 
7
7
  export * from "./point";
8
- //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
package/es/marker/line.js CHANGED
@@ -55,4 +55,4 @@ export class MarkLine extends Marker {
55
55
  }
56
56
 
57
57
  MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
58
- //# sourceMappingURL=line.js.map
58
+ //# sourceMappingURL=line.js.map
@@ -131,4 +131,4 @@ export class MarkPoint extends Marker {
131
131
  }
132
132
 
133
133
  MarkPoint.defaultAttributes = DEFAULT_MARK_POINT_THEME;
134
- //# sourceMappingURL=point.js.map
134
+ //# sourceMappingURL=point.js.map
package/es/marker/type.js CHANGED
@@ -24,4 +24,4 @@ export var IMarkPointItemPosition;
24
24
  IMarkPointItemPosition.insideTop = "insideTop", IMarkPointItemPosition.insideBottom = "insideBottom",
25
25
  IMarkPointItemPosition.insideMiddle = "insideMiddle";
26
26
  }(IMarkPointItemPosition || (IMarkPointItemPosition = {}));
27
- //# sourceMappingURL=type.js.map
27
+ //# sourceMappingURL=type.js.map
package/es/pager/pager.js CHANGED
@@ -130,4 +130,5 @@ Pager.defaultAttributes = {
130
130
  fill: "rgb(51, 51, 51)",
131
131
  fontSize: 12
132
132
  }
133
- };
133
+ };
134
+ //# sourceMappingURL=pager.js.map
package/es/pager/type.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=type.js.map
2
+ //# sourceMappingURL=type.js.map
@@ -211,4 +211,4 @@ BasePlayer.defaultAttributes = {
211
211
  })
212
212
  }
213
213
  };
214
- //# sourceMappingURL=base-player.js.map
214
+ //# sourceMappingURL=base-player.js.map
@@ -11,4 +11,4 @@ export const defaultControllerAttributes = {
11
11
  };
12
12
 
13
13
  export const RailDefaultSize = [ 200, 10 ];
14
- //# sourceMappingURL=constant.js.map
14
+ //# sourceMappingURL=constant.js.map
@@ -101,4 +101,4 @@ export class ContinuousPlayer extends BasePlayer {
101
101
  super.render();
102
102
  }
103
103
  }
104
- //# sourceMappingURL=continuous-player.js.map
104
+ //# sourceMappingURL=continuous-player.js.map
@@ -83,4 +83,4 @@ export class DiscretePlayer extends BasePlayer {
83
83
  super.dispatchCustomEvent(event, this._dataIndex);
84
84
  }
85
85
  }
86
- //# sourceMappingURL=discrete-player.js.map
86
+ //# sourceMappingURL=discrete-player.js.map
@@ -5,4 +5,4 @@ export * from "./type";
5
5
  export * from "./discrete-player";
6
6
 
7
7
  export * from "./continuous-player";
8
- //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -42,4 +42,4 @@ export const isVertical = orient => "left" === orient || "right" === orient;
42
42
  export const isHorizontal = orient => "top" === orient || "bottom" === orient;
43
43
 
44
44
  export const forwardStep = (direction, currentIndex, min, max) => "default" === direction ? Math.min(currentIndex + 1, max) : Math.max(currentIndex - 1, min);
45
- //# sourceMappingURL=utils.js.map
45
+ //# sourceMappingURL=utils.js.map
@@ -8,20 +8,40 @@ import { injectable } from "inversify";
8
8
 
9
9
  import { PopTip } from "./poptip";
10
10
 
11
+ import { merge } from "@visactor/vutils";
12
+
13
+ import { theme } from "./theme";
14
+
15
+ function wrapPoptip(target, source) {
16
+ return merge(target, theme.poptip, source), target;
17
+ }
18
+
11
19
  let PopTipRenderContribution = class {
12
20
  render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
13
- if (graphic._showPoptip) {
14
- const {visible: visible, visibleCb: visibleCb} = graphic.attribute.poptip;
21
+ var _a;
22
+ if (1 === graphic._showPoptip) {
23
+ const {visible: visible, visibleCb: visibleCb} = graphic.attribute.poptip || {};
15
24
  if (!1 === visible || visibleCb && !1 === visibleCb(graphic)) return;
16
- this.poptipComponent || (this.poptipComponent = new PopTip(graphic.attribute.poptip)),
17
- this.poptipComponent.setAttributes(Object.assign(Object.assign({}, graphic.attribute.poptip), {
18
- x: 0,
19
- y: 0,
20
- postMatrix: graphic.globalTransMatrix
25
+ this.poptipComponent || (this.poptipComponent = new PopTip(graphic.attribute.poptip));
26
+ let poptip = graphic.attribute.poptip || {};
27
+ if ("text" === graphic.type && null == poptip.title && null == poptip.content) {
28
+ const out = {};
29
+ wrapPoptip(out, poptip), poptip = out, poptip.content = null !== (_a = poptip.content) && void 0 !== _a ? _a : graphic.attribute.text;
30
+ }
31
+ const matrix = graphic.globalTransMatrix;
32
+ this.poptipComponent.setAttributes(Object.assign(Object.assign({
33
+ visibleAll: !0,
34
+ pickable: !1,
35
+ childrenPickable: !1
36
+ }, poptip), {
37
+ x: matrix.e,
38
+ y: matrix.f
21
39
  }));
22
40
  const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
23
41
  interactiveLayer && interactiveLayer.add(this.poptipComponent);
24
- }
42
+ } else 2 === graphic._showPoptip && (graphic._showPoptip = 0, this.poptipComponent && this.poptipComponent.setAttributes({
43
+ visibleAll: !1
44
+ }));
25
45
  }
26
46
  };
27
47
 
@@ -1 +1 @@
1
- {"version":3,"sources":["poptip/contribution.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3B,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,EAAE;YACvB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAI,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC;YACjE,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE;gBACpE,OAAO;aACR;YACD,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,IAAI,CAAC,eAAe,GAAG,IAAI,MAAM,CAAE,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC;aACtE;YACD,IAAI,CAAC,eAAe,CAAC,aAAa,iCAC5B,OAAO,CAAC,SAAiB,CAAC,MAAM,KACpC,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,UAAU,EAAE,OAAO,CAAC,iBAAiB,IACrC,CAAC;YAEH,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;IACH,CAAC;CACF,CAAA;AAtCY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CAsCpC;SAtCY,wBAAwB","file":"contribution.js","sourcesContent":["import { injectable } from 'inversify';\nimport type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender';\nimport { PopTip } from './poptip';\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) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip;\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip((graphic.attribute as any).poptip);\n }\n this.poptipComponent.setAttributes({\n ...(graphic.attribute as any).poptip,\n x: 0,\n y: 0,\n postMatrix: graphic.globalTransMatrix\n });\n // 添加到交互层中\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["poptip/contribution.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,SAAS,UAAU,CAAC,MAA2B,EAAE,MAA2B;IAC1E,KAAK,CAAC,MAAM,EAAE,KAAK,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,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,IAAI,CAAC,eAAe,GAAG,IAAI,M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Content":["import { injectable } from 'inversify';\nimport type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender';\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 if (!this.poptipComponent) {\n this.poptipComponent = new PopTip((graphic.attribute as any).poptip);\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 ...poptip,\n x: matrix.e,\n y: matrix.f\n });\n // 添加到交互层中\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 this.poptipComponent &&\n this.poptipComponent.setAttributes({\n visibleAll: false\n });\n }\n }\n}\n"]}
@@ -12,3 +12,16 @@ export declare class PopTipPlugin implements IPlugin {
12
12
  setActiveGraphic(graphic: any | null, rerender?: boolean): void;
13
13
  deactivate(context: IPluginService): void;
14
14
  }
15
+ export declare class PopTipForClipedTextPlugin implements IPlugin {
16
+ name: 'poptipForText';
17
+ activeEvent: 'onRegister';
18
+ pluginService: IPluginService;
19
+ _uid: number;
20
+ key: string;
21
+ activeGraphic: IGraphic;
22
+ activate(context: IPluginService): void;
23
+ poptip: (e: FederatedPointerEvent) => void;
24
+ unpoptip: (e: FederatedPointerEvent) => void;
25
+ setActiveGraphic(graphic: any | null, rerender?: boolean): void;
26
+ deactivate(context: IPluginService): void;
27
+ }
@@ -13,12 +13,14 @@ let PopTipPlugin = class {
13
13
  this.name = "poptip", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
14
14
  this.key = this.name + this._uid, this.poptip = e => {
15
15
  const graphic = e.target;
16
- if (graphic.isContainer || !graphic.attribute || graphic === this.activeGraphic) return void this.unpoptip(e);
16
+ if (graphic.isContainer || !graphic.attribute) return void this.unpoptip(e);
17
+ if (graphic === this.activeGraphic) return;
17
18
  const {poptip: poptip} = graphic.attribute;
18
- poptip && (graphic._showPoptip = !0), this.activeGraphic && (this.activeGraphic._showPoptip = !1),
19
- this.setActiveGraphic(graphic, !0);
19
+ poptip && (graphic.setAttributes({}), graphic._showPoptip = 1), this.activeGraphic && (this.activeGraphic.setAttributes({}),
20
+ this.activeGraphic._showPoptip = 2), this.setActiveGraphic(graphic, !0);
20
21
  }, this.unpoptip = e => {
21
- this.activeGraphic && (this.activeGraphic._showPoptip = !1, this.setActiveGraphic(null, !0));
22
+ this.activeGraphic && (this.activeGraphic.setAttributes({}), this.activeGraphic._showPoptip = 2,
23
+ this.setActiveGraphic(null, !0));
22
24
  };
23
25
  }
24
26
  activate(context) {
@@ -38,4 +40,37 @@ let PopTipPlugin = class {
38
40
  PopTipPlugin = __decorate([ injectable() ], PopTipPlugin);
39
41
 
40
42
  export { PopTipPlugin };
43
+
44
+ let PopTipForClipedTextPlugin = class {
45
+ constructor() {
46
+ this.name = "poptipForText", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
47
+ this.key = this.name + this._uid, this.poptip = e => {
48
+ const graphic = e.target;
49
+ if ("text" !== graphic.type || !graphic.cliped || graphic.isContainer || !graphic.attribute) return void this.unpoptip(e);
50
+ if (graphic === this.activeGraphic) return;
51
+ const {poptip: poptip = {}} = graphic.attribute;
52
+ poptip && (graphic.setAttributes({}), graphic._showPoptip = 1), this.activeGraphic && (this.activeGraphic.setAttributes({}),
53
+ this.activeGraphic._showPoptip = 2), this.setActiveGraphic(graphic, !0);
54
+ }, this.unpoptip = e => {
55
+ this.activeGraphic && (this.activeGraphic.setAttributes({}), this.activeGraphic._showPoptip = 2,
56
+ this.setActiveGraphic(null, !0));
57
+ };
58
+ }
59
+ activate(context) {
60
+ this.pluginService = context;
61
+ const {stage: stage} = this.pluginService;
62
+ stage.addEventListener("pointerover", this.poptip);
63
+ }
64
+ setActiveGraphic(graphic, rerender) {
65
+ this.activeGraphic = graphic, this.pluginService.stage.renderNextFrame();
66
+ }
67
+ deactivate(context) {
68
+ const {stage: stage} = this.pluginService;
69
+ stage.removeEventListener("pointerover", this.poptip);
70
+ }
71
+ };
72
+
73
+ PopTipForClipedTextPlugin = __decorate([ injectable() ], PopTipForClipedTextPlugin);
74
+
75
+ export { PopTipForClipedTextPlugin };
41
76
  //# sourceMappingURL=poptip-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGvC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACL,SAAI,GAAa,QAAQ,CAAC;QAC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;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAE7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF,CAAA;AAlDY,YAAY;IADxB,UAAU,EAAE;GACA,YAAY,CAkDxB;SAlDY,YAAY","file":"poptip-plugin.js","sourcesContent":["import { injectable } from 'inversify';\nimport type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender';\nimport { Generator } from '@visactor/vrender';\n\n@injectable()\nexport class PopTipPlugin implements IPlugin {\n name: 'poptip' = 'poptip';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\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 poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.isContainer || !graphic.attribute || graphic === this.activeGraphic) {\n this.unpoptip(e);\n return;\n }\n const { poptip } = graphic.attribute;\n if (poptip) {\n graphic._showPoptip = true;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic._showPoptip = false;\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._showPoptip = false;\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('p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QAE7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF,CAAA;AAzDY,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAyDrC;SAzDY,yBAAyB","file":"poptip-plugin.js","sourcesContent":["import { injectable } from 'inversify';\nimport type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender';\nimport { Generator } from '@visactor/vrender';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\n@injectable()\nexport class PopTipPlugin implements IPlugin {\n name: 'poptip' = 'poptip';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\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 poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.isContainer || !graphic.attribute) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip } = graphic.attribute;\n if (poptip) {\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 PopTipForClipedTextPlugin implements IPlugin {\n name: 'poptipForText' = 'poptipForText';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\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 poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.type !== 'text' || !graphic.cliped || graphic.isContainer || !graphic.attribute) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip = {} } = graphic.attribute;\n if (poptip) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n // 添加默认poptip\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"]}
@@ -1,3 +1,4 @@
1
1
  import { ContainerModule } from 'inversify';
2
+ import type { PopTipAttributes } from './type';
2
3
  export declare const module: ContainerModule;
3
- export declare function enablePoptip(): void;
4
+ export declare function loadPoptip(defaultPoptipTheme: PopTipAttributes): void;
@@ -2,16 +2,21 @@ import { container, InteractiveSubRenderContribution, AutoEnablePlugins } from "
2
2
 
3
3
  import { ContainerModule } from "inversify";
4
4
 
5
+ import { merge } from "@visactor/vutils";
6
+
5
7
  import { PopTipRenderContribution } from "./contribution";
6
8
 
7
- import { PopTipPlugin } from "./poptip-plugin";
9
+ import { PopTipPlugin, PopTipForClipedTextPlugin } from "./poptip-plugin";
10
+
11
+ import { theme } from "./theme";
8
12
 
9
13
  export const module = new ContainerModule((bind => {
10
14
  bind(PopTipRenderContribution).toSelf().inSingletonScope(), bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution),
11
- bind(PopTipPlugin).toSelf().inSingletonScope(), bind(AutoEnablePlugins).toService(PopTipPlugin);
15
+ bind(PopTipPlugin).toSelf().inSingletonScope(), bind(AutoEnablePlugins).toService(PopTipPlugin),
16
+ bind(PopTipForClipedTextPlugin).toSelf().inSingletonScope(), bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);
12
17
  }));
13
18
 
14
- export function enablePoptip() {
15
- container.load(module);
19
+ export function loadPoptip(defaultPoptipTheme) {
20
+ merge(theme.poptip, defaultPoptipTheme), container.load(module);
16
21
  }
17
22
  //# sourceMappingURL=register.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["poptip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IAC/C,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3D,IAAI,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAE3E,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC/C,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,YAAY;IAC1B,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC","file":"register.js","sourcesContent":["import { container, InteractiveSubRenderContribution, AutoEnablePlugins } from '@visactor/vrender';\nimport { ContainerModule } from 'inversify';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin } from './poptip-plugin';\n\nexport const module = new ContainerModule(bind => {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n\n bind(PopTipPlugin).toSelf().inSingletonScope();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n});\n\nexport function enablePoptip() {\n container.load(module);\n}\n"]}
1
+ {"version":3,"sources":["poptip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IAC/C,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3D,IAAI,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAE3E,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC/C,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEhD,IAAI,CAAC,yBAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,UAAU,CAAC,kBAAoC;IAC7D,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACxC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC","file":"register.js","sourcesContent":["import { container, InteractiveSubRenderContribution, AutoEnablePlugins } from '@visactor/vrender';\nimport { ContainerModule } from 'inversify';\nimport { merge } from '@visactor/vutils';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin, PopTipForClipedTextPlugin } from './poptip-plugin';\nimport type { PopTipAttributes } from './type';\nimport { theme } from './theme';\n\nexport const module = new ContainerModule(bind => {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n\n bind(PopTipPlugin).toSelf().inSingletonScope();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n\n bind(PopTipForClipedTextPlugin).toSelf().inSingletonScope();\n bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);\n});\n\nexport function loadPoptip(defaultPoptipTheme: PopTipAttributes) {\n merge(theme.poptip, defaultPoptipTheme);\n container.load(module);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { PopTipAttributes } from './type';
2
+ export declare const theme: {
3
+ poptip: PopTipAttributes;
4
+ };
@@ -0,0 +1,22 @@
1
+ export const theme = {
2
+ poptip: {
3
+ visible: !0,
4
+ position: "top",
5
+ titleStyle: {
6
+ fontSize: 16,
7
+ fill: "#08979c"
8
+ },
9
+ contentStyle: {
10
+ fontSize: 12,
11
+ fill: "green"
12
+ },
13
+ panel: {
14
+ visible: !0,
15
+ fill: "#e6fffb",
16
+ stroke: "#87e8de",
17
+ lineWidth: 1,
18
+ cornerRadius: 4
19
+ }
20
+ }
21
+ };
22
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["poptip/theme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAiC;IACjD,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;SAChB;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,OAAO;SACd;QACD,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;YAEb,IAAI,EAAE,SAAS;YAEf,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;YACZ,YAAY,EAAE,CAAC;SAChB;KACF;CACF,CAAC","file":"theme.js","sourcesContent":["import type { PopTipAttributes } from './type';\n\nexport const theme: { poptip: PopTipAttributes } = {\n poptip: {\n visible: true,\n position: 'top',\n titleStyle: {\n fontSize: 16,\n fill: '#08979c'\n },\n contentStyle: {\n fontSize: 12,\n fill: 'green'\n },\n panel: {\n visible: true,\n\n fill: '#e6fffb',\n\n stroke: '#87e8de',\n lineWidth: 1,\n cornerRadius: 4\n }\n }\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.13.2-alpha.2",
3
+ "version": "0.13.2",
4
4
  "description": "components library for dp visualization",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -12,7 +12,7 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@visactor/vrender": "0.13.1",
15
+ "@visactor/vrender": "0.13.2",
16
16
  "@visactor/vutils": "~0.13.0",
17
17
  "@visactor/vscale": "~0.13.0",
18
18
  "inversify": "6.0.1"
@@ -29,8 +29,8 @@
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
31
  "@internal/ts-config": "0.0.1",
32
- "@internal/bundler": "0.0.1",
33
- "@internal/eslint-config": "0.0.1"
32
+ "@internal/eslint-config": "0.0.1",
33
+ "@internal/bundler": "0.0.1"
34
34
  },
35
35
  "keywords": [
36
36
  "VisActor",