@visactor/vchart 1.12.0-alpha.6 → 1.12.0-alpha.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.
Files changed (43) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +352 -478
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/stack.js +2 -1
  6. package/cjs/chart/word-cloud/word-cloud-transformer.js +1 -2
  7. package/cjs/chart/word-cloud/word-cloud-transformer.js.map +1 -1
  8. package/cjs/compile/grammar-item.js +1 -2
  9. package/cjs/core/index.d.ts +1 -1
  10. package/cjs/core/index.js +1 -1
  11. package/cjs/core/index.js.map +1 -1
  12. package/cjs/event/event-dispatcher.js +2 -1
  13. package/cjs/event/index.js +1 -2
  14. package/cjs/series/interface/type.d.ts +0 -1
  15. package/cjs/series/interface/type.js +6 -7
  16. package/cjs/series/interface/type.js.map +1 -1
  17. package/cjs/series/word-cloud/base.d.ts +12 -11
  18. package/cjs/series/word-cloud/base.js +117 -92
  19. package/cjs/series/word-cloud/base.js.map +1 -1
  20. package/cjs/series/word-cloud/constant.js +0 -4
  21. package/cjs/series/word-cloud/constant.js.map +1 -1
  22. package/cjs/series/word-cloud/interface.d.ts +2 -22
  23. package/cjs/series/word-cloud/interface.js.map +1 -1
  24. package/esm/chart/stack.js +2 -1
  25. package/esm/chart/word-cloud/word-cloud-transformer.js +1 -2
  26. package/esm/chart/word-cloud/word-cloud-transformer.js.map +1 -1
  27. package/esm/compile/grammar-item.js +1 -2
  28. package/esm/core/index.d.ts +1 -1
  29. package/esm/core/index.js +1 -1
  30. package/esm/core/index.js.map +1 -1
  31. package/esm/event/event-dispatcher.js +2 -1
  32. package/esm/event/index.js +1 -2
  33. package/esm/series/interface/type.d.ts +0 -1
  34. package/esm/series/interface/type.js +6 -7
  35. package/esm/series/interface/type.js.map +1 -1
  36. package/esm/series/word-cloud/base.d.ts +12 -11
  37. package/esm/series/word-cloud/base.js +122 -93
  38. package/esm/series/word-cloud/base.js.map +1 -1
  39. package/esm/series/word-cloud/constant.js +0 -4
  40. package/esm/series/word-cloud/constant.js.map +1 -1
  41. package/esm/series/word-cloud/interface.d.ts +2 -22
  42. package/esm/series/word-cloud/interface.js.map +1 -1
  43. package/package.json +4 -4
@@ -54,4 +54,5 @@ class StackChartMixin {
54
54
  }
55
55
  }
56
56
 
57
- exports.StackChartMixin = StackChartMixin;
57
+ exports.StackChartMixin = StackChartMixin;
58
+ //# sourceMappingURL=stack.js.map
@@ -27,8 +27,7 @@ class WordCloudChartSpecTransformer extends base_1.BaseWordCloudChartSpecTransfo
27
27
  wordCloudConfig: spec.wordCloudConfig,
28
28
  wordCloudShapeConfig: spec.wordCloudShapeConfig,
29
29
  word: spec.word,
30
- fillingWord: spec.fillingWord,
31
- wordMask: spec.wordMask
30
+ fillingWord: spec.fillingWord
32
31
  }), seriesType = this.seriesType;
33
32
  return seriesType && (series.type = seriesType, series[seriesType] = spec[seriesType]),
34
33
  series;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart/word-cloud/word-cloud-transformer.ts"],"names":[],"mappings":";;;AAAA,iCAA2D;AAG3D,MAAa,6BAEX,SAAQ,wCAAoC;IAClC,qBAAqB,CAAC,IAAyB;QACvD,MAAM,MAAM,mCACP,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACxB,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,UAAU,EAAE;YACd,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;YACzB,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnCD,sEAmCC","file":"word-cloud-transformer.js","sourcesContent":["import { BaseWordCloudChartSpecTransformer } from './base';\nimport type { IWordCloudChartSpec } from './interface';\n\nexport class WordCloudChartSpecTransformer<\n T extends IWordCloudChartSpec = IWordCloudChartSpec\n> extends BaseWordCloudChartSpecTransformer<T> {\n protected _getDefaultSeriesSpec(spec: IWordCloudChartSpec): any {\n const series: any = {\n ...super._getDefaultSeriesSpec(spec),\n nameField: spec.nameField,\n valueField: spec.valueField,\n seriesField: spec.seriesField,\n fontFamilyField: spec.fontFamilyField,\n fontWeightField: spec.fontWeightField,\n fontStyleField: spec.fontStyleField,\n colorHexField: spec.colorHexField,\n colorMode: spec.colorMode,\n colorList: spec.colorList,\n rotateAngles: spec.rotateAngles,\n fontWeightRange: spec.fontWeightRange,\n fontSizeRange: spec.fontSizeRange,\n maskShape: spec.maskShape,\n keepAspect: spec.keepAspect,\n random: spec.random,\n wordCloudConfig: spec.wordCloudConfig,\n wordCloudShapeConfig: spec.wordCloudShapeConfig,\n word: spec.word,\n fillingWord: spec.fillingWord,\n wordMask: spec.wordMask\n };\n const seriesType = this.seriesType;\n if (seriesType) {\n series.type = seriesType;\n series[seriesType] = spec[seriesType];\n }\n\n return series;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/chart/word-cloud/word-cloud-transformer.ts"],"names":[],"mappings":";;;AAAA,iCAA2D;AAG3D,MAAa,6BAEX,SAAQ,wCAAoC;IAClC,qBAAqB,CAAC,IAAyB;QACvD,MAAM,MAAM,mCACP,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,GAC9B,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,UAAU,EAAE;YACd,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;YACzB,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlCD,sEAkCC","file":"word-cloud-transformer.js","sourcesContent":["import { BaseWordCloudChartSpecTransformer } from './base';\nimport type { IWordCloudChartSpec } from './interface';\n\nexport class WordCloudChartSpecTransformer<\n T extends IWordCloudChartSpec = IWordCloudChartSpec\n> extends BaseWordCloudChartSpecTransformer<T> {\n protected _getDefaultSeriesSpec(spec: IWordCloudChartSpec): any {\n const series: any = {\n ...super._getDefaultSeriesSpec(spec),\n nameField: spec.nameField,\n valueField: spec.valueField,\n seriesField: spec.seriesField,\n fontFamilyField: spec.fontFamilyField,\n fontWeightField: spec.fontWeightField,\n fontStyleField: spec.fontStyleField,\n colorHexField: spec.colorHexField,\n colorMode: spec.colorMode,\n colorList: spec.colorList,\n rotateAngles: spec.rotateAngles,\n fontWeightRange: spec.fontWeightRange,\n fontSizeRange: spec.fontSizeRange,\n maskShape: spec.maskShape,\n keepAspect: spec.keepAspect,\n random: spec.random,\n wordCloudConfig: spec.wordCloudConfig,\n wordCloudShapeConfig: spec.wordCloudShapeConfig,\n word: spec.word,\n fillingWord: spec.fillingWord\n };\n const seriesType = this.seriesType;\n if (seriesType) {\n series.type = seriesType;\n series[seriesType] = spec[seriesType];\n }\n\n return series;\n }\n}\n"]}
@@ -50,5 +50,4 @@ class GrammarItem extends compilable_base_1.CompilableBase {
50
50
  }
51
51
  }
52
52
 
53
- exports.GrammarItem = GrammarItem;
54
- //# sourceMappingURL=grammar-item.js.map
53
+ exports.GrammarItem = GrammarItem;
@@ -1,7 +1,7 @@
1
1
  import { VChart } from './vchart';
2
2
  import { Factory } from './factory';
3
3
  export { VChart, Factory };
4
- export declare const version = "1.12.0-alpha.6";
4
+ export declare const version = "1.12.0-alpha.7";
5
5
  export type { IVChart } from './interface';
6
6
  export type { IStateSpec, StateValueType } from '../compile/mark';
7
7
  export * from '../typings/spec/common';
package/cjs/core/index.js CHANGED
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "Factory", {
35
35
  get: function() {
36
36
  return factory_1.Factory;
37
37
  }
38
- }), exports.version = "1.12.0-alpha.6", __exportStar(require("../typings/spec/common"), exports),
38
+ }), exports.version = "1.12.0-alpha.7", __exportStar(require("../typings/spec/common"), exports),
39
39
  __exportStar(require("../event/interface"), exports), __exportStar(require("../theme/interface"), exports),
40
40
  __exportStar(require("../constant"), exports), __exportStar(require("./interface"), exports),
41
41
  __exportStar(require("../typings/spec/index"), exports), __exportStar(require("../typings/tooltip"), exports),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAMxC,yDAAuC;AACvC,qDAAmC;AACnC,qDAAmC;AACnC,8CAA4B;AAC5B,8CAA4B;AAK5B,wDAAsC;AAGtC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAAiD;AAAxC,uGAAA,OAAO,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.12.0-alpha.6\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../constant';\nexport * from './interface';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport { vglobal } from '@visactor/vrender-core';\n"]}
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA,qCAAkC;AAGzB,uFAHA,eAAM,OAGA;AAFf,uCAAoC;AAEnB,wFAFR,iBAAO,OAEQ;AAGX,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAMxC,yDAAuC;AACvC,qDAAmC;AACnC,qDAAmC;AACnC,8CAA4B;AAC5B,8CAA4B;AAK5B,wDAAsC;AAGtC,qDAAmC;AAGnC,iDAA+B;AAG/B,uDAAiD;AAAxC,uGAAA,OAAO,OAAA","file":"index.js","sourcesContent":["/**\n * @description The core module of VChart, containing the necessary interfaces for using VChart.\n */\n\nimport { VChart } from './vchart';\nimport { Factory } from './factory';\n\nexport { VChart, Factory };\n\n// export the version\nexport const version = \"1.12.0-alpha.7\";\n\n// export necessary types\nexport type { IVChart } from './interface';\nexport type { IStateSpec, StateValueType } from '../compile/mark';\n\nexport * from '../typings/spec/common';\nexport * from '../event/interface';\nexport * from '../theme/interface';\nexport * from '../constant';\nexport * from './interface';\n\n/**\n * spec\n */\nexport * from '../typings/spec/index';\n\n// tooltip\nexport * from '../typings/tooltip';\n\n// theme\nexport * from '../theme/index';\n\n// vrender\nexport { vglobal } from '@visactor/vrender-core';\n"]}
@@ -234,4 +234,5 @@ class EventDispatcher {
234
234
  }
235
235
  }
236
236
 
237
- exports.EventDispatcher = EventDispatcher;
237
+ exports.EventDispatcher = EventDispatcher;
238
+ //# sourceMappingURL=event-dispatcher.js.map
@@ -17,5 +17,4 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), __exportStar(require("./event"), exports), __exportStar(require("./events"), exports);
21
- //# sourceMappingURL=index.js.map
20
+ }), __exportStar(require("./event"), exports), __exportStar(require("./events"), exports);
@@ -85,7 +85,6 @@ export declare const enum SeriesMarkNameEnum {
85
85
  stackLabel = "stackLabel",
86
86
  word = "word",
87
87
  fillingWord = "fillingWord",
88
- wordMask = "wordMask",
89
88
  nodePoint = "nodePoint",
90
89
  ripplePoint = "ripplePoint",
91
90
  centerPoint = "centerPoint",
@@ -39,12 +39,11 @@ Object.defineProperty(exports, "__esModule", {
39
39
  SeriesMarkNameEnum.nonLeaf = "nonLeaf", SeriesMarkNameEnum.leaf = "leaf", SeriesMarkNameEnum.nonLeafLabel = "nonLeafLabel",
40
40
  SeriesMarkNameEnum.leaderLine = "leaderLine", SeriesMarkNameEnum.stackLabel = "stackLabel",
41
41
  SeriesMarkNameEnum.word = "word", SeriesMarkNameEnum.fillingWord = "fillingWord",
42
- SeriesMarkNameEnum.wordMask = "wordMask", SeriesMarkNameEnum.nodePoint = "nodePoint",
43
- SeriesMarkNameEnum.ripplePoint = "ripplePoint", SeriesMarkNameEnum.centerPoint = "centerPoint",
44
- SeriesMarkNameEnum.centerLabel = "centerLabel", SeriesMarkNameEnum.barBackground = "barBackground",
45
- SeriesMarkNameEnum.lineLabel = "lineLabel", SeriesMarkNameEnum.areaLabel = "areaLabel",
46
- SeriesMarkNameEnum.liquid = "liquid", SeriesMarkNameEnum.liquidBackground = "liquidBackground",
47
- SeriesMarkNameEnum.liquidOutline = "liquidOutline", SeriesMarkNameEnum.circle = "circle",
48
- SeriesMarkNameEnum.overlap = "overlap", SeriesMarkNameEnum.overlapLabel = "overlapLabel";
42
+ SeriesMarkNameEnum.nodePoint = "nodePoint", SeriesMarkNameEnum.ripplePoint = "ripplePoint",
43
+ SeriesMarkNameEnum.centerPoint = "centerPoint", SeriesMarkNameEnum.centerLabel = "centerLabel",
44
+ SeriesMarkNameEnum.barBackground = "barBackground", SeriesMarkNameEnum.lineLabel = "lineLabel",
45
+ SeriesMarkNameEnum.areaLabel = "areaLabel", SeriesMarkNameEnum.liquid = "liquid",
46
+ SeriesMarkNameEnum.liquidBackground = "liquidBackground", SeriesMarkNameEnum.liquidOutline = "liquidOutline",
47
+ SeriesMarkNameEnum.circle = "circle", SeriesMarkNameEnum.overlap = "overlap", SeriesMarkNameEnum.overlapLabel = "overlapLabel";
49
48
  }(SeriesMarkNameEnum = exports.SeriesMarkNameEnum || (exports.SeriesMarkNameEnum = {}));
50
49
  //# sourceMappingURL=type.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/interface/type.ts"],"names":[],"mappings":";;;AAEA,IAAY,cAoCX;AApCD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,uDAAqC,CAAA;IACrC,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,mDAAiC,CAAA;IACjC,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;IAC7B,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EApCW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAoCzB;AAED,IAAkB,kBA+DjB;AA/DD,WAAkB,kBAAkB;IAClC,qCAAe,CAAA;IACf,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,qDAA+B,CAAA;IAC/B,qCAAe,CAAA;IACf,uDAAiC,CAAA;IACjC,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;IACvB,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,+CAAyB,CAAA;IACzB,uDAAiC,CAAA;IACjC,iCAAW,CAAA;IACX,qDAA+B,CAAA;IAC/B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uDAAiC,CAAA;IACjC,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,6CAAuB,CAAA;IACvB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,mCAAa,CAAA;IACb,iDAA2B,CAAA;IAC3B,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;IACvB,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,qDAA+B,CAAA;IAC/B,6CAAuB,CAAA;IACvB,6CAAuB,CAAA;IACvB,uCAAiB,CAAA;IACjB,2DAAqC,CAAA;IACrC,qDAA+B,CAAA;IAC/B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,mDAA6B,CAAA;AAC/B,CAAC,EA/DiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA+DnC","file":"type.js","sourcesContent":["export type SeriesType = keyof typeof SeriesTypeEnum | string;\n\nexport enum SeriesTypeEnum {\n area = 'area',\n line = 'line',\n bar = 'bar',\n bar3d = 'bar3d',\n rangeColumn = 'rangeColumn',\n rangeColumn3d = 'rangeColumn3d',\n rangeArea = 'rangeArea',\n dot = 'dot',\n geo = 'geo',\n link = 'link',\n map = 'map',\n pie = 'pie',\n pie3d = 'pie3d',\n radar = 'radar',\n rose = 'rose',\n scatter = 'scatter',\n circularProgress = 'circularProgress',\n wordCloud = 'wordCloud',\n wordCloud3d = 'wordCloud3d',\n funnel = 'funnel',\n funnel3d = 'funnel3d',\n linearProgress = 'linearProgress',\n boxPlot = 'boxPlot',\n sankey = 'sankey',\n gaugePointer = 'gaugePointer',\n gauge = 'gauge',\n treemap = 'treemap',\n sunburst = 'sunburst',\n circlePacking = 'circlePacking',\n waterfall = 'waterfall',\n heatmap = 'heatmap',\n correlation = 'correlation',\n liquid = 'liquid',\n venn = 'venn',\n mosaic = 'mosaic'\n}\n\nexport const enum SeriesMarkNameEnum {\n label = 'label',\n point = 'point',\n line = 'line',\n area = 'area',\n bar = 'bar',\n bar3d = 'bar3d',\n boxPlot = 'boxPlot',\n outlier = 'outlier',\n circlePacking = 'circlePacking',\n group = 'group',\n gridBackground = 'gridBackground',\n grid = 'grid',\n dot = 'dot',\n title = 'title',\n subTitle = 'subTitle',\n symbol = 'symbol',\n funnel = 'funnel',\n funnel3d = 'funnel3d',\n transform = 'transform',\n transform3d = 'transform3d',\n transformLabel = 'transformLabel',\n outerLabel = 'outerLabel',\n outerLabelLine = 'outerLabelLine',\n pin = 'pin',\n pinBackground = 'pinBackground',\n pointer = 'pointer',\n segment = 'segment',\n track = 'track',\n cell = 'cell',\n cellBackground = 'cellBackground',\n link = 'link',\n arrow = 'arrow',\n pie = 'pie',\n pie3d = 'pie3d',\n labelLine = 'labelLine',\n progress = 'progress',\n minLabel = 'minLabel',\n maxLabel = 'maxLabel',\n rose = 'rose',\n node = 'node',\n sunburst = 'sunburst',\n nonLeaf = 'nonLeaf',\n leaf = 'leaf',\n nonLeafLabel = 'nonLeafLabel',\n leaderLine = 'leaderLine',\n stackLabel = 'stackLabel',\n word = 'word',\n fillingWord = 'fillingWord',\n wordMask = 'wordMask',\n nodePoint = 'nodePoint',\n ripplePoint = 'ripplePoint',\n centerPoint = 'centerPoint',\n centerLabel = 'centerLabel',\n barBackground = 'barBackground',\n lineLabel = 'lineLabel',\n areaLabel = 'areaLabel',\n liquid = 'liquid',\n liquidBackground = 'liquidBackground',\n liquidOutline = 'liquidOutline',\n circle = 'circle',\n overlap = 'overlap',\n overlapLabel = 'overlapLabel'\n}\n"]}
1
+ {"version":3,"sources":["../src/series/interface/type.ts"],"names":[],"mappings":";;;AAEA,IAAY,cAoCX;AApCD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,+BAAa,CAAA;IACb,6BAAW,CAAA;IACX,6BAAW,CAAA;IACX,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,uDAAqC,CAAA;IACrC,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,mDAAiC,CAAA;IACjC,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;IAC7B,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EApCW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAoCzB;AAED,IAAkB,kBA8DjB;AA9DD,WAAkB,kBAAkB;IAClC,qCAAe,CAAA;IACf,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,qDAA+B,CAAA;IAC/B,qCAAe,CAAA;IACf,uDAAiC,CAAA;IACjC,mCAAa,CAAA;IACb,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;IACvB,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,+CAAyB,CAAA;IACzB,uDAAiC,CAAA;IACjC,iCAAW,CAAA;IACX,qDAA+B,CAAA;IAC/B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uDAAiC,CAAA;IACjC,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,6CAAuB,CAAA;IACvB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,mCAAa,CAAA;IACb,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,+CAAyB,CAAA;IACzB,mCAAa,CAAA;IACb,iDAA2B,CAAA;IAC3B,6CAAuB,CAAA;IACvB,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,qDAA+B,CAAA;IAC/B,6CAAuB,CAAA;IACvB,6CAAuB,CAAA;IACvB,uCAAiB,CAAA;IACjB,2DAAqC,CAAA;IACrC,qDAA+B,CAAA;IAC/B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,mDAA6B,CAAA;AAC/B,CAAC,EA9DiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA8DnC","file":"type.js","sourcesContent":["export type SeriesType = keyof typeof SeriesTypeEnum | string;\n\nexport enum SeriesTypeEnum {\n area = 'area',\n line = 'line',\n bar = 'bar',\n bar3d = 'bar3d',\n rangeColumn = 'rangeColumn',\n rangeColumn3d = 'rangeColumn3d',\n rangeArea = 'rangeArea',\n dot = 'dot',\n geo = 'geo',\n link = 'link',\n map = 'map',\n pie = 'pie',\n pie3d = 'pie3d',\n radar = 'radar',\n rose = 'rose',\n scatter = 'scatter',\n circularProgress = 'circularProgress',\n wordCloud = 'wordCloud',\n wordCloud3d = 'wordCloud3d',\n funnel = 'funnel',\n funnel3d = 'funnel3d',\n linearProgress = 'linearProgress',\n boxPlot = 'boxPlot',\n sankey = 'sankey',\n gaugePointer = 'gaugePointer',\n gauge = 'gauge',\n treemap = 'treemap',\n sunburst = 'sunburst',\n circlePacking = 'circlePacking',\n waterfall = 'waterfall',\n heatmap = 'heatmap',\n correlation = 'correlation',\n liquid = 'liquid',\n venn = 'venn',\n mosaic = 'mosaic'\n}\n\nexport const enum SeriesMarkNameEnum {\n label = 'label',\n point = 'point',\n line = 'line',\n area = 'area',\n bar = 'bar',\n bar3d = 'bar3d',\n boxPlot = 'boxPlot',\n outlier = 'outlier',\n circlePacking = 'circlePacking',\n group = 'group',\n gridBackground = 'gridBackground',\n grid = 'grid',\n dot = 'dot',\n title = 'title',\n subTitle = 'subTitle',\n symbol = 'symbol',\n funnel = 'funnel',\n funnel3d = 'funnel3d',\n transform = 'transform',\n transform3d = 'transform3d',\n transformLabel = 'transformLabel',\n outerLabel = 'outerLabel',\n outerLabelLine = 'outerLabelLine',\n pin = 'pin',\n pinBackground = 'pinBackground',\n pointer = 'pointer',\n segment = 'segment',\n track = 'track',\n cell = 'cell',\n cellBackground = 'cellBackground',\n link = 'link',\n arrow = 'arrow',\n pie = 'pie',\n pie3d = 'pie3d',\n labelLine = 'labelLine',\n progress = 'progress',\n minLabel = 'minLabel',\n maxLabel = 'maxLabel',\n rose = 'rose',\n node = 'node',\n sunburst = 'sunburst',\n nonLeaf = 'nonLeaf',\n leaf = 'leaf',\n nonLeafLabel = 'nonLeafLabel',\n leaderLine = 'leaderLine',\n stackLabel = 'stackLabel',\n word = 'word',\n fillingWord = 'fillingWord',\n nodePoint = 'nodePoint',\n ripplePoint = 'ripplePoint',\n centerPoint = 'centerPoint',\n centerLabel = 'centerLabel',\n barBackground = 'barBackground',\n lineLabel = 'lineLabel',\n areaLabel = 'areaLabel',\n liquid = 'liquid',\n liquidBackground = 'liquidBackground',\n liquidOutline = 'liquidOutline',\n circle = 'circle',\n overlap = 'overlap',\n overlapLabel = 'overlapLabel'\n}\n"]}
@@ -1,11 +1,10 @@
1
1
  import type { IPadding } from '@visactor/vutils';
2
2
  import type { ITextMark } from '../../mark/text';
3
3
  import type { SeriesMarkMap } from '../interface';
4
- import type { IWordCloudSeriesSpec, TextShapeMask, GeometricMaskShape, WordCloudConfigType, WordCloudShapeConfigType, WordCloudShapeType } from './interface';
5
- import type { Datum, IMarkSpec, IPoint, ITextMarkSpec } from '../../typings';
4
+ import type { IWordCloudSeriesSpec, WordCloudConfigType, WordCloudShapeConfigType, WordCloudShapeType } from './interface';
5
+ import type { Datum, IPoint } from '../../typings';
6
6
  import { BaseSeries } from '../base/base-series';
7
7
  import type { IMark } from '../../mark/interface';
8
- import type { IRectMark } from '../../mark/rect';
9
8
  export type IBaseWordCloudSeriesSpec = Omit<IWordCloudSeriesSpec, 'type'> & {
10
9
  type: string;
11
10
  };
@@ -14,17 +13,23 @@ export declare class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IB
14
13
  protected _nameField: string;
15
14
  protected _valueField?: string;
16
15
  setValueField(field: string): void;
16
+ protected _fontFamilyField: string;
17
+ protected _fontWeightField: string;
18
+ protected _fontStyleField: string;
19
+ protected _colorHexField: string;
17
20
  protected _colorMode: 'linear' | 'ordinal';
18
21
  protected _colorList: string[];
19
22
  protected _rotateAngles?: number[];
20
23
  protected _fontWeightRange?: [number, number];
21
24
  protected _textField?: string;
22
- protected _maskCanvas?: HTMLCanvasElement;
23
- protected _maskMark?: IRectMark;
24
25
  protected _fontSizeRange?: [number, number] | 'auto';
25
26
  setFontSizeRange(fontSizeRange: [number, number] | 'auto'): void;
26
- protected _maskShape?: string | WordCloudShapeType | TextShapeMask | GeometricMaskShape;
27
+ protected _maskShape?: string | WordCloudShapeType;
27
28
  protected _isWordCloudShape: boolean;
29
+ protected _keepAspect?: boolean;
30
+ protected _random?: boolean;
31
+ protected _fontPadding?: number;
32
+ protected _fillingFontPadding?: number;
28
33
  protected _wordCloudConfig?: WordCloudConfigType;
29
34
  protected _wordCloudShapeConfig?: WordCloudShapeConfigType;
30
35
  protected _padding?: IPadding;
@@ -32,21 +37,17 @@ export declare class BaseWordCloudSeries<T extends IBaseWordCloudSeriesSpec = IB
32
37
  protected _keyWordColorCallback: (datum: Datum) => string;
33
38
  protected _fillingColorCallback: (datum: Datum) => string;
34
39
  protected _dataChange: boolean;
35
- protected handleMaskCanvasUpdate: (canvas: HTMLCanvasElement, imageUrl?: string) => void;
36
40
  setAttrFromSpec(): void;
37
41
  protected initData(): void;
38
42
  protected _wordMark: ITextMark;
39
43
  initMark(): void;
40
44
  initMarkStyle(): void;
41
- initMarkStyleOfWord(wordMark: ITextMark, wordSpec?: IMarkSpec<ITextMarkSpec>, colorHexField?: string, seriesField?: string, isFillingWord?: boolean): void;
42
45
  protected initTooltip(): void;
43
46
  initAnimation(): void;
44
47
  protected getWordOrdinalColorScale(field: string, isFillingWord: boolean): any;
45
- protected initColorCallback(field: string, isFillingWord: boolean): any;
48
+ protected initColorCallback(field: string, isFillingWord: boolean): (datum: Datum) => any;
46
49
  getWordColor: (datum: Datum) => string;
47
- private _calculateFontWeight;
48
50
  compile(): void;
49
- protected _getCommonTransformOptions(): any;
50
51
  protected _wordCloudTransformOption(): Object;
51
52
  protected _wordCloudShapeTransformOption(): Object;
52
53
  getStatisticFields(): {
@@ -4,19 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.BaseWordCloudSeries = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), constant_1 = require("../../constant"), env_1 = require("../../util/env"), config_1 = require("./config"), utils_1 = require("../../animation/utils"), word_cloud_1 = require("../../constant/word-cloud"), base_series_1 = require("../base/base-series"), color_ordinal_scale_1 = require("../../scale/color-ordinal-scale"), constant_2 = require("./constant"), factory_1 = require("../../core/factory"), vscale_1 = require("@visactor/vscale");
7
+ const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), constant_1 = require("../../constant"), env_1 = require("../../util/env"), config_1 = require("./config"), utils_1 = require("../../animation/utils"), vscale_1 = require("@visactor/vscale"), vgrammar_util_1 = require("@visactor/vgrammar-util"), word_cloud_1 = require("../../constant/word-cloud"), base_series_1 = require("../base/base-series"), color_ordinal_scale_1 = require("../../scale/color-ordinal-scale"), constant_2 = require("./constant"), factory_1 = require("../../core/factory");
8
8
 
9
9
  class BaseWordCloudSeries extends base_series_1.BaseSeries {
10
10
  constructor() {
11
11
  super(...arguments), this._fontSizeRange = [ config_1.DEFAULT_MIN_FONT_SIZE, config_1.DEFAULT_MIN_FONT_SIZE ],
12
- this._isWordCloudShape = !1, this._dataChange = !0, this.handleMaskCanvasUpdate = (canvas, imageUrl) => {
13
- this._maskCanvas = canvas, document.body.appendChild(canvas);
14
- }, this.getWordColor = datum => datum.isFillingWord ? (this._fillingColorCallback && !this._dataChange || (this._fillingColorCallback = this._wordCloudShapeConfig.fillingColorHexField ? datum => datum[this._wordCloudShapeConfig.fillingColorHexField] : this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField, !0)),
15
- this._fillingColorCallback(datum)) : (this._keyWordColorCallback && !this._dataChange || (this._keyWordColorCallback = this._spec.colorHexField ? datum => datum[this._spec.colorHexField] : this.initColorCallback(this._seriesField, !1)),
16
- this._keyWordColorCallback(datum)), this._calculateFontWeight = datum => {
17
- const stats = this.getRawDataStatisticsByField(this._valueField, !0);
18
- return stats.min === stats.max ? this._fontWeightRange[0] : this._fontWeightRange[0] + (this._fontWeightRange[this._fontWeightRange.length - 1] - this._fontWeightRange[0]) * (datum[this._valueField] - stats.min) / (stats.max - stats.min);
19
- };
12
+ this._isWordCloudShape = !1, this._dataChange = !0, this.getWordColor = datum => datum.isFillingWord ? (this._fillingColorCallback && !this._dataChange || (this._fillingColorCallback = this._wordCloudShapeConfig.fillingColorHexField ? datum => datum[this._wordCloudShapeConfig.fillingColorHexField] : this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField, !0)),
13
+ this._fillingColorCallback(datum)) : (this._keyWordColorCallback && !this._dataChange || (this._keyWordColorCallback = this._colorHexField ? datum => datum[this._colorHexField] : this.initColorCallback(this._seriesField, !1)),
14
+ this._keyWordColorCallback(datum));
20
15
  }
21
16
  setValueField(field) {
22
17
  (0, vutils_2.isValid)(field) && (this._valueField = field);
@@ -25,27 +20,28 @@ class BaseWordCloudSeries extends base_series_1.BaseSeries {
25
20
  (0, vutils_2.isValid)(fontSizeRange) ? this._fontSizeRange = fontSizeRange : this._fontSizeRange = config_1.DEFAULT_FONTSIZE_RANGE;
26
21
  }
27
22
  setAttrFromSpec() {
28
- var _a, _b, _c, _d, _e;
23
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
29
24
  super.setAttrFromSpec(), this._padding = this._option.getChart().padding, this._nameField = this._spec.nameField,
25
+ this._fontFamilyField = this._spec.fontFamilyField, this._fontWeightField = this._spec.fontWeightField,
26
+ this._fontStyleField = this._spec.fontStyleField, this._colorHexField = this._spec.colorHexField,
30
27
  this._colorMode = null !== (_a = this._spec.colorMode) && void 0 !== _a ? _a : "ordinal",
31
28
  this._colorList = this._spec.colorList, this.setValueField(this._spec.valueField),
32
29
  this._fontWeightRange = null !== (_b = this._spec.fontWeightRange) && void 0 !== _b ? _b : config_1.DEFAULT_FONT_WEIGHT_RANGE,
33
30
  this._rotateAngles = null !== (_c = this._spec.rotateAngles) && void 0 !== _c ? _c : config_1.DEFAULT_ROTATE_ANGLES,
34
31
  this.setFontSizeRange(this._spec.fontSizeRange), this._maskShape = null !== (_d = this._spec.maskShape) && void 0 !== _d ? _d : config_1.DEFAULT_MASK_SHAPE,
35
- this._textField = (null === (_e = this._spec.word) || void 0 === _e ? void 0 : _e.formatMethod) ? word_cloud_1.WORD_CLOUD_TEXT : this._nameField;
36
- const wordCloudConfig = this._spec.wordCloudConfig;
32
+ this._keepAspect = this._spec.keepAspect, this._random = null !== (_e = this._spec.random) && void 0 !== _e ? _e : config_1.DEFAULT_RANDOM,
33
+ this._fontPadding = null !== (_g = null === (_f = this._spec.word) || void 0 === _f ? void 0 : _f.padding) && void 0 !== _g ? _g : config_1.DEFAULT_FONT_PADDING,
34
+ this._textField = (null === (_h = this._spec.word) || void 0 === _h ? void 0 : _h.formatMethod) ? word_cloud_1.WORD_CLOUD_TEXT : this._nameField,
37
35
  this._wordCloudConfig = Object.assign({
38
36
  drawOutOfBound: config_1.DEFAULT_DRAW_OUT_OF_BOUND,
39
37
  layoutMode: "default",
40
38
  zoomToFit: config_1.DEFAULT_ZOOM_TO_FIT
41
- }, this._spec.wordCloudConfig), wordCloudConfig && !(0, vutils_1.isNil)(wordCloudConfig.layoutMode) || (0,
42
- env_1.isTrueBrowser)(this._option.mode) || (this._wordCloudConfig.layoutMode = "fast"),
43
- this._wordCloudShapeConfig = Object.assign({
39
+ }, this._spec.wordCloudConfig), this._wordCloudShapeConfig = Object.assign({
44
40
  fillingSeriesField: this.getSeriesField(),
45
41
  fillingRotateAngles: config_1.DEFAULT_ROTATE_ANGLES,
46
42
  layoutMode: "default"
47
- }, this._spec.wordCloudShapeConfig), this._isWordCloudShape = !config_1.SHAPE_TYPE.includes(this._maskShape) && ![ "fast", "grid", "cloud" ].includes(this._wordCloudConfig.layoutMode),
48
- this._defaultFontFamily = this._option.getTheme().fontFamily;
43
+ }, this._spec.wordCloudShapeConfig), this._fillingFontPadding = null !== (_k = null === (_j = this._spec.fillingWord) || void 0 === _j ? void 0 : _j.padding) && void 0 !== _k ? _k : config_1.DEFAULT_FONT_PADDING,
44
+ this._isWordCloudShape = !config_1.SHAPE_TYPE.includes(this._maskShape), this._defaultFontFamily = this._option.getTheme().fontFamily;
49
45
  }
50
46
  initData() {
51
47
  var _a, _b;
@@ -54,10 +50,7 @@ class BaseWordCloudSeries extends base_series_1.BaseSeries {
54
50
  }));
55
51
  }
56
52
  initMark() {
57
- var _a;
58
- (null === (_a = this._spec.wordMask) || void 0 === _a ? void 0 : _a.visible) && (this._maskMark = this._createMark(BaseWordCloudSeries.mark.wordMask, {
59
- dataView: !1
60
- })), this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {
53
+ this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {
61
54
  key: constant_1.DEFAULT_DATA_KEY,
62
55
  defaultMorphElementKey: this._seriesField,
63
56
  groupKey: this._seriesField,
@@ -65,18 +58,11 @@ class BaseWordCloudSeries extends base_series_1.BaseSeries {
65
58
  });
66
59
  }
67
60
  initMarkStyle() {
68
- this.initMarkStyleOfWord(this._wordMark, this._spec.word, this._spec.colorHexField, this._seriesField),
69
- this._maskMark && this.setMarkStyle(this._maskMark, {
70
- width: () => this._region.getLayoutRect().width,
71
- height: () => this._region.getLayoutRect().height,
72
- background: () => this._maskCanvas
73
- }, "normal", constant_1.AttributeLevel.Series);
74
- }
75
- initMarkStyleOfWord(wordMark, wordSpec, colorHexField, seriesField, isFillingWord) {
76
- var _a, _b;
61
+ var _a, _b, _c;
62
+ const wordMark = this._wordMark, wordSpec = null !== (_a = this._spec.word) && void 0 !== _a ? _a : {};
77
63
  wordMark && (this.setMarkStyle(wordMark, {
78
64
  fill: this.getWordColor,
79
- text: (null == wordSpec ? void 0 : wordSpec.formatMethod) ? datum => wordSpec.formatMethod(datum) : datum => datum[this._textField],
65
+ text: datum => datum[this._textField],
80
66
  x: datum => datum.x,
81
67
  y: datum => datum.y,
82
68
  fontFamily: datum => datum.fontFamily,
@@ -86,26 +72,25 @@ class BaseWordCloudSeries extends base_series_1.BaseSeries {
86
72
  angle: datum => datum.angle,
87
73
  visible: datum => datum.visible
88
74
  }, "normal", constant_1.AttributeLevel.Series), this.setMarkStyle(wordMark, {
89
- fontFamily: null !== (_b = null === (_a = null == wordSpec ? void 0 : wordSpec.style) || void 0 === _a ? void 0 : _a.fontFamily) && void 0 !== _b ? _b : this._defaultFontFamily
75
+ fontFamily: null !== (_c = null === (_b = wordSpec.style) || void 0 === _b ? void 0 : _b.fontFamily) && void 0 !== _c ? _c : this._defaultFontFamily
90
76
  }, "normal", constant_1.AttributeLevel.User_Mark));
91
77
  }
92
78
  initTooltip() {
93
79
  super.initTooltip(), this._wordMark && this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark);
94
80
  }
95
81
  initAnimation() {
96
- [ this._wordMark ].forEach((mark => {
97
- var _a, _b;
98
- if (mark) {
99
- const appearPreset = null === (_b = null === (_a = this._spec) || void 0 === _a ? void 0 : _a.animationAppear) || void 0 === _b ? void 0 : _b.preset, params = {
100
- animationConfig: () => {
101
- var _a, _b;
102
- return null === (_b = null === (_a = mark.getAnimationConfig()) || void 0 === _a ? void 0 : _a.appear) || void 0 === _b ? void 0 : _b[0];
103
- }
104
- };
105
- mark.setAnimationConfig((0, utils_1.animationConfig)(factory_1.Factory.getAnimationInKey("wordCloud")(params, appearPreset), (0,
106
- utils_1.userAnimationConfig)("word", this._spec, this._markAttributeContext)));
107
- }
108
- }));
82
+ var _a, _b;
83
+ const mark = this._wordMark;
84
+ if (mark) {
85
+ const appearPreset = null === (_b = null === (_a = this._spec) || void 0 === _a ? void 0 : _a.animationAppear) || void 0 === _b ? void 0 : _b.preset, params = {
86
+ animationConfig: () => {
87
+ var _a, _b;
88
+ return null === (_b = null === (_a = mark.getAnimationConfig()) || void 0 === _a ? void 0 : _a.appear) || void 0 === _b ? void 0 : _b[0];
89
+ }
90
+ };
91
+ mark.setAnimationConfig((0, utils_1.animationConfig)(factory_1.Factory.getAnimationInKey("wordCloud")(params, appearPreset), (0,
92
+ utils_1.userAnimationConfig)("word", this._spec, this._markAttributeContext)));
93
+ }
109
94
  }
110
95
  getWordOrdinalColorScale(field, isFillingWord) {
111
96
  var _a, _b, _c, _d, _e;
@@ -113,84 +98,124 @@ class BaseWordCloudSeries extends base_series_1.BaseSeries {
113
98
  return null === (_e = (_d = (new color_ordinal_scale_1.ColorOrdinalScale).domain(colorDomain)).range) || void 0 === _e ? void 0 : _e.call(_d, colorRange);
114
99
  }
115
100
  initColorCallback(field, isFillingWord) {
116
- var _a, _b, _c, _d;
101
+ var _a;
117
102
  if ("ordinal" === this._colorMode) {
118
103
  const scale = this.getWordOrdinalColorScale(field, isFillingWord);
119
- return datum => scale.scale(datum[null != field ? field : constant_1.DEFAULT_DATA_SERIES_FIELD]);
104
+ return datum => {
105
+ var _a;
106
+ return scale.scale(datum[null !== (_a = this._seriesField) && void 0 !== _a ? _a : constant_1.DEFAULT_DATA_SERIES_FIELD]);
107
+ };
120
108
  }
121
- const colorList = null !== (_a = isFillingWord ? this._colorList : this._wordCloudShapeConfig.fillingColorList) && void 0 !== _a ? _a : this._option.globalScale.getScale("color").range();
122
- if (1 === colorList.length) return datum => colorList[0];
123
- if (this._valueField) {
124
- const stats = this.getRawDataStatisticsByField(this._valueField, !0);
125
- if (stats.min === stats.max) return colorList[0];
126
- const scale = (new vscale_1.LinearScale).domain([ stats.min, stats.max ]).range(colorList);
127
- return datum => scale.scale(datum[this._valueField]);
128
- }
129
- const scale = (new vscale_1.LinearScale).domain([ 0, null !== (_d = null === (_c = null === (_b = this.getViewData()) || void 0 === _b ? void 0 : _b.latestData) || void 0 === _c ? void 0 : _c.length) && void 0 !== _d ? _d : 1 ]).range(colorList);
130
- return datum => scale.scale(datum[constant_1.DEFAULT_DATA_INDEX]);
109
+ let colorList = null !== (_a = isFillingWord ? this._colorList : this._wordCloudShapeConfig.fillingColorList) && void 0 !== _a ? _a : this._option.globalScale.getScale("color").range();
110
+ return 1 === colorList.length && (colorList = [ colorList[0], colorList[0] ]), datum => colorList[0];
131
111
  }
132
112
  compile() {
113
+ var _a, _b;
133
114
  super.compile();
134
115
  const {width: width, height: height} = this._region.getLayoutRect();
135
116
  if (!(0, vutils_1.isValidNumber)(width) || !(0, vutils_1.isValidNumber)(height) || !(height > 0 && width > 0)) return;
136
- const wordCloudTransforms = [];
137
- this._isWordCloudShape ? wordCloudTransforms.push(Object.assign({
117
+ const wordCloudTransforms = [], valueField = this._valueField, valueScale = new vscale_1.LinearScale, fontWeightRange = this._fontWeightRange;
118
+ if (valueField) {
119
+ const [minValue, maxValue] = (0, vgrammar_util_1.extent)(null === (_a = this.getViewData()) || void 0 === _a ? void 0 : _a.latestData.map((datum => +datum[valueField])));
120
+ valueScale.domain([ minValue, maxValue ], !0).range(fontWeightRange), wordCloudTransforms.push({
121
+ type: "map",
122
+ as: word_cloud_1.WORD_CLOUD_WEIGHT,
123
+ callback: datum => minValue === maxValue ? valueScale.scale(maxValue) : valueScale.scale(datum[valueField])
124
+ });
125
+ }
126
+ const wordSpec = null !== (_b = this._spec.word) && void 0 !== _b ? _b : {};
127
+ wordSpec.formatMethod && wordCloudTransforms.push({
128
+ type: "map",
129
+ as: word_cloud_1.WORD_CLOUD_TEXT,
130
+ callback: wordSpec.formatMethod
131
+ }), this._isWordCloudShape ? wordCloudTransforms.push(Object.assign({
138
132
  type: "wordcloudShape"
139
133
  }, this._wordCloudShapeTransformOption())) : wordCloudTransforms.push(Object.assign({
140
134
  type: "wordcloud"
141
135
  }, this._wordCloudTransformOption())), this._wordMark.getProduct().transform(wordCloudTransforms);
142
136
  }
143
- _getCommonTransformOptions() {
144
- var _a, _b, _c, _d, _e, _f, _g, _h;
145
- const {width: width, height: height} = this._region.getLayoutRect(), wordSpec = null !== (_a = this._spec.word) && void 0 !== _a ? _a : {}, wordStyleSpec = null !== (_b = wordSpec.style) && void 0 !== _b ? _b : {};
137
+ _wordCloudTransformOption() {
138
+ var _a, _b, _c, _d, _e;
139
+ const {width: width, height: height} = this._region.getLayoutRect(), wordStyleSpec = null !== (_b = null === (_a = this._spec.word) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {};
146
140
  return {
141
+ layoutType: (0, env_1.isTrueBrowser)(this._option.mode) ? this._wordCloudConfig.layoutMode : "fast",
147
142
  size: [ width, height ],
148
- shape: (0, vutils_1.isObject)(this._maskShape) && "text" === this._maskShape.type && (0,
149
- vutils_1.isNil)(this._maskShape.fontFamily) ? Object.assign({
150
- fontFamily: null === (_c = this._option.getTheme()) || void 0 === _c ? void 0 : _c.fontFamily
151
- }, this._maskShape) : this._maskShape,
152
- onUpdateMaskCanvas: (0, vutils_1.isObject)(this._maskShape) ? this.handleMaskCanvasUpdate : null,
143
+ shape: this._maskShape,
153
144
  dataIndexKey: constant_1.DEFAULT_DATA_KEY,
154
- text: wordSpec.formatMethod ? datum => wordSpec.formatMethod(datum) : {
145
+ text: {
155
146
  field: this._textField
156
147
  },
157
148
  fontSize: this._valueField ? {
158
149
  field: this._valueField
159
150
  } : this._fontSizeRange[0],
160
151
  fontSizeRange: "auto" === this._fontSizeRange ? null : this._fontSizeRange,
161
- padding: null !== (_e = null === (_d = this._spec.word) || void 0 === _d ? void 0 : _d.padding) && void 0 !== _e ? _e : config_1.DEFAULT_FONT_PADDING,
162
- fontFamily: null !== (_g = null !== (_f = this._spec.fontFamilyField) && void 0 !== _f ? _f : wordStyleSpec.fontFamily) && void 0 !== _g ? _g : this._defaultFontFamily,
163
- fontWeight: this._spec.fontWeightField ? {
164
- field: this._spec.fontWeightField
165
- } : this._valueField ? this._calculateFontWeight : null,
166
- fontStyle: null !== (_h = this._spec.fontStyleField) && void 0 !== _h ? _h : wordStyleSpec.fontStyle
167
- };
168
- }
169
- _wordCloudTransformOption() {
170
- var _a;
171
- return Object.assign(Object.assign({}, this._getCommonTransformOptions()), {
172
- layoutType: this._wordCloudConfig.layoutMode,
152
+ padding: this._fontPadding,
173
153
  rotate: this._rotateAngles,
174
- randomVisible: null !== (_a = this._spec.random) && void 0 !== _a ? _a : config_1.DEFAULT_RANDOM,
154
+ fontFamily: null !== (_d = null !== (_c = this._fontFamilyField) && void 0 !== _c ? _c : wordStyleSpec.fontFamily) && void 0 !== _d ? _d : this._defaultFontFamily,
155
+ fontWeight: this._fontWeightField ? {
156
+ field: this._fontWeightField
157
+ } : this._valueField ? {
158
+ field: word_cloud_1.WORD_CLOUD_WEIGHT
159
+ } : null,
160
+ fontStyle: null !== (_e = this._fontStyleField) && void 0 !== _e ? _e : wordStyleSpec.fontStyle,
161
+ randomVisible: this._random,
175
162
  clip: "clip" === this._wordCloudConfig.drawOutOfBound,
176
163
  shrink: this._wordCloudConfig.zoomToFit.shrink,
177
164
  enlarge: this._wordCloudConfig.zoomToFit.enlarge,
178
165
  minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,
179
166
  progressiveTime: this._wordCloudConfig.progressiveTime,
180
- progressiveStep: this._wordCloudConfig.progressiveStep,
181
- repeatFill: this._wordCloudConfig.zoomToFit.repeat
182
- });
167
+ progressiveStep: this._wordCloudConfig.progressiveStep
168
+ };
183
169
  }
184
170
  _wordCloudShapeTransformOption() {
185
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
186
- const wordStyleSpec = null !== (_b = null === (_a = this._spec.word) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, wordCloudShapeConfig = null !== (_c = this._wordCloudShapeConfig) && void 0 !== _c ? _c : {};
187
- return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), {
171
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
172
+ const {width: width, height: height} = this._region.getLayoutRect(), wordStyleSpec = null !== (_b = null === (_a = this._spec.word) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : {}, wordCloudShapeConfig = null !== (_c = this._wordCloudShapeConfig) && void 0 !== _c ? _c : {}, fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
173
+ return {
174
+ dataIndexKey: constant_1.DEFAULT_DATA_KEY,
175
+ size: [ width, height ],
176
+ shape: this._maskShape,
177
+ text: {
178
+ field: this._textField
179
+ },
180
+ fontSize: this._valueField ? {
181
+ field: this._valueField
182
+ } : this._fontSizeRange[0],
183
+ fontSizeRange: "auto" === this._fontSizeRange ? null : this._fontSizeRange,
184
+ padding: this._fontPadding,
188
185
  rotateList: this._rotateAngles,
189
- fillingFontFamily: null !== (_e = null !== (_d = wordCloudShapeConfig.fillingFontFamilyField) && void 0 !== _d ? _d : wordStyleSpec.fontFamily) && void 0 !== _e ? _e : this._defaultFontFamily,
190
- fillingPadding: null !== (_g = null === (_f = this._spec.fillingWord) || void 0 === _f ? void 0 : _f.padding) && void 0 !== _g ? _g : config_1.DEFAULT_FONT_PADDING,
191
- fillingFontStyle: null !== (_h = wordCloudShapeConfig.fillingFontStyleField) && void 0 !== _h ? _h : wordStyleSpec.fontStyle,
192
- fillingFontWeight: null !== (_j = wordCloudShapeConfig.fillingFontWeightField) && void 0 !== _j ? _j : wordStyleSpec.fontWeight
193
- });
186
+ fontFamily: null !== (_e = null !== (_d = this._fontFamilyField) && void 0 !== _d ? _d : wordStyleSpec.fontFamily) && void 0 !== _e ? _e : this._defaultFontFamily,
187
+ fontWeight: this._fontWeightField ? {
188
+ field: this._fontWeightField
189
+ } : this._valueField ? {
190
+ field: word_cloud_1.WORD_CLOUD_WEIGHT
191
+ } : null,
192
+ fontStyle: null !== (_f = this._fontStyleField) && void 0 !== _f ? _f : wordStyleSpec.fontStyle,
193
+ fillingFontFamily: null !== (_h = null !== (_g = wordCloudShapeConfig.fillingFontFamilyField) && void 0 !== _g ? _g : wordStyleSpec.fontFamily) && void 0 !== _h ? _h : this._defaultFontFamily,
194
+ fillingPadding: this._fillingFontPadding,
195
+ fillingFontStyle: null !== (_j = wordCloudShapeConfig.fillingFontStyleField) && void 0 !== _j ? _j : wordStyleSpec.fontStyle,
196
+ fillingFontWeight: null !== (_k = wordCloudShapeConfig.fillingFontWeightField) && void 0 !== _k ? _k : wordStyleSpec.fontWeight,
197
+ fillingRotateList: fillingRotateAngles,
198
+ fillingTimes: wordCloudShapeConfig.fillingTimes,
199
+ fillingXStep: wordCloudShapeConfig.fillingXStep,
200
+ fillingYStep: wordCloudShapeConfig.fillingYStep,
201
+ fillingXRatioStep: wordCloudShapeConfig.fillingXRatioStep,
202
+ fillingYRatioStep: wordCloudShapeConfig.fillingYRatioStep,
203
+ fillingInitialOpacity: wordCloudShapeConfig.fillingInitialOpacity,
204
+ fillingDeltaOpacity: wordCloudShapeConfig.fillingDeltaOpacity,
205
+ fillingInitialFontSize: wordCloudShapeConfig.fillingInitialFontSize,
206
+ fillingDeltaFontSize: wordCloudShapeConfig.fillingDeltaFontSize,
207
+ ratio: wordCloudShapeConfig.ratio,
208
+ fillingRatio: wordCloudShapeConfig.fillingRatio,
209
+ removeWhiteBorder: wordCloudShapeConfig.removeWhiteBorder,
210
+ textLayoutTimes: wordCloudShapeConfig.textLayoutTimes,
211
+ fontSizeShrinkFactor: wordCloudShapeConfig.fontSizeShrinkFactor,
212
+ stepFactor: wordCloudShapeConfig.stepFactor,
213
+ layoutMode: wordCloudShapeConfig.layoutMode,
214
+ importantWordCount: wordCloudShapeConfig.importantWordCount,
215
+ globalShinkLimit: wordCloudShapeConfig.globalShinkLimit,
216
+ fontSizeEnlargeFactor: wordCloudShapeConfig.fontSizeEnlargeFactor,
217
+ fillingDeltaFontSizeFactor: wordCloudShapeConfig.fillingDeltaFontSizeFactor
218
+ };
194
219
  }
195
220
  getStatisticFields() {
196
221
  const fields = [];