@visactor/vrender-components 0.21.2-vstory.3 → 0.21.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 (80) hide show
  1. package/cjs/brush/brush.js +2 -1
  2. package/cjs/brush/type.js +1 -2
  3. package/cjs/core/base.d.ts +0 -1
  4. package/cjs/core/base.js +3 -3
  5. package/cjs/core/base.js.map +1 -1
  6. package/cjs/index.d.ts +1 -3
  7. package/cjs/index.js +2 -3
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/interface.d.ts +1 -2
  10. package/cjs/interface.js.map +1 -1
  11. package/cjs/poptip/poptip.d.ts +2 -14
  12. package/cjs/poptip/poptip.js +51 -137
  13. package/cjs/poptip/poptip.js.map +1 -1
  14. package/cjs/poptip/type.d.ts +0 -6
  15. package/cjs/poptip/type.js.map +1 -1
  16. package/dist/index.es.js +4982 -5777
  17. package/es/brush/brush.js +2 -1
  18. package/es/brush/type.js +1 -2
  19. package/es/core/base.d.ts +0 -1
  20. package/es/core/base.js +3 -4
  21. package/es/core/base.js.map +1 -1
  22. package/es/index.d.ts +1 -3
  23. package/es/index.js +1 -5
  24. package/es/index.js.map +1 -1
  25. package/es/interface.d.ts +1 -2
  26. package/es/interface.js.map +1 -1
  27. package/es/poptip/poptip.d.ts +2 -14
  28. package/es/poptip/poptip.js +49 -136
  29. package/es/poptip/poptip.js.map +1 -1
  30. package/es/poptip/type.d.ts +0 -6
  31. package/es/poptip/type.js.map +1 -1
  32. package/package.json +4 -4
  33. package/cjs/label-item/index.d.ts +0 -2
  34. package/cjs/label-item/index.js +0 -21
  35. package/cjs/label-item/index.js.map +0 -1
  36. package/cjs/label-item/label-item.d.ts +0 -29
  37. package/cjs/label-item/label-item.js +0 -265
  38. package/cjs/label-item/label-item.js.map +0 -1
  39. package/cjs/label-item/register.d.ts +0 -1
  40. package/cjs/label-item/register.js +0 -15
  41. package/cjs/label-item/register.js.map +0 -1
  42. package/cjs/label-item/type.d.ts +0 -31
  43. package/cjs/label-item/type.js +0 -6
  44. package/cjs/label-item/type.js.map +0 -1
  45. package/cjs/weather/index.d.ts +0 -1
  46. package/cjs/weather/index.js +0 -21
  47. package/cjs/weather/index.js.map +0 -1
  48. package/cjs/weather/register.d.ts +0 -1
  49. package/cjs/weather/register.js +0 -14
  50. package/cjs/weather/register.js.map +0 -1
  51. package/cjs/weather/type.d.ts +0 -24
  52. package/cjs/weather/type.js +0 -6
  53. package/cjs/weather/type.js.map +0 -1
  54. package/cjs/weather/weather-box.d.ts +0 -13
  55. package/cjs/weather/weather-box.js +0 -129
  56. package/cjs/weather/weather-box.js.map +0 -1
  57. package/es/label-item/index.d.ts +0 -2
  58. package/es/label-item/index.js +0 -4
  59. package/es/label-item/index.js.map +0 -1
  60. package/es/label-item/label-item.d.ts +0 -29
  61. package/es/label-item/label-item.js +0 -263
  62. package/es/label-item/label-item.js.map +0 -1
  63. package/es/label-item/register.d.ts +0 -1
  64. package/es/label-item/register.js +0 -6
  65. package/es/label-item/register.js.map +0 -1
  66. package/es/label-item/type.d.ts +0 -31
  67. package/es/label-item/type.js +0 -2
  68. package/es/label-item/type.js.map +0 -1
  69. package/es/weather/index.d.ts +0 -1
  70. package/es/weather/index.js +0 -2
  71. package/es/weather/index.js.map +0 -1
  72. package/es/weather/register.d.ts +0 -1
  73. package/es/weather/register.js +0 -6
  74. package/es/weather/register.js.map +0 -1
  75. package/es/weather/type.d.ts +0 -24
  76. package/es/weather/type.js +0 -2
  77. package/es/weather/type.js.map +0 -1
  78. package/es/weather/weather-box.d.ts +0 -13
  79. package/es/weather/weather-box.js +0 -127
  80. package/es/weather/weather-box.js.map +0 -1
package/es/brush/brush.js CHANGED
@@ -194,4 +194,5 @@ export class Brush extends AbstractComponent {
194
194
  }
195
195
  }
196
196
 
197
- Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
197
+ Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
198
+ //# sourceMappingURL=brush.js.map
package/es/brush/type.js CHANGED
@@ -4,5 +4,4 @@ export var IOperateType;
4
4
  IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
5
5
  IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
6
6
  IOperateType.brushClear = "brushClear";
7
- }(IOperateType || (IOperateType = {}));
8
- //# sourceMappingURL=type.js.map
7
+ }(IOperateType || (IOperateType = {}));
package/es/core/base.d.ts CHANGED
@@ -6,7 +6,6 @@ export declare abstract class AbstractComponent<T extends IGroupGraphicAttribute
6
6
  attribute: Partial<T>;
7
7
  protected mode?: '2d' | '3d';
8
8
  protected skipDefault?: boolean;
9
- protected _skipRenderAttributes: string[];
10
9
  constructor(attributes: T, options?: ComponentOptions);
11
10
  setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void;
12
11
  setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void;
package/es/core/base.js CHANGED
@@ -6,7 +6,7 @@ const GROUP_ATTRIBUTES = [ "x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "a
6
6
 
7
7
  export class AbstractComponent extends Group {
8
8
  constructor(attributes, options) {
9
- super(attributes), this._skipRenderAttributes = GROUP_ATTRIBUTES, (null == options ? void 0 : options.mode) && (this.mode = options.mode,
9
+ super(attributes), (null == options ? void 0 : options.mode) && (this.mode = options.mode,
10
10
  this.setMode(options.mode)), (null == options ? void 0 : options.skipDefault) && (this.skipDefault = !0),
11
11
  this.setTheme({
12
12
  common: {
@@ -18,13 +18,12 @@ export class AbstractComponent extends Group {
18
18
  }
19
19
  setAttribute(key, value, forceUpdateTag) {
20
20
  isPlainObject(this.attribute[key]) && isPlainObject(value) && !isFunction(this.attribute[key]) && !isFunction(value) ? merge(this.attribute[key], value) : this.attribute[key] = value,
21
- this._skipRenderAttributes.includes(key) || this.render(), this.valid = this.isValid(),
22
- this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
21
+ GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
23
22
  this.addUpdatePositionTag(), this.onAttributeUpdate();
24
23
  }
25
24
  setAttributes(params, forceUpdateTag) {
26
25
  const keys = Object.keys(params);
27
- this._mergeAttributes(params, keys), keys.every((key => this._skipRenderAttributes.includes(key))) || this.render(),
26
+ this._mergeAttributes(params, keys), keys.every((key => GROUP_ATTRIBUTES.includes(key))) || this.render(),
28
27
  this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
29
28
  this.addUpdatePositionTag(), this.onAttributeUpdate();
30
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,gBAAgB,GAAG;IACvB,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,MAAM,OAAgB,iBAA6E,SAAQ,KAAK;IAS9G,YAAY,UAAa,EAAE,OAA0B;QACnD,KAAK,CAAC,UAAU,CAAC,CAAC;QAHV,0BAAqB,GAAa,gBAAgB,CAAC;QAK3D,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACjB,IAAI,CAAC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,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;gBACtG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;aACnC;SACF;IACH,CAAC;IAES,UAAU;IAEpB,CAAC;IAKS,UAAU,CAAC,EAAU;;QAC7B,OAAO,GAAG,MAAA,IAAI,CAAC,EAAE,mCAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;IACtD,CAAC;IAGS,cAAc,CAAC,SAAiB,EAAE,OAAmB;;QAE7D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAGxD,WAAW,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,CAAC,OAAO,CAAC;QAEtD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * @description 组件基类\n */\nimport type { IGroupGraphicAttribute } from '@visactor/vrender-core';\nimport { Group, CustomEvent } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport { merge, isFunction, isPlainObject, isNil } from '@visactor/vutils';\nimport type { ComponentOptions } from '../interface';\n\nconst GROUP_ATTRIBUTES = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'visible',\n 'clip',\n 'pickable',\n 'childrenPickable',\n 'zIndex',\n 'cursor'\n];\n\nexport abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {\n declare attribute: Partial<T>;\n\n protected mode?: '2d' | '3d';\n\n protected skipDefault?: boolean;\n\n protected _skipRenderAttributes: string[] = GROUP_ATTRIBUTES;\n\n constructor(attributes: T, options?: ComponentOptions) {\n super(attributes);\n\n if (options?.mode) {\n this.mode = options.mode;\n\n this.setMode(options.mode);\n }\n\n if (options?.skipDefault) {\n this.skipDefault = true;\n }\n // 组件需要精准 bounds,所以将这个 strokeBoundsBuffer 设置为 0,否则会影响包围盒的获取\n this.setTheme({\n common: {\n strokeBoundsBuffer: 0\n }\n });\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n this.bindEvents();\n });\n }\n\n /**\n * @override\n * 更新单个属性值\n * @param key\n * @param value\n * @param forceUpdateTag\n */\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n // overwrite when previous or next attribute is function\n if (\n isPlainObject(this.attribute[key]) &&\n isPlainObject(value) &&\n !isFunction(this.attribute[key]) &&\n !isFunction(value)\n ) {\n merge(this.attribute[key], value);\n } else {\n this.attribute[key] = value;\n }\n\n // HACK: 待优化\n if (!this._skipRenderAttributes.includes(key as string)) {\n this.render();\n }\n\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key as string))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n // @ts-ignore\n setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void {\n const keys = Object.keys(params) as (keyof T)[];\n this._mergeAttributes(params, keys);\n\n // HACK: 待优化\n if (!keys.every(key => this._skipRenderAttributes.includes(key as string))) {\n this.render();\n }\n\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys as string[]))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]) {\n if (isNil(keys)) {\n keys = Object.keys(params) as (keyof T)[];\n }\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i] as keyof Partial<T>;\n // overwrite when previous or next attribute is function\n if (isPlainObject(this.attribute[key]) && !isFunction(this.attribute[key]) && !isFunction(params[key])) {\n merge(this.attribute[key], params[key]);\n } else {\n this.attribute[key] = params[key];\n }\n }\n }\n\n protected bindEvents() {\n // please override\n }\n\n protected abstract render(): void;\n\n // 图形元素 id\n protected _getNodeId(id: string) {\n return `${this.id ?? this._uid}-${this.name}-${id}`;\n }\n\n // 用于 emit 组件自己的事件\n protected _dispatchEvent(eventName: string, details?: Dict<any>) {\n // 封装事件\n const changeEvent = new CustomEvent(eventName, details);\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,gBAAgB,GAAG;IACvB,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,MAAM,OAAgB,iBAA6E,SAAQ,KAAK;IAO9G,YAAY,UAAa,EAAE,OAA0B;QACnD,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACjB,IAAI,CAAC,IAAI,GAAG,OAAO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,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;gBACtG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;aACnC;SACF;IACH,CAAC;IAES,UAAU;IAEpB,CAAC;IAKS,UAAU,CAAC,EAAU;;QAC7B,OAAO,GAAG,MAAA,IAAI,CAAC,EAAE,mCAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;IACtD,CAAC;IAGS,cAAc,CAAC,SAAiB,EAAE,OAAmB;;QAE7D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAGxD,WAAW,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,CAAC,OAAO,CAAC;QAEtD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;CACF","file":"base.js","sourcesContent":["/**\n * @description 组件基类\n */\nimport type { IGroupGraphicAttribute } from '@visactor/vrender-core';\nimport { Group, CustomEvent } from '@visactor/vrender-core';\nimport type { Dict } from '@visactor/vutils';\nimport { merge, isFunction, isPlainObject, isNil } from '@visactor/vutils';\nimport type { ComponentOptions } from '../interface';\n\nconst GROUP_ATTRIBUTES = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'visible',\n 'clip',\n 'pickable',\n 'childrenPickable',\n 'zIndex',\n 'cursor'\n];\n\nexport abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {\n declare attribute: Partial<T>;\n\n protected mode?: '2d' | '3d';\n\n protected skipDefault?: boolean;\n\n constructor(attributes: T, options?: ComponentOptions) {\n super(attributes);\n\n if (options?.mode) {\n this.mode = options.mode;\n\n this.setMode(options.mode);\n }\n\n if (options?.skipDefault) {\n this.skipDefault = true;\n }\n // 组件需要精准 bounds,所以将这个 strokeBoundsBuffer 设置为 0,否则会影响包围盒的获取\n this.setTheme({\n common: {\n strokeBoundsBuffer: 0\n }\n });\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n this.bindEvents();\n });\n }\n\n /**\n * @override\n * 更新单个属性值\n * @param key\n * @param value\n * @param forceUpdateTag\n */\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n // overwrite when previous or next attribute is function\n if (\n isPlainObject(this.attribute[key]) &&\n isPlainObject(value) &&\n !isFunction(this.attribute[key]) &&\n !isFunction(value)\n ) {\n merge(this.attribute[key], value);\n } else {\n this.attribute[key] = value;\n }\n\n // HACK: 待优化\n if (!GROUP_ATTRIBUTES.includes(key as string)) {\n this.render();\n }\n\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key as string))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n // @ts-ignore\n setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void {\n const keys = Object.keys(params) as (keyof T)[];\n this._mergeAttributes(params, keys);\n\n // HACK: 待优化\n if (!keys.every(key => GROUP_ATTRIBUTES.includes(key as string))) {\n this.render();\n }\n\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys as string[]))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]) {\n if (isNil(keys)) {\n keys = Object.keys(params) as (keyof T)[];\n }\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i] as keyof Partial<T>;\n // overwrite when previous or next attribute is function\n if (isPlainObject(this.attribute[key]) && !isFunction(this.attribute[key]) && !isFunction(params[key])) {\n merge(this.attribute[key], params[key]);\n } else {\n this.attribute[key] = params[key];\n }\n }\n }\n\n protected bindEvents() {\n // please override\n }\n\n protected abstract render(): void;\n\n // 图形元素 id\n protected _getNodeId(id: string) {\n return `${this.id ?? this._uid}-${this.name}-${id}`;\n }\n\n // 用于 emit 组件自己的事件\n protected _dispatchEvent(eventName: string, details?: Dict<any>) {\n // 封装事件\n const changeEvent = new CustomEvent(eventName, details);\n // FIXME: 需要在 vrender 的事件系统支持\n // @ts-ignore\n changeEvent.manager = this.stage?.eventSystem.manager;\n\n this.dispatchEvent(changeEvent);\n }\n}\n"]}
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.21.2-vstory.3";
1
+ export declare const version = "0.21.2";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
@@ -26,6 +26,4 @@ export * from './jsx';
26
26
  export * from './checkbox';
27
27
  export * from './radio';
28
28
  export * from './empty-tip';
29
- export * from './weather';
30
29
  export * from './util';
31
- export * from './label-item';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.21.2-vstory.3";
1
+ export const version = "0.21.2";
2
2
 
3
3
  export * from "./core/base";
4
4
 
@@ -54,9 +54,5 @@ export * from "./radio";
54
54
 
55
55
  export * from "./empty-tip";
56
56
 
57
- export * from "./weather";
58
-
59
57
  export * from "./util";
60
-
61
- export * from "./label-item";
62
58
  //# sourceMappingURL=index.js.map
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAC;AAEzC,cAAc,aAAa,CAAC;AAC5B,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,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.2-vstory.3\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './label-item';\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,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,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.21.2\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
package/es/interface.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute, ITimeline } from '@visactor/vrender-core';
1
+ import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';
2
2
  export type Direction = 'horizontal' | 'vertical';
3
3
  export type OrientType = 'top' | 'right' | 'bottom' | 'left';
4
4
  export type BackgroundAttributes = {
@@ -9,5 +9,4 @@ export type IDelayType = 'debounce' | 'throttle';
9
9
  export interface ComponentOptions {
10
10
  skipDefault?: boolean;
11
11
  mode?: '2d' | '3d';
12
- timeline?: ITimeline;
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type {\n ICustomPath2D,\n IGraphicAttribute,\n IGroup,\n IRectGraphicAttribute,\n IRichText,\n IText,\n ITimeline\n} from '@visactor/vrender-core';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * 自定义路径\n * @since 0.19.19\n */\n customShape?: (container: IGroup, attrs: Partial<IGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IDelayType = 'debounce' | 'throttle';\n\nexport interface ComponentOptions {\n /** skip default attributes of component */\n skipDefault?: boolean;\n /** the mode of component, only axis support 3d mode now */\n mode?: '2d' | '3d';\n /* 传递一个独立的timeline */\n timeline?: ITimeline;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { ICustomPath2D, IGraphicAttribute, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';\n\nexport type Direction = 'horizontal' | 'vertical';\n\nexport type OrientType = 'top' | 'right' | 'bottom' | 'left';\n\nexport type BackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * 自定义路径\n * @since 0.19.19\n */\n customShape?: (container: IGroup, attrs: Partial<IGraphicAttribute>, path: ICustomPath2D) => ICustomPath2D;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IDelayType = 'debounce' | 'throttle';\n\nexport interface ComponentOptions {\n /** skip default attributes of component */\n skipDefault?: boolean;\n /** the mode of component, only axis support 3d mode now */\n mode?: '2d' | '3d';\n}\n"]}
@@ -1,27 +1,15 @@
1
- import { type IGroup, type IText } from '@visactor/vrender-core';
2
1
  import { AbstractComponent } from '../core/base';
3
2
  import type { ComponentOptions } from '../interface';
4
3
  import type { PopTipAttributes } from './type';
5
4
  export declare class PopTip extends AbstractComponent<Required<PopTipAttributes>> {
6
5
  name: string;
7
6
  static defaultAttributes: Partial<PopTipAttributes>;
8
- titleShape?: IText;
9
- contentShape?: IText;
10
- group?: IGroup;
11
7
  constructor(attributes: PopTipAttributes, options?: ComponentOptions);
12
8
  protected render(): void;
13
9
  positionList: string[];
14
- getAngleAndOffset(position: string, width: number, height: number, size: [number, number], symbolType: 'arrow2Left' | string): {
10
+ getAngleAndOffset(position: string, width: number, height: number, size: [number, number]): {
15
11
  angle: number;
16
12
  offset: [number, number];
13
+ rectOffset: [number, number];
17
14
  };
18
- appearAnimate(animateConfig: {
19
- duration?: number;
20
- easing?: string;
21
- wave?: number;
22
- }): void;
23
- disappearAnimate(animateConfig: {
24
- duration?: number;
25
- easing?: string;
26
- }): void;
27
15
  }
@@ -8,8 +8,6 @@ var __rest = this && this.__rest || function(s, e) {
8
8
  return t;
9
9
  };
10
10
 
11
- import { InputText } from "@visactor/vrender-core";
12
-
13
11
  import { AABBBounds, Bounds, getRectIntersect, isArray, isBoolean, isEmpty, isValid, max, merge, normalizePadding, pi, rectInsideAnotherRect } from "@visactor/vutils";
14
12
 
15
13
  import { AbstractComponent } from "../core/base";
@@ -20,25 +18,14 @@ const _tBounds = new AABBBounds;
20
18
 
21
19
  loadPoptipComponent();
22
20
 
23
- const tlStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z", blStr = "M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z", trStr = "M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z", brStr = "M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z", conciseSymbolMap = {
24
- tl: tlStr,
25
- tr: trStr,
26
- bl: blStr,
27
- br: brStr,
28
- lt: tlStr,
29
- lb: blStr,
30
- rt: trStr,
31
- rb: brStr
32
- };
33
-
34
21
  export class PopTip extends AbstractComponent {
35
22
  constructor(attributes, options) {
36
23
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, PopTip.defaultAttributes, attributes)),
37
24
  this.name = "poptip", this.positionList = [ "top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb" ];
38
25
  }
39
26
  render() {
40
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41
- const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel, logoSymbol: logoSymbol, logoText: logoText, logoTextStyle: logoTextStyle = {}, triangleMode: triangleMode = "default", space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h;
28
+ const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel = {}, space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute;
42
29
  let {title: title = "", content: content = ""} = this.attribute;
43
30
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title,
44
31
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
@@ -46,9 +33,7 @@ export class PopTip extends AbstractComponent {
46
33
  x: 0,
47
34
  y: 0,
48
35
  zIndex: 1
49
- }, "group");
50
- this.group = group;
51
- const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3], titleVisible = isValid(title) && !1 !== visible, titleAttrs = Object.assign(Object.assign({
36
+ }, "group"), maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3], titleVisible = isValid(title) && !1 !== visible, titleAttrs = Object.assign(Object.assign({
52
37
  text: isArray(title) ? title : [ title ],
53
38
  visible: titleVisible,
54
39
  wrap: !0
@@ -76,22 +61,11 @@ export class PopTip extends AbstractComponent {
76
61
  }), contentShape = group.createOrUpdateChild("poptip-content", contentAttrs, "text");
77
62
  isEmpty(null == state ? void 0 : state.content) || (contentShape.states = state.content);
78
63
  const contentBounds = contentShape.AABBBounds, contentHeight = contentBounds.height(), contentWidth = contentBounds.width();
79
- contentVisible && (height += contentHeight), this.titleShape = titleShape, this.contentShape = contentShape;
64
+ contentVisible && (height += contentHeight);
80
65
  let popTipWidth = max(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
81
66
  popTipWidth > maxWidth ? popTipWidth = maxWidth : popTipWidth < minWidth && (popTipWidth = minWidth);
82
67
  let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
83
- const {visible: bgVisible, square: square} = panel, backgroundStyle = __rest(panel, [ "visible", "square" ]);
84
- if (square) {
85
- const maxWH = max(popTipWidth, poptipHeight);
86
- popTipWidth = maxWH;
87
- const deltaH = maxWH - poptipHeight;
88
- poptipHeight = maxWH, titleShape.setAttributes({
89
- dy: deltaH / 2
90
- }), contentShape.setAttributes({
91
- dy: deltaH / 2
92
- });
93
- }
94
- const symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12, spaceSize = isArray(symbolSize) ? [ symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0) ] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0), lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1, range = this.stage ? [ null !== (_f = this.stage.viewWidth) && void 0 !== _f ? _f : this.stage.width, null !== (_g = this.stage.viewHeight) && void 0 !== _g ? _g : this.stage.height ] : void 0;
68
+ const {visible: bgVisible} = panel, backgroundStyle = __rest(panel, [ "visible" ]), symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12, spaceSize = isArray(symbolSize) ? [ symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0) ] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0), lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1, range = this.stage ? [ null !== (_f = this.stage.viewWidth) && void 0 !== _f ? _f : this.stage.width, null !== (_g = this.stage.viewHeight) && void 0 !== _g ? _g : this.stage.height ] : void 0;
95
69
  if (range) {
96
70
  const b = this.AABBBounds, leftWidth = null !== (_h = this.attribute.x) && void 0 !== _h ? _h : b.x1, rightWidth = range[0] - b.x1;
97
71
  let maxSpace = Math.max(leftWidth, rightWidth);
@@ -107,73 +81,37 @@ export class PopTip extends AbstractComponent {
107
81
  const layout = "auto" === position;
108
82
  let maxBBoxI, maxBBoxSize = -1 / 0;
109
83
  for (let i = 0; i < this.positionList.length + 1; i++) {
110
- const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
111
- let symbolType = "arrow2Left", offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4, offsetY = 0;
112
- "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p],
113
- offsetX = [ "tl", "bl", "rt", "rb" ].includes(position) ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2,
114
- offsetY = [ "tl", "tr", "lb", "rb" ].includes(position) ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2 : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2);
115
- const {angle: angle, offset: offset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ], symbolType);
84
+ const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position, {angle: angle, offset: offset, rectOffset: rectOffset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ]);
116
85
  if (isBoolean(bgVisible)) {
117
- const bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
86
+ const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4, bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
118
87
  visible: bgVisible && (contentVisible || titleVisible),
119
88
  x: offsetX,
120
- y: offsetY,
89
+ y: 0,
121
90
  strokeBoundsBuffer: -1,
122
91
  boundsPadding: -2,
123
92
  anchor: [ 0, 0 ],
124
- symbolType: symbolType,
93
+ symbolType: "arrow2Left",
125
94
  angle: angle,
126
95
  dx: offset[0],
127
- dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
96
+ dy: offset[1],
128
97
  size: symbolSize,
129
- zIndex: 9
98
+ zIndex: -9
130
99
  }), "symbol");
131
- let bgRect;
132
- isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
133
- bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
134
- visible: bgVisible && (contentVisible || titleVisible),
135
- x: 0,
136
- y: 0,
137
- symbolType: "rect",
138
- size: [ popTipWidth, poptipHeight ],
139
- zIndex: -8
140
- }), "symbol") : group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
100
+ isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel);
101
+ const bgRect = group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
141
102
  visible: bgVisible && (contentVisible || titleVisible),
142
103
  x: 0,
143
104
  y: 0,
144
105
  width: popTipWidth,
145
106
  height: poptipHeight,
146
107
  zIndex: -8
147
- }), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
108
+ }), "rect");
109
+ isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
148
110
  }
149
111
  if (group.setAttributes({
150
112
  x: -offset[0] + dx,
151
- y: -offset[1] + dy,
152
- anchor: [ offsetX, offsetY ]
153
- }), logoSymbol) {
154
- const {size: size = 12} = logoSymbol, sizeArray = isArray(size) ? size : [ size, size ];
155
- "auto" === sizeArray[1] && (sizeArray[1] = poptipHeight), "auto" === sizeArray[0] && (sizeArray[0] = poptipHeight);
156
- const sizeW = sizeArray[0];
157
- group.createOrUpdateChild("poptip-logo", Object.assign(Object.assign({}, logoSymbol), {
158
- x: 0,
159
- y: poptipHeight / 2,
160
- visible: bgVisible && (contentVisible || titleVisible),
161
- zIndex: 10,
162
- size: sizeArray
163
- }), "symbol"), group.setAttributes({
164
- x: -offset[0] + dx + sizeW / 2,
165
- y: -offset[1] + dy
166
- }), logoText && group.createOrUpdateChild("poptip-logo-text", Object.assign(Object.assign({}, logoTextStyle), {
167
- x: 0,
168
- y: poptipHeight / 2,
169
- visible: bgVisible && (contentVisible || titleVisible),
170
- text: logoText,
171
- textAlign: "center",
172
- textBaseline: "middle",
173
- zIndex: 10
174
- }), "text");
175
- }
176
- if (!layout || !range) break;
113
+ y: -offset[1] + dy
114
+ }), !layout || !range) break;
177
115
  {
178
116
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
179
117
  const b = _tBounds, stageBounds = (new Bounds).setValue(0, 0, range[0], range[1]);
@@ -185,118 +123,94 @@ export class PopTip extends AbstractComponent {
185
123
  }
186
124
  }
187
125
  }
188
- getAngleAndOffset(position, width, height, size, symbolType) {
189
- const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
126
+ getAngleAndOffset(position, width, height, size) {
127
+ const sizeH = size[1] / 2;
190
128
  switch (position) {
191
129
  case "tl":
192
130
  return {
193
- angle: "arrow2Left" === symbolType ? pi / 2 * 3 : 0,
194
- offset: "arrow2Left" === symbolType ? [ width / 4, height + sizeH ] : [ 0, height + sizeH ]
131
+ angle: pi / 2 * 3,
132
+ offset: [ width / 4, height + sizeH ],
133
+ rectOffset: [ -width / 4, -height - size[1] ]
195
134
  };
196
135
 
197
136
  case "top":
198
137
  return {
199
138
  angle: pi / 2 * 3,
200
- offset: [ width / 2, height + sizeH ]
139
+ offset: [ width / 2, height + sizeH ],
140
+ rectOffset: [ 0, -height - size[1] ]
201
141
  };
202
142
 
203
143
  case "tr":
204
144
  return {
205
- angle: "arrow2Left" === symbolType ? pi / 2 * 3 : 0,
206
- offset: "arrow2Left" === symbolType ? [ width / 4 * 3, height + sizeH ] : [ width, height + sizeH ]
145
+ angle: pi / 2 * 3,
146
+ offset: [ width / 4 * 3, height + sizeH ],
147
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
207
148
  };
208
149
 
209
150
  case "rt":
210
151
  return {
211
152
  angle: 0,
212
- offset: "arrow2Left" === symbolType ? [ -sizeH, height / 5 ] : [ -sizeH, 0 ]
153
+ offset: [ -sizeH, height / 5 ],
154
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
213
155
  };
214
156
 
215
157
  case "right":
216
158
  return {
217
159
  angle: 0,
218
- offset: [ -sizeH, height / 2 ]
160
+ offset: [ -sizeH, height / 2 ],
161
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
219
162
  };
220
163
 
221
164
  case "rb":
222
165
  return {
223
166
  angle: 0,
224
- offset: "arrow2Left" === symbolType ? [ -sizeH, height / 5 * 4 ] : [ -sizeH, height ]
167
+ offset: [ -sizeH, height / 5 * 4 ],
168
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
225
169
  };
226
170
 
227
171
  case "bl":
228
172
  return {
229
- angle: "arrow2Left" === symbolType ? pi / 2 : 0,
230
- offset: "arrow2Left" === symbolType ? [ width / 4, -sizeH ] : [ 0, -sizeH ]
173
+ angle: pi / 2,
174
+ offset: [ width / 4, -sizeH ],
175
+ rectOffset: [ -width / 4, -height - size[1] ]
231
176
  };
232
177
 
233
178
  case "bottom":
234
179
  return {
235
180
  angle: pi / 2,
236
- offset: [ width / 2, -sizeH ]
181
+ offset: [ width / 2, -sizeH ],
182
+ rectOffset: [ 0, -height - size[1] ]
237
183
  };
238
184
 
239
185
  case "br":
240
186
  return {
241
- angle: "arrow2Left" === symbolType ? pi / 2 : 0,
242
- offset: "arrow2Left" === symbolType ? [ width / 4 * 3, -sizeH ] : [ width, -sizeH ]
187
+ angle: pi / 2,
188
+ offset: [ width / 4 * 3, -sizeH ],
189
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
243
190
  };
244
191
 
245
192
  case "lt":
246
193
  return {
247
- angle: "arrow2Left" === symbolType ? pi : 0,
248
- offset: "arrow2Left" === symbolType ? [ width + sizeH, height / 5 ] : [ width + sizeH, 0 ]
194
+ angle: pi,
195
+ offset: [ width + sizeH, height / 5 ],
196
+ rectOffset: [ -width / 4, -height - size[1] ]
249
197
  };
250
198
 
251
199
  case "left":
252
200
  return {
253
201
  angle: pi,
254
- offset: [ width + sizeH, height / 2 ]
202
+ offset: [ width + sizeH, height / 2 ],
203
+ rectOffset: [ 0, -height - size[1] ]
255
204
  };
256
205
 
257
206
  case "lb":
258
207
  return {
259
- angle: "arrow2Left" === symbolType ? pi : 0,
260
- offset: "arrow2Left" === symbolType ? [ width + sizeH, height / 5 * 4 ] : [ width + sizeH, height ]
208
+ angle: pi,
209
+ offset: [ width + sizeH, height / 5 * 4 ],
210
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
261
211
  };
262
212
  }
263
213
  }
264
- appearAnimate(animateConfig) {
265
- const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
266
- if (this.setAttributes({
267
- scaleX: 0,
268
- scaleY: 0
269
- }), this.animate().to({
270
- scaleX: 1,
271
- scaleY: 1
272
- }, duration / 3 * 2, easing), this.titleShape && this.titleShape.animate().play(new InputText({
273
- text: ""
274
- }, {
275
- text: this.titleShape.attribute.text
276
- }, duration, easing)), this.contentShape && this.contentShape.animate().play(new InputText({
277
- text: ""
278
- }, {
279
- text: this.contentShape.attribute.text
280
- }, duration, easing)), animateConfig.wave) {
281
- const dur = duration / 6;
282
- this.group.animate().to({
283
- angle: animateConfig.wave
284
- }, dur, easing).to({
285
- angle: -animateConfig.wave
286
- }, 2 * dur, easing).to({
287
- angle: animateConfig.wave
288
- }, 2 * dur, easing).to({
289
- angle: 0
290
- }, dur, easing);
291
- }
292
- }
293
- disappearAnimate(animateConfig) {
294
- const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
295
- this.animate().to({
296
- scaleX: 0,
297
- scaleY: 0
298
- }, duration, easing);
299
- }
300
214
  }
301
215
 
302
216
  PopTip.defaultAttributes = {
@@ -316,7 +230,6 @@ PopTip.defaultAttributes = {
316
230
  textAlign: "left",
317
231
  textBaseline: "top"
318
232
  },
319
- panel: {},
320
233
  maxWidthPercent: .8,
321
234
  space: 8,
322
235
  padding: 10