@visactor/vrender-components 0.15.5 → 0.15.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.15.5";
1
+ export declare const version = "0.15.7";
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.15.5";
1
+ export const version = "0.15.7";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/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,aAAa,CAAC;AAC5B,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;AAC5B,cAAc,OAAO,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.15.5\";\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 './axis/grid';\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';\nexport * from './jsx';\n"]}
1
+ {"version":3,"sources":["../src/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,aAAa,CAAC;AAC5B,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;AAC5B,cAAc,OAAO,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.15.7\";\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 './axis/grid';\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';\nexport * from './jsx';\n"]}
@@ -20,6 +20,7 @@ export declare class PopTipForClipedTextPlugin implements IPlugin {
20
20
  key: string;
21
21
  activeGraphic: IGraphic;
22
22
  activate(context: IPluginService): void;
23
+ pointerlave: (e: any) => void;
23
24
  poptip: (e: FederatedPointerEvent) => void;
24
25
  unpoptip: (e: FederatedPointerEvent) => void;
25
26
  setActiveGraphic(graphic: any | null, rerender?: boolean): void;
@@ -44,7 +44,10 @@ export { PopTipPlugin };
44
44
  let PopTipForClipedTextPlugin = class {
45
45
  constructor() {
46
46
  this.name = "poptipForText", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
47
- this.key = this.name + this._uid, this.poptip = e => {
47
+ this.key = this.name + this._uid, this.pointerlave = e => {
48
+ const {stage: stage} = this.pluginService;
49
+ e.target === stage && this.unpoptip(e);
50
+ }, this.poptip = e => {
48
51
  const graphic = e.target;
49
52
  if ("text" !== graphic.type || !graphic.cliped || graphic.isContainer || !graphic.attribute) return void this.unpoptip(e);
50
53
  if (graphic === this.activeGraphic) return;
@@ -59,14 +62,14 @@ let PopTipForClipedTextPlugin = class {
59
62
  activate(context) {
60
63
  this.pluginService = context;
61
64
  const {stage: stage} = this.pluginService;
62
- stage.addEventListener("pointerover", this.poptip);
65
+ stage.addEventListener("pointerover", this.poptip), stage.addEventListener("pointerleave", this.pointerlave);
63
66
  }
64
67
  setActiveGraphic(graphic, rerender) {
65
68
  this.activeGraphic = graphic, this.pluginService.stage.renderNextFrame();
66
69
  }
67
70
  deactivate(context) {
68
71
  const {stage: stage} = this.pluginService;
69
- stage.removeEventListener("pointerover", this.poptip);
72
+ stage.removeEventListener("pointerover", this.poptip), stage.removeEventListener("pointerleave", this.pointerlave);
70
73
  }
71
74
  };
72
75
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKvC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACL,SAAI,GAAa,QAAQ,CAAC;QAC1B,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,S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AzDY,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
+ {"version":3,"sources":["../src/poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKvC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACL,SAAI,GAAa,QAAQ,CAAC;QAC1B,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QASpC,WAAM,GAAG,CAAC,CAAwB,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAa,CAAC;YAChC,IAAI,OAAO,CAAC,WAAW,IAAI,CAA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AK,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AAjEY,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAiErC;SAjEY,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 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 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 stage.removeEventListener('pointerleave', this.pointerlave);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.15.5",
3
+ "version": "0.15.7",
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.15.5",
15
+ "@visactor/vrender": "0.15.7",
16
16
  "@visactor/vutils": "~0.16.0",
17
17
  "@visactor/vscale": "~0.16.0",
18
18
  "inversify": "6.0.1"
@@ -28,8 +28,8 @@
28
28
  "eslint": "~8.18.0",
29
29
  "vite": "3.2.6",
30
30
  "typescript": "4.9.5",
31
- "@internal/ts-config": "0.0.1",
32
31
  "@internal/eslint-config": "0.0.1",
32
+ "@internal/ts-config": "0.0.1",
33
33
  "@internal/bundler": "0.0.1"
34
34
  },
35
35
  "keywords": [