@visactor/vchart 1.7.4 → 1.7.5

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 (161) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +29256 -32302
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js +2 -1
  6. package/cjs/chart/base-chart.js.map +1 -1
  7. package/cjs/component/axis/base-axis.d.ts +5 -2
  8. package/cjs/component/axis/base-axis.js +41 -14
  9. package/cjs/component/axis/base-axis.js.map +1 -1
  10. package/cjs/component/axis/cartesian/axis.d.ts +2 -1
  11. package/cjs/component/axis/cartesian/axis.js +10 -28
  12. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  13. package/cjs/component/axis/cartesian/time-axis.js +9 -17
  14. package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
  15. package/cjs/component/axis/mixin/linear-axis-mixin.js +11 -15
  16. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  17. package/cjs/component/axis/polar/axis.d.ts +2 -0
  18. package/cjs/component/axis/polar/axis.js +10 -26
  19. package/cjs/component/axis/polar/axis.js.map +1 -1
  20. package/cjs/component/brush/brush.js +2 -3
  21. package/cjs/component/brush/brush.js.map +1 -1
  22. package/cjs/component/data-zoom/data-zoom/data-zoom.js +26 -24
  23. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  24. package/cjs/component/geo/projection.js +10 -6
  25. package/cjs/component/geo/projection.js.map +1 -1
  26. package/cjs/component/marker/base-marker.js +4 -10
  27. package/cjs/component/marker/base-marker.js.map +1 -1
  28. package/cjs/component/marker/mark-area/mark-area.js +16 -15
  29. package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
  30. package/cjs/component/marker/mark-line/mark-line.js +22 -21
  31. package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
  32. package/cjs/component/marker/mark-point/mark-point.js +30 -26
  33. package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
  34. package/cjs/core/index.d.ts +1 -1
  35. package/cjs/core/index.js +1 -1
  36. package/cjs/core/index.js.map +1 -1
  37. package/cjs/event/events/dimension/util/cartesian.js +5 -17
  38. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  39. package/cjs/event/events/dimension/util/common.d.ts +1 -0
  40. package/cjs/event/events/dimension/util/common.js +9 -1
  41. package/cjs/event/events/dimension/util/common.js.map +1 -1
  42. package/cjs/event/events/dimension/util/polar.js +4 -17
  43. package/cjs/event/events/dimension/util/polar.js.map +1 -1
  44. package/cjs/series/area/area.js +8 -8
  45. package/cjs/series/area/area.js.map +1 -1
  46. package/cjs/series/area/interface.d.ts +2 -2
  47. package/cjs/series/area/interface.js.map +1 -1
  48. package/cjs/series/bar/bar.js +3 -3
  49. package/cjs/series/bar/bar.js.map +1 -1
  50. package/cjs/series/bar/interface.d.ts +2 -2
  51. package/cjs/series/bar/interface.js.map +1 -1
  52. package/cjs/series/circle-packing/circle-packing.js +2 -2
  53. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  54. package/cjs/series/correlation/correlation.js +30 -26
  55. package/cjs/series/correlation/correlation.js.map +1 -1
  56. package/cjs/series/dot/dot.js +2 -2
  57. package/cjs/series/dot/dot.js.map +1 -1
  58. package/cjs/series/funnel/funnel.js +8 -8
  59. package/cjs/series/funnel/funnel.js.map +1 -1
  60. package/cjs/series/line/interface.d.ts +2 -2
  61. package/cjs/series/line/interface.js.map +1 -1
  62. package/cjs/series/pie/pie.d.ts +2 -0
  63. package/cjs/series/pie/pie.js +29 -23
  64. package/cjs/series/pie/pie.js.map +1 -1
  65. package/cjs/series/rose/rose.d.ts +3 -0
  66. package/cjs/series/rose/rose.js +15 -2
  67. package/cjs/series/rose/rose.js.map +1 -1
  68. package/cjs/series/sankey/sankey.js +8 -7
  69. package/cjs/series/sankey/sankey.js.map +1 -1
  70. package/cjs/series/scatter/interface.d.ts +2 -2
  71. package/cjs/series/scatter/interface.js.map +1 -1
  72. package/cjs/series/word-cloud/base.d.ts +3 -0
  73. package/cjs/series/word-cloud/base.js +86 -73
  74. package/cjs/series/word-cloud/base.js.map +1 -1
  75. package/cjs/series/word-cloud/word-cloud-3d.d.ts +22 -1
  76. package/cjs/series/word-cloud/word-cloud-3d.js +29 -148
  77. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  78. package/cjs/typings/spec/chart.d.ts +2 -1
  79. package/cjs/typings/spec/chart.js.map +1 -1
  80. package/cjs/util/model.d.ts +1 -0
  81. package/cjs/util/model.js +15 -1
  82. package/cjs/util/model.js.map +1 -1
  83. package/esm/chart/base-chart.js +2 -1
  84. package/esm/chart/base-chart.js.map +1 -1
  85. package/esm/component/axis/base-axis.d.ts +5 -2
  86. package/esm/component/axis/base-axis.js +47 -13
  87. package/esm/component/axis/base-axis.js.map +1 -1
  88. package/esm/component/axis/cartesian/axis.d.ts +2 -1
  89. package/esm/component/axis/cartesian/axis.js +9 -34
  90. package/esm/component/axis/cartesian/axis.js.map +1 -1
  91. package/esm/component/axis/cartesian/time-axis.js +9 -17
  92. package/esm/component/axis/cartesian/time-axis.js.map +1 -1
  93. package/esm/component/axis/mixin/linear-axis-mixin.js +7 -5
  94. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  95. package/esm/component/axis/polar/axis.d.ts +2 -0
  96. package/esm/component/axis/polar/axis.js +9 -32
  97. package/esm/component/axis/polar/axis.js.map +1 -1
  98. package/esm/component/brush/brush.js +2 -3
  99. package/esm/component/brush/brush.js.map +1 -1
  100. package/esm/component/data-zoom/data-zoom/data-zoom.js +26 -24
  101. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  102. package/esm/component/geo/projection.js +10 -6
  103. package/esm/component/geo/projection.js.map +1 -1
  104. package/esm/component/marker/base-marker.js +5 -9
  105. package/esm/component/marker/base-marker.js.map +1 -1
  106. package/esm/component/marker/mark-area/mark-area.js +16 -15
  107. package/esm/component/marker/mark-area/mark-area.js.map +1 -1
  108. package/esm/component/marker/mark-line/mark-line.js +22 -21
  109. package/esm/component/marker/mark-line/mark-line.js.map +1 -1
  110. package/esm/component/marker/mark-point/mark-point.js +30 -26
  111. package/esm/component/marker/mark-point/mark-point.js.map +1 -1
  112. package/esm/core/index.d.ts +1 -1
  113. package/esm/core/index.js +1 -1
  114. package/esm/core/index.js.map +1 -1
  115. package/esm/event/events/dimension/util/cartesian.js +7 -18
  116. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  117. package/esm/event/events/dimension/util/common.d.ts +1 -0
  118. package/esm/event/events/dimension/util/common.js +5 -0
  119. package/esm/event/events/dimension/util/common.js.map +1 -1
  120. package/esm/event/events/dimension/util/polar.js +6 -17
  121. package/esm/event/events/dimension/util/polar.js.map +1 -1
  122. package/esm/series/area/area.js +8 -8
  123. package/esm/series/area/area.js.map +1 -1
  124. package/esm/series/area/interface.d.ts +2 -2
  125. package/esm/series/area/interface.js.map +1 -1
  126. package/esm/series/bar/bar.js +3 -3
  127. package/esm/series/bar/bar.js.map +1 -1
  128. package/esm/series/bar/interface.d.ts +2 -2
  129. package/esm/series/bar/interface.js.map +1 -1
  130. package/esm/series/circle-packing/circle-packing.js +2 -2
  131. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  132. package/esm/series/correlation/correlation.js +30 -26
  133. package/esm/series/correlation/correlation.js.map +1 -1
  134. package/esm/series/dot/dot.js +2 -2
  135. package/esm/series/dot/dot.js.map +1 -1
  136. package/esm/series/funnel/funnel.js +8 -8
  137. package/esm/series/funnel/funnel.js.map +1 -1
  138. package/esm/series/line/interface.d.ts +2 -2
  139. package/esm/series/line/interface.js.map +1 -1
  140. package/esm/series/pie/pie.d.ts +2 -0
  141. package/esm/series/pie/pie.js +26 -19
  142. package/esm/series/pie/pie.js.map +1 -1
  143. package/esm/series/rose/rose.d.ts +3 -0
  144. package/esm/series/rose/rose.js +15 -2
  145. package/esm/series/rose/rose.js.map +1 -1
  146. package/esm/series/sankey/sankey.js +8 -7
  147. package/esm/series/sankey/sankey.js.map +1 -1
  148. package/esm/series/scatter/interface.d.ts +2 -2
  149. package/esm/series/scatter/interface.js.map +1 -1
  150. package/esm/series/word-cloud/base.d.ts +3 -0
  151. package/esm/series/word-cloud/base.js +86 -73
  152. package/esm/series/word-cloud/base.js.map +1 -1
  153. package/esm/series/word-cloud/word-cloud-3d.d.ts +22 -1
  154. package/esm/series/word-cloud/word-cloud-3d.js +29 -153
  155. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  156. package/esm/typings/spec/chart.d.ts +2 -1
  157. package/esm/typings/spec/chart.js.map +1 -1
  158. package/esm/util/model.d.ts +1 -0
  159. package/esm/util/model.js +12 -0
  160. package/esm/util/model.js.map +1 -1
  161. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- import { AttributeLevel, DEFAULT_DATA_KEY } from "../../constant";
1
+ import { AttributeLevel } from "../../constant";
2
2
 
3
3
  import { TextMark } from "../../mark/text";
4
4
 
@@ -6,12 +6,6 @@ import { SeriesMarkNameEnum, SeriesTypeEnum } from "../interface/type";
6
6
 
7
7
  import { animationConfig, userAnimationConfig } from "../../animation/utils";
8
8
 
9
- import { LinearScale } from "@visactor/vscale";
10
-
11
- import { extent } from "@visactor/vgrammar-util";
12
-
13
- import { WORD_CLOUD_ANGLE, WORD_CLOUD_FILLING_ANGLE, WORD_CLOUD_TEXT, WORD_CLOUD_WEIGHT } from "../../constant/word-cloud";
14
-
15
9
  import { BaseWordCloudSeries } from "./base";
16
10
 
17
11
  import { Factory } from "../../core/factory";
@@ -26,114 +20,19 @@ export class WordCloud3dSeries extends BaseWordCloudSeries {
26
20
  constructor() {
27
21
  super(...arguments), this.type = SeriesTypeEnum.wordCloud3d;
28
22
  }
29
- compile() {
30
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
31
- super.compile();
32
- const wordCloudTransforms = [], valueField = this._valueField, valueScale = new LinearScale, fontWeightRange = this._fontWeightRange, rotateAngles = this._rotateAngles, fontWeightField = this._fontWeightField, fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
33
- if (valueField) {
34
- const [minValue, maxValue] = extent(null === (_a = this.getViewData()) || void 0 === _a ? void 0 : _a.latestData.map((datum => +datum[valueField])));
35
- valueScale.domain([ minValue, maxValue ], !0).range(fontWeightRange), wordCloudTransforms.push({
36
- type: "map",
37
- as: WORD_CLOUD_WEIGHT,
38
- callback: datum => minValue === maxValue ? valueScale.scale(maxValue) : valueScale.scale(datum[valueField])
39
- });
40
- }
41
- wordCloudTransforms.push({
42
- type: "map",
43
- as: WORD_CLOUD_ANGLE,
44
- callback: () => rotateAngles[Math.floor(Math.random() * rotateAngles.length)]
45
- }), wordCloudTransforms.push({
46
- type: "map",
47
- as: WORD_CLOUD_FILLING_ANGLE,
48
- callback: () => fillingRotateAngles[Math.floor(Math.random() * fillingRotateAngles.length)]
49
- }), (null === (_b = this._spec.word) || void 0 === _b ? void 0 : _b.formatMethod) && wordCloudTransforms.push({
50
- type: "map",
51
- as: WORD_CLOUD_TEXT,
52
- callback: this._spec.word.formatMethod
23
+ _wordCloudTransformOption() {
24
+ var _a;
25
+ return Object.assign(Object.assign({}, super._wordCloudTransformOption()), {
26
+ postProjection: null !== (_a = this._spec.postProjection) && void 0 !== _a ? _a : "StereographicProjection",
27
+ depth_3d: this._spec.depth_3d
28
+ });
29
+ }
30
+ _wordCloudShapeTransformOption() {
31
+ var _a;
32
+ return Object.assign(Object.assign({}, super._wordCloudShapeTransformOption()), {
33
+ postProjection: null !== (_a = this._spec.postProjection) && void 0 !== _a ? _a : "StereographicProjection",
34
+ depth_3d: this._spec.depth_3d
53
35
  });
54
- const textField = (null === (_c = this._spec.word) || void 0 === _c ? void 0 : _c.formatMethod) ? WORD_CLOUD_TEXT : this._nameField;
55
- this._isWordCloudShape ? wordCloudTransforms.push({
56
- type: "wordcloudShape",
57
- size: [ this._region.getLayoutRect().width, this._region.getLayoutRect().height ],
58
- shape: this._maskShape,
59
- postProjection: null !== (_m = this._spec.postProjection) && void 0 !== _m ? _m : "StereographicProjection",
60
- dataIndexKey: DEFAULT_DATA_KEY,
61
- text: {
62
- field: textField
63
- },
64
- fontSize: valueField ? {
65
- field: valueField
66
- } : this._fontSizeRange[0],
67
- fontSizeRange: this._fontSizeRange,
68
- padding: this._fontPadding,
69
- rotateList: rotateAngles,
70
- fontFamily: null !== (_r = null !== (_o = this._fontFamilyField) && void 0 !== _o ? _o : null === (_q = null === (_p = this._spec.word) || void 0 === _p ? void 0 : _p.style) || void 0 === _q ? void 0 : _q.fontFamily) && void 0 !== _r ? _r : this._defaultFontFamily,
71
- fontWeight: fontWeightField ? {
72
- field: fontWeightField
73
- } : valueField ? {
74
- field: WORD_CLOUD_WEIGHT
75
- } : null,
76
- fontStyle: null !== (_s = this._fontStyleField) && void 0 !== _s ? _s : null === (_u = null === (_t = this._spec.word) || void 0 === _t ? void 0 : _t.style) || void 0 === _u ? void 0 : _u.fontStyle,
77
- depth_3d: this._spec.depth_3d,
78
- fillingFontFamily: null !== (_z = null !== (_w = null === (_v = this._wordCloudShapeConfig) || void 0 === _v ? void 0 : _v.fillingFontFamilyField) && void 0 !== _w ? _w : null === (_y = null === (_x = this._spec.word) || void 0 === _x ? void 0 : _x.style) || void 0 === _y ? void 0 : _y.fontFamily) && void 0 !== _z ? _z : this._defaultFontFamily,
79
- fillingPadding: this._fillingFontPadding,
80
- fillingFontStyle: null !== (_1 = null === (_0 = this._wordCloudShapeConfig) || void 0 === _0 ? void 0 : _0.fillingFontStyleField) && void 0 !== _1 ? _1 : null === (_3 = null === (_2 = this._spec.word) || void 0 === _2 ? void 0 : _2.style) || void 0 === _3 ? void 0 : _3.fontStyle,
81
- fillingFontWeight: null !== (_5 = null === (_4 = this._wordCloudShapeConfig) || void 0 === _4 ? void 0 : _4.fillingFontWeightField) && void 0 !== _5 ? _5 : null === (_7 = null === (_6 = this._spec.word) || void 0 === _6 ? void 0 : _6.style) || void 0 === _7 ? void 0 : _7.fontWeight,
82
- fillingRotateList: fillingRotateAngles,
83
- fillingTimes: null === (_8 = this._wordCloudShapeConfig) || void 0 === _8 ? void 0 : _8.fillingTimes,
84
- fillingXStep: null === (_9 = this._wordCloudShapeConfig) || void 0 === _9 ? void 0 : _9.fillingXStep,
85
- fillingYStep: null === (_10 = this._wordCloudShapeConfig) || void 0 === _10 ? void 0 : _10.fillingYStep,
86
- fillingXRatioStep: null === (_11 = this._wordCloudShapeConfig) || void 0 === _11 ? void 0 : _11.fillingXRatioStep,
87
- fillingYRatioStep: null === (_12 = this._wordCloudShapeConfig) || void 0 === _12 ? void 0 : _12.fillingYRatioStep,
88
- fillingInitialOpacity: null === (_13 = this._wordCloudShapeConfig) || void 0 === _13 ? void 0 : _13.fillingInitialOpacity,
89
- fillingDeltaOpacity: null === (_14 = this._wordCloudShapeConfig) || void 0 === _14 ? void 0 : _14.fillingDeltaOpacity,
90
- fillingInitialFontSize: null === (_15 = this._wordCloudShapeConfig) || void 0 === _15 ? void 0 : _15.fillingInitialFontSize,
91
- fillingDeltaFontSize: null === (_16 = this._wordCloudShapeConfig) || void 0 === _16 ? void 0 : _16.fillingDeltaFontSize,
92
- ratio: null === (_17 = this._wordCloudShapeConfig) || void 0 === _17 ? void 0 : _17.ratio,
93
- fillingRatio: null === (_18 = this._wordCloudShapeConfig) || void 0 === _18 ? void 0 : _18.fillingRatio,
94
- removeWhiteBorder: null === (_19 = this._wordCloudShapeConfig) || void 0 === _19 ? void 0 : _19.removeWhiteBorder,
95
- textLayoutTimes: null === (_20 = this._wordCloudShapeConfig) || void 0 === _20 ? void 0 : _20.textLayoutTimes,
96
- fontSizeShrinkFactor: null === (_21 = this._wordCloudShapeConfig) || void 0 === _21 ? void 0 : _21.fontSizeShrinkFactor,
97
- stepFactor: null === (_22 = this._wordCloudShapeConfig) || void 0 === _22 ? void 0 : _22.stepFactor,
98
- layoutMode: null === (_23 = this._wordCloudShapeConfig) || void 0 === _23 ? void 0 : _23.layoutMode,
99
- importantWordCount: null === (_24 = this._wordCloudShapeConfig) || void 0 === _24 ? void 0 : _24.importantWordCount,
100
- globalShinkLimit: null === (_25 = this._wordCloudShapeConfig) || void 0 === _25 ? void 0 : _25.globalShinkLimit,
101
- fontSizeEnlargeFactor: null === (_26 = this._wordCloudShapeConfig) || void 0 === _26 ? void 0 : _26.fontSizeEnlargeFactor,
102
- fillingDeltaFontSizeFactor: null === (_27 = this._wordCloudShapeConfig) || void 0 === _27 ? void 0 : _27.fillingDeltaFontSizeFactor
103
- }) : (wordCloudTransforms.push({
104
- type: "wordcloud",
105
- layoutType: this._wordCloudConfig.layoutMode,
106
- size: [ this._region.getLayoutRect().width, this._region.getLayoutRect().height ],
107
- shape: this._maskShape,
108
- postProjection: null !== (_d = this._spec.postProjection) && void 0 !== _d ? _d : "StereographicProjection",
109
- dataIndexKey: DEFAULT_DATA_KEY,
110
- text: {
111
- field: textField
112
- },
113
- fontSize: valueField ? {
114
- field: valueField
115
- } : this._fontSizeRange[0],
116
- fontSizeRange: this._fontSizeRange,
117
- padding: this._fontPadding,
118
- rotate: {
119
- field: WORD_CLOUD_ANGLE
120
- },
121
- fontFamily: null !== (_h = null !== (_e = this._fontFamilyField) && void 0 !== _e ? _e : null === (_g = null === (_f = this._spec.word) || void 0 === _f ? void 0 : _f.style) || void 0 === _g ? void 0 : _g.fontFamily) && void 0 !== _h ? _h : this._defaultFontFamily,
122
- fontWeight: fontWeightField ? {
123
- field: fontWeightField
124
- } : valueField ? {
125
- field: WORD_CLOUD_WEIGHT
126
- } : null,
127
- fontStyle: null !== (_j = this._fontStyleField) && void 0 !== _j ? _j : null === (_l = null === (_k = this._spec.word) || void 0 === _k ? void 0 : _k.style) || void 0 === _l ? void 0 : _l.fontStyle,
128
- depth_3d: this._spec.depth_3d,
129
- randomVisible: this._random,
130
- clip: "clip" === this._wordCloudConfig.drawOutOfBound,
131
- shrink: this._wordCloudConfig.zoomToFit.shrink,
132
- enlarge: this._wordCloudConfig.zoomToFit.enlarge,
133
- minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,
134
- progressiveTime: this._wordCloudConfig.progressiveTime,
135
- progressiveStep: this._wordCloudConfig.progressiveStep
136
- }), this._wordMark.getProduct().transform(wordCloudTransforms)), this._data.getProduct().transform(wordCloudTransforms);
137
36
  }
138
37
  initMark() {
139
38
  this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {
@@ -147,66 +46,43 @@ export class WordCloud3dSeries extends BaseWordCloudSeries {
147
46
  }));
148
47
  }
149
48
  initMarkStyle() {
150
- var _a, _b, _c, _d, _e, _f;
49
+ super.initMarkStyle();
151
50
  const wordMark = this._wordMark, fillingWordMark = this._fillingWordMark;
152
- wordMark && (this.setMarkStyle(wordMark, {
153
- fill: this._colorHexField ? datum => datum[this._colorHexField] : this.getWordColorAttribute(this._seriesField, !1),
154
- text: datum => datum[this._nameField],
155
- x: datum => datum.x,
156
- y: datum => datum.y,
51
+ wordMark && this.setMarkStyle(wordMark, {
157
52
  z: datum => {
158
53
  var _a;
159
54
  return null !== (_a = datum.z) && void 0 !== _a ? _a : 0;
160
- },
161
- fontFamily: datum => datum.fontFamily,
162
- fontSize: datum => datum.fontSize,
163
- fontStyle: datum => datum.fontStyle,
164
- fontWeight: datum => datum.fontWeight,
165
- angle: datum => datum.angle,
166
- visible: datum => !datum.isFillingWord
167
- }, "normal", AttributeLevel.Series), this.setMarkStyle(wordMark, {
168
- fontFamily: null !== (_c = null === (_b = null === (_a = this._spec.word) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.fontFamily) && void 0 !== _c ? _c : this._defaultFontFamily
169
- }, "normal", AttributeLevel.User_Mark)), fillingWordMark && (this.setMarkStyle(fillingWordMark, {
170
- fill: this._wordCloudShapeConfig.fillingColorHexField ? datum => datum[this._wordCloudShapeConfig.fillingColorHexField] : this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField, !0),
171
- text: datum => datum[this._nameField],
172
- x: datum => datum.x,
173
- y: datum => datum.y,
55
+ }
56
+ }, "normal", AttributeLevel.Series), fillingWordMark && this.setMarkStyle(fillingWordMark, {
174
57
  z: datum => {
175
58
  var _a;
176
59
  return null !== (_a = datum.z) && void 0 !== _a ? _a : 0;
177
- },
178
- fontFamily: datum => datum.fontFamily,
179
- fontSize: datum => datum.fontSize,
180
- fontStyle: datum => datum.fontStyle,
181
- fontWeight: datum => datum.fontWeight,
182
- angle: datum => datum.angle,
183
- visible: datum => datum.isFillingWord
184
- }, "normal", AttributeLevel.Series), this.setMarkStyle(fillingWordMark, {
185
- fontFamily: null !== (_f = null === (_e = null === (_d = this._spec.word) || void 0 === _d ? void 0 : _d.style) || void 0 === _e ? void 0 : _e.fontFamily) && void 0 !== _f ? _f : this._defaultFontFamily
186
- }, "normal", AttributeLevel.User_Mark)), this._trigger.registerMark(wordMark), this._trigger.registerMark(fillingWordMark);
60
+ }
61
+ }, "normal", AttributeLevel.Series);
187
62
  }
188
63
  initAnimation() {
189
- var _a, _b;
190
- this._wordMark && this._wordMark.setAnimationConfig(animationConfig(null === (_a = Factory.getAnimationInKey("wordCloud3d")) || void 0 === _a ? void 0 : _a((() => {
191
- var _a, _b, _c, _d, _e;
192
- const srView = this.getCompiler().getVGrammarView(), width = srView.width() - (null === (_a = this._padding) || void 0 === _a ? void 0 : _a.left) || 0 - (null === (_b = this._padding) || void 0 === _b ? void 0 : _b.right) || 0, height = srView.height() - (null === (_c = this._padding) || void 0 === _c ? void 0 : _c.top) || 0 - (null === (_d = this._padding) || void 0 === _d ? void 0 : _d.bottom) || 0, r = Math.max(width, height) / 2;
64
+ var _a, _b, _c;
65
+ const padding = null !== (_a = this._padding) && void 0 !== _a ? _a : {};
66
+ this._wordMark && this._wordMark.setAnimationConfig(animationConfig(null === (_b = Factory.getAnimationInKey("wordCloud3d")) || void 0 === _b ? void 0 : _b((() => {
67
+ var _a;
68
+ const srView = this.getCompiler().getVGrammarView(), width = srView.width() - padding.left || 0 - padding.right || 0, height = srView.height() - padding.top || 0 - padding.bottom || 0, r = Math.max(width, height) / 2;
193
69
  return {
194
70
  center: {
195
71
  x: r,
196
72
  y: r,
197
- z: null !== (_e = this._spec.depth_3d) && void 0 !== _e ? _e : r
73
+ z: null !== (_a = this._spec.depth_3d) && void 0 !== _a ? _a : r
198
74
  },
199
75
  r: r
200
76
  };
201
77
  })), userAnimationConfig(SeriesMarkNameEnum.word, this._spec, this._markAttributeContext))),
202
- this._fillingWordMark && this._fillingWordMark.setAnimationConfig(animationConfig(null === (_b = Factory.getAnimationInKey("wordCloud3d")) || void 0 === _b ? void 0 : _b((() => {
203
- var _a, _b, _c, _d, _e;
204
- const srView = this.getCompiler().getVGrammarView(), width = srView.width() - (null === (_a = this._padding) || void 0 === _a ? void 0 : _a.left) || 0 - (null === (_b = this._padding) || void 0 === _b ? void 0 : _b.right) || 0, height = srView.height() - (null === (_c = this._padding) || void 0 === _c ? void 0 : _c.top) || 0 - (null === (_d = this._padding) || void 0 === _d ? void 0 : _d.bottom) || 0, r = Math.max(width, height) / 2;
78
+ this._fillingWordMark && this._fillingWordMark.setAnimationConfig(animationConfig(null === (_c = Factory.getAnimationInKey("wordCloud3d")) || void 0 === _c ? void 0 : _c((() => {
79
+ var _a;
80
+ const srView = this.getCompiler().getVGrammarView(), width = srView.width() - padding.left || 0 - padding.right || 0, height = srView.height() - padding.top || 0 - padding.bottom || 0, r = Math.max(width, height) / 2;
205
81
  return {
206
82
  center: {
207
83
  x: r,
208
84
  y: r,
209
- z: null !== (_e = this._spec.depth_3d) && void 0 !== _e ? _e : r
85
+ z: null !== (_a = this._spec.depth_3d) && void 0 !== _a ? _a : r
210
86
  },
211
87
  r: r
212
88
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/word-cloud/word-cloud-3d.ts"],"names":[],"mappings":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CAAC;gBACpF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,IAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,GAAG,CAAA,IAAI,CAAC,IAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,CAAA,IAAI,CAAC,CAAC;gBACtF,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtC,OAAO;oBACL,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,mCAAI,CAAC,EAAE;oBACnD,CAAC;iBACF,CAAC;YACJ,CAAC,CAAC,EACF,mBAAmB,CAAC,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAC5F,CACF,CAAC;SACH;IACH,CAAC;;AAlQe,sBAAI,GAAW,cAAc,CAAC,WAAW,CAAC;AAqQ5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,2BAA2B,EAAE,CAAC;IAC9B,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAClE,4BAA4B,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,gCAAgC,EAAE,CAAC;IACnC,yBAAyB,EAAE,CAAC;AAC9B,CAAC,CAAC","file":"word-cloud-3d.js","sourcesContent":["import { AttributeLevel, DEFAULT_DATA_KEY } from '../../constant';\nimport { TextMark, type ITextMark } from '../../mark/text';\nimport { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface/type';\nimport type { IWordCloud3dSeriesSpec } from './interface';\nimport type { Datum } from '../../typings';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { LinearScale } from '@visactor/vscale';\nimport { extent } from '@visactor/vgrammar-util';\nimport {\n WORD_CLOUD_ANGLE,\n WORD_CLOUD_FILLING_ANGLE,\n WORD_CLOUD_TEXT,\n WORD_CLOUD_WEIGHT\n} from '../../constant/word-cloud';\nimport type { ICompilableMark } from '../../compile/mark';\nimport { BaseWordCloudSeries } from './base';\nimport { Factory } from '../../core/factory';\nimport { registerWordCloud3dAnimation } from './animation';\nimport { registerWordCloudTransforms } from '@visactor/vgrammar-wordcloud';\nimport { registerWordCloudShapeTransforms } from '@visactor/vgrammar-wordcloud-shape';\n\nexport class WordCloud3dSeries<\n T extends IWordCloud3dSeriesSpec = IWordCloud3dSeriesSpec\n> extends BaseWordCloudSeries<T> {\n static readonly type: string = SeriesTypeEnum.wordCloud3d;\n type = SeriesTypeEnum.wordCloud3d;\n\n compile(): void {\n super.compile();\n\n const wordCloudTransforms: any[] = [];\n const valueField = this._valueField;\n const valueScale = new LinearScale();\n const fontWeightRange = this._fontWeightRange;\n const rotateAngles = this._rotateAngles;\n const fontWeightField = this._fontWeightField;\n const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;\n\n // fontWeight处理\n if (valueField) {\n const [minValue, maxValue] = extent(this.getViewData()?.latestData.map((datum: any) => +datum[valueField]));\n valueScale.domain([minValue, maxValue], true).range(fontWeightRange);\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_WEIGHT,\n callback: (datum: any) => {\n if (minValue === maxValue) {\n return valueScale.scale(maxValue);\n }\n return valueScale.scale(datum[valueField]);\n }\n });\n }\n\n // rotateAngles处理\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_ANGLE,\n callback: () => {\n return rotateAngles[Math.floor(Math.random() * rotateAngles.length)];\n }\n });\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_FILLING_ANGLE,\n callback: () => {\n return fillingRotateAngles[Math.floor(Math.random() * fillingRotateAngles.length)];\n }\n });\n\n // text fromat method 处理\n if (this._spec.word?.formatMethod) {\n wordCloudTransforms.push({\n type: 'map',\n as: WORD_CLOUD_TEXT,\n callback: this._spec.word.formatMethod\n });\n }\n\n const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;\n\n // 词云 transform\n if (!this._isWordCloudShape) {\n wordCloudTransforms.push({\n type: 'wordcloud',\n layoutType: this._wordCloudConfig.layoutMode,\n size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],\n shape: this._maskShape,\n postProjection: this._spec.postProjection ?? 'StereographicProjection',\n dataIndexKey: DEFAULT_DATA_KEY,\n text: { field: textField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotate: { field: WORD_CLOUD_ANGLE },\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily ?? this._defaultFontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n depth_3d: this._spec.depth_3d,\n\n randomVisible: this._random,\n clip: this._wordCloudConfig.drawOutOfBound === 'clip',\n shrink: this._wordCloudConfig.zoomToFit.shrink,\n enlarge: this._wordCloudConfig.zoomToFit.enlarge,\n minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,\n progressiveTime: this._wordCloudConfig.progressiveTime,\n progressiveStep: this._wordCloudConfig.progressiveStep\n });\n // 挂到mark的trnsform上,注册的时候决定transform的执行时机\n (this._wordMark as ICompilableMark).getProduct().transform(wordCloudTransforms);\n }\n // 形状词云 transform\n else {\n wordCloudTransforms.push({\n type: 'wordcloudShape',\n size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],\n shape: this._maskShape,\n postProjection: this._spec.postProjection ?? 'StereographicProjection',\n dataIndexKey: DEFAULT_DATA_KEY,\n text: { field: textField },\n fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],\n fontSizeRange: this._fontSizeRange,\n padding: this._fontPadding,\n rotateList: rotateAngles,\n fontFamily: this._fontFamilyField ?? this._spec.word?.style?.fontFamily ?? this._defaultFontFamily,\n fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,\n fontStyle: this._fontStyleField ?? this._spec.word?.style?.fontStyle,\n depth_3d: this._spec.depth_3d,\n\n fillingFontFamily:\n this._wordCloudShapeConfig?.fillingFontFamilyField ??\n this._spec.word?.style?.fontFamily ??\n this._defaultFontFamily,\n fillingPadding: this._fillingFontPadding,\n fillingFontStyle: this._wordCloudShapeConfig?.fillingFontStyleField ?? this._spec.word?.style?.fontStyle,\n fillingFontWeight: this._wordCloudShapeConfig?.fillingFontWeightField ?? this._spec.word?.style?.fontWeight, // 填充词fontWeight默认不跟随valueField\n fillingRotateList: fillingRotateAngles,\n\n fillingTimes: this._wordCloudShapeConfig?.fillingTimes,\n fillingXStep: this._wordCloudShapeConfig?.fillingXStep,\n fillingYStep: this._wordCloudShapeConfig?.fillingYStep,\n fillingXRatioStep: this._wordCloudShapeConfig?.fillingXRatioStep,\n fillingYRatioStep: this._wordCloudShapeConfig?.fillingYRatioStep,\n fillingInitialOpacity: this._wordCloudShapeConfig?.fillingInitialOpacity,\n fillingDeltaOpacity: this._wordCloudShapeConfig?.fillingDeltaOpacity,\n fillingInitialFontSize: this._wordCloudShapeConfig?.fillingInitialFontSize,\n fillingDeltaFontSize: this._wordCloudShapeConfig?.fillingDeltaFontSize,\n\n ratio: this._wordCloudShapeConfig?.ratio,\n fillingRatio: this._wordCloudShapeConfig?.fillingRatio,\n removeWhiteBorder: this._wordCloudShapeConfig?.removeWhiteBorder,\n textLayoutTimes: this._wordCloudShapeConfig?.textLayoutTimes,\n fontSizeShrinkFactor: this._wordCloudShapeConfig?.fontSizeShrinkFactor,\n stepFactor: this._wordCloudShapeConfig?.stepFactor,\n layoutMode: this._wordCloudShapeConfig?.layoutMode,\n importantWordCount: this._wordCloudShapeConfig?.importantWordCount,\n globalShinkLimit: this._wordCloudShapeConfig?.globalShinkLimit,\n fontSizeEnlargeFactor: this._wordCloudShapeConfig?.fontSizeEnlargeFactor,\n fillingDeltaFontSizeFactor: this._wordCloudShapeConfig?.fillingDeltaFontSizeFactor\n });\n }\n // 把transform挂载到data的product上\n this._data.getProduct().transform(wordCloudTransforms);\n }\n\n initMark(): void {\n this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {\n groupKey: this._seriesField,\n support3d: true,\n isSeriesMark: true\n }) as ITextMark;\n if (this._isWordCloudShape) {\n this._fillingWordMark = this._createMark(BaseWordCloudSeries.mark.fillingWord, {\n groupKey: this._seriesField,\n support3d: true,\n isSeriesMark: true\n }) as ITextMark;\n }\n }\n\n initMarkStyle() {\n const wordMark = this._wordMark;\n const fillingWordMark = this._fillingWordMark;\n if (wordMark) {\n this.setMarkStyle(\n wordMark,\n {\n fill: this._colorHexField\n ? (datum: Datum) => datum[this._colorHexField]\n : this.getWordColorAttribute(this._seriesField, false),\n text: (datum: Datum) => datum[this._nameField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n z: (datum: Datum) => datum.z ?? 0,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => !datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n this.setMarkStyle(\n wordMark,\n {\n fontFamily: this._spec.word?.style?.fontFamily ?? this._defaultFontFamily\n },\n 'normal',\n AttributeLevel.User_Mark\n );\n }\n if (fillingWordMark) {\n this.setMarkStyle(\n fillingWordMark,\n {\n fill: this._wordCloudShapeConfig.fillingColorHexField\n ? (datum: Datum) => datum[this._wordCloudShapeConfig.fillingColorHexField]\n : this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField, true),\n text: (datum: Datum) => datum[this._nameField],\n x: (datum: Datum) => datum.x,\n y: (datum: Datum) => datum.y,\n z: (datum: Datum) => datum.z ?? 0,\n fontFamily: (datum: Datum) => datum.fontFamily,\n fontSize: (datum: Datum) => datum.fontSize,\n fontStyle: (datum: Datum) => datum.fontStyle,\n fontWeight: (datum: Datum) => datum.fontWeight,\n angle: (datum: Datum) => datum.angle,\n visible: (datum: Datum) => datum.isFillingWord\n },\n 'normal',\n AttributeLevel.Series\n );\n this.setMarkStyle(\n fillingWordMark,\n {\n fontFamily: this._spec.word?.style?.fontFamily ?? this._defaultFontFamily\n },\n 'normal',\n AttributeLevel.User_Mark\n );\n }\n this._trigger.registerMark(wordMark);\n this._trigger.registerMark(fillingWordMark);\n }\n\n initAnimation() {\n if (this._wordMark) {\n this._wordMark.setAnimationConfig(\n animationConfig(\n Factory.getAnimationInKey('wordCloud3d')?.(() => {\n const srView = this.getCompiler().getVGrammarView();\n const width = srView.width() - this._padding?.left || 0 - this._padding?.right || 0;\n const height = srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0;\n const r = Math.max(width, height) / 2;\n return {\n center: { x: r, y: r, z: this._spec.depth_3d ?? r },\n r\n };\n }),\n userAnimationConfig(SeriesMarkNameEnum.word, this._spec, this._markAttributeContext)\n )\n );\n }\n if (this._fillingWordMark) {\n this._fillingWordMark.setAnimationConfig(\n animationConfig(\n Factory.getAnimationInKey('wordCloud3d')?.(() => {\n const srView = this.getCompiler().getVGrammarView();\n const width = srView.width() - this._padding?.left || 0 - this._padding?.right || 0;\n const height = srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0;\n const r = Math.max(width, height) / 2;\n return {\n center: { x: r, y: r, z: this._spec.depth_3d ?? r },\n r\n };\n }),\n userAnimationConfig(SeriesMarkNameEnum.fillingWord, this._spec, this._markAttributeContext)\n )\n );\n }\n }\n}\n\nexport const registerWordCloud3dSeries = () => {\n registerWordCloudTransforms();\n Factory.registerMark(TextMark.type, TextMark);\n Factory.registerSeries(WordCloud3dSeries.type, WordCloud3dSeries);\n registerWordCloud3dAnimation();\n};\n\nexport const registerWordCloudShape3dSeries = () => {\n registerWordCloudShapeTransforms();\n registerWordCloud3dSeries();\n};\n"]}
1
+ {"version":3,"sources":["../src/series/word-cloud/word-cloud-3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAkB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGvE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,MAAM,OAAO,iBAEX,SAAQ,mBAAsB;IAFhC;;QAIE,SAAI,GAAG,cAAc,CAAC,WAAW,CAAC;IAgGpC,CAAC;IA9FW,yBAAyB;;QACjC,uCACK,KAAK,CAAC,yBAAyB,EAAE,KACpC,cAAc,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,mCAAI,yBAAyB,EACtE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,IAC7B;IACJ,CAAC;IAES,8BAA8B;;QACtC,uCACK,KAAK,CAAC,8BAA8B,EAAE,KACzC,cAAc,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,mCAAI,yBAAyB,EACtE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,IAC7B;IACJ,CAAC;IAED,QAAQ;QACN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GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;gBACxE,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtC,OAAO;oBACL,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,mCAAI,CAAC,EAAE;oBACnD,CAAC;iBACF,CAAC;YACJ,CAAC,CAAC,EACF,mBAAmB,CAAC,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAC5F,CACF,CAAC;SACH;IACH,CAAC;;AAhGe,sBAAI,GAAW,cAAc,CAAC,WAAW,CAAC;AAmG5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,2BAA2B,EAAE,CAAC;IAC9B,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAClE,4BAA4B,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,gCAAgC,EAAE,CAAC;IACnC,yBAAyB,EAAE,CAAC;AAC9B,CAAC,CAAC","file":"word-cloud-3d.js","sourcesContent":["import { AttributeLevel } from '../../constant';\nimport { TextMark, type ITextMark } from '../../mark/text';\nimport { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface/type';\nimport type { IWordCloud3dSeriesSpec } from './interface';\nimport type { Datum } from '../../typings';\nimport { animationConfig, userAnimationConfig } from '../../animation/utils';\nimport { BaseWordCloudSeries } from './base';\nimport { Factory } from '../../core/factory';\nimport { registerWordCloud3dAnimation } from './animation';\nimport { registerWordCloudTransforms } from '@visactor/vgrammar-wordcloud';\nimport { registerWordCloudShapeTransforms } from '@visactor/vgrammar-wordcloud-shape';\n\nexport class WordCloud3dSeries<\n T extends IWordCloud3dSeriesSpec = IWordCloud3dSeriesSpec\n> extends BaseWordCloudSeries<T> {\n static readonly type: string = SeriesTypeEnum.wordCloud3d;\n type = SeriesTypeEnum.wordCloud3d;\n\n protected _wordCloudTransformOption() {\n return {\n ...super._wordCloudTransformOption(),\n postProjection: this._spec.postProjection ?? 'StereographicProjection',\n depth_3d: this._spec.depth_3d\n };\n }\n\n protected _wordCloudShapeTransformOption() {\n return {\n ...super._wordCloudShapeTransformOption(),\n postProjection: this._spec.postProjection ?? 'StereographicProjection',\n depth_3d: this._spec.depth_3d\n };\n }\n\n initMark(): void {\n this._wordMark = this._createMark(BaseWordCloudSeries.mark.word, {\n groupKey: this._seriesField,\n support3d: true,\n isSeriesMark: true\n }) as ITextMark;\n if (this._isWordCloudShape) {\n this._fillingWordMark = this._createMark(BaseWordCloudSeries.mark.fillingWord, {\n groupKey: this._seriesField,\n support3d: true,\n isSeriesMark: true\n }) as ITextMark;\n }\n }\n\n initMarkStyle() {\n super.initMarkStyle();\n const wordMark = this._wordMark;\n const fillingWordMark = this._fillingWordMark;\n if (wordMark) {\n this.setMarkStyle(\n wordMark,\n {\n z: (datum: Datum) => datum.z ?? 0\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n if (fillingWordMark) {\n this.setMarkStyle(\n fillingWordMark,\n {\n z: (datum: Datum) => datum.z ?? 0\n },\n 'normal',\n AttributeLevel.Series\n );\n }\n }\n\n initAnimation() {\n const padding = this._padding ?? {};\n if (this._wordMark) {\n this._wordMark.setAnimationConfig(\n animationConfig(\n Factory.getAnimationInKey('wordCloud3d')?.(() => {\n const srView = this.getCompiler().getVGrammarView();\n const width = srView.width() - padding.left || 0 - padding.right || 0;\n const height = srView.height() - padding.top || 0 - padding.bottom || 0;\n const r = Math.max(width, height) / 2;\n return {\n center: { x: r, y: r, z: this._spec.depth_3d ?? r },\n r\n };\n }),\n userAnimationConfig(SeriesMarkNameEnum.word, this._spec, this._markAttributeContext)\n )\n );\n }\n if (this._fillingWordMark) {\n this._fillingWordMark.setAnimationConfig(\n animationConfig(\n Factory.getAnimationInKey('wordCloud3d')?.(() => {\n const srView = this.getCompiler().getVGrammarView();\n const width = srView.width() - padding.left || 0 - padding.right || 0;\n const height = srView.height() - padding.top || 0 - padding.bottom || 0;\n const r = Math.max(width, height) / 2;\n return {\n center: { x: r, y: r, z: this._spec.depth_3d ?? r },\n r\n };\n }),\n userAnimationConfig(SeriesMarkNameEnum.fillingWord, this._spec, this._markAttributeContext)\n )\n );\n }\n }\n}\n\nexport const registerWordCloud3dSeries = () => {\n registerWordCloudTransforms();\n Factory.registerMark(TextMark.type, TextMark);\n Factory.registerSeries(WordCloud3dSeries.type, WordCloud3dSeries);\n registerWordCloud3dAnimation();\n};\n\nexport const registerWordCloudShape3dSeries = () => {\n registerWordCloudShapeTransforms();\n registerWordCloud3dSeries();\n};\n"]}
@@ -24,6 +24,7 @@ import type { ITreemapChartSpec } from '../../chart/treemap';
24
24
  import type { IWaterfallChartSpec } from '../../chart/waterfall';
25
25
  import type { ICorrelationChartSpec } from '../../chart/correlation';
26
26
  import type { IWordCloudChartSpec, IWordCloud3dChartSpec } from '../../chart/word-cloud';
27
+ import type { IChartSpec } from './common';
27
28
  export interface ChartSpecMap {
28
29
  readonly common: ICommonChartSpec;
29
30
  readonly area: IAreaChartSpec;
@@ -58,4 +59,4 @@ export interface ChartSpecMap {
58
59
  readonly heatmap: IHeatmapChartSpec;
59
60
  readonly correlation: ICorrelationChartSpec;
60
61
  }
61
- export type ISpec = ChartSpecMap[keyof ChartSpecMap];
62
+ export type ISpec = ChartSpecMap[keyof ChartSpecMap] | IChartSpec;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typings/spec/chart.ts"],"names":[],"mappings":"","file":"chart.js","sourcesContent":["import type { IAreaChartSpec } from '../../chart/area';\nimport type { IBarChartSpec, IBar3dChartSpec } from '../../chart/bar';\nimport type { IBoxPlotChartSpec } from '../../chart/box-plot';\nimport type { ICirclePackingChartSpec } from '../../chart/circle-packing';\nimport type { ICommonChartSpec } from '../../chart/common';\nimport type { IFunnelChartSpec, IFunnel3dChartSpec } from '../../chart/funnel';\nimport type { IGaugeChartSpec } from '../../chart/gauge';\nimport type { IHeatmapChartSpec } from '../../chart/heatmap';\nimport type { IHistogramChartSpec, IHistogram3dChartSpec } from '../../chart/histogram';\nimport type { ILineChartSpec } from '../../chart/line';\nimport type { IMapChartSpec } from '../../chart/map';\nimport type { IPieChartSpec, IPie3dChartSpec } from '../../chart/pie';\nimport type { ICircularProgressChartSpec } from '../../chart/progress/circular';\nimport type { ILinearProgressChartSpec } from '../../chart/progress/linear';\nimport type { IRadarChartSpec } from '../../chart/radar';\nimport type { IRangeAreaChartSpec } from '../../chart/range-area';\nimport type { IRangeColumnChartSpec, IRangeColumn3dChartSpec } from '../../chart/range-column';\nimport type { IRoseChartSpec } from '../../chart/rose';\nimport type { ISankeyChartSpec } from '../../chart/sankey';\nimport type { IScatterChartSpec } from '../../chart/scatter';\nimport type { ISequenceChartSpec } from '../../chart/sequence';\nimport type { ISunburstChartSpec } from '../../chart/sunburst';\nimport type { ITreemapChartSpec } from '../../chart/treemap';\nimport type { IWaterfallChartSpec } from '../../chart/waterfall';\nimport type { ICorrelationChartSpec } from '../../chart/correlation';\nimport type { IWordCloudChartSpec, IWordCloud3dChartSpec } from '../../chart/word-cloud';\n\nexport interface ChartSpecMap {\n readonly common: ICommonChartSpec;\n readonly area: IAreaChartSpec;\n readonly line: ILineChartSpec;\n readonly bar: IBarChartSpec;\n readonly bar3d: IBar3dChartSpec;\n readonly histogram: IHistogramChartSpec;\n readonly histogram3d: IHistogram3dChartSpec;\n readonly rangeColumn: IRangeColumnChartSpec;\n readonly rangeColumn3d: IRangeColumn3dChartSpec;\n readonly rangeArea: IRangeAreaChartSpec;\n readonly map: IMapChartSpec;\n readonly pie: IPieChartSpec;\n readonly pie3d: IPie3dChartSpec;\n readonly radar: IRadarChartSpec;\n readonly rose: IRoseChartSpec;\n readonly scatter: IScatterChartSpec;\n readonly sequence: ISequenceChartSpec;\n readonly circleProgress: ICircularProgressChartSpec;\n readonly linearProgress: ILinearProgressChartSpec;\n readonly wordCloud: IWordCloudChartSpec;\n readonly wordCloud3d: IWordCloud3dChartSpec;\n readonly funnel: IFunnelChartSpec;\n readonly funnel3d: IFunnel3dChartSpec;\n readonly waterfall: IWaterfallChartSpec;\n readonly boxplot: IBoxPlotChartSpec;\n readonly gauge: IGaugeChartSpec;\n readonly sankey: ISankeyChartSpec;\n readonly treemap: ITreemapChartSpec;\n readonly sunburst: ISunburstChartSpec;\n readonly circlePacking: ICirclePackingChartSpec;\n readonly heatmap: IHeatmapChartSpec;\n readonly correlation: ICorrelationChartSpec;\n}\n\nexport type ISpec = ChartSpecMap[keyof ChartSpecMap];\n"]}
1
+ {"version":3,"sources":["../src/typings/spec/chart.ts"],"names":[],"mappings":"","file":"chart.js","sourcesContent":["import type { IAreaChartSpec } from '../../chart/area';\nimport type { IBarChartSpec, IBar3dChartSpec } from '../../chart/bar';\nimport type { IBoxPlotChartSpec } from '../../chart/box-plot';\nimport type { ICirclePackingChartSpec } from '../../chart/circle-packing';\nimport type { ICommonChartSpec } from '../../chart/common';\nimport type { IFunnelChartSpec, IFunnel3dChartSpec } from '../../chart/funnel';\nimport type { IGaugeChartSpec } from '../../chart/gauge';\nimport type { IHeatmapChartSpec } from '../../chart/heatmap';\nimport type { IHistogramChartSpec, IHistogram3dChartSpec } from '../../chart/histogram';\nimport type { ILineChartSpec } from '../../chart/line';\nimport type { IMapChartSpec } from '../../chart/map';\nimport type { IPieChartSpec, IPie3dChartSpec } from '../../chart/pie';\nimport type { ICircularProgressChartSpec } from '../../chart/progress/circular';\nimport type { ILinearProgressChartSpec } from '../../chart/progress/linear';\nimport type { IRadarChartSpec } from '../../chart/radar';\nimport type { IRangeAreaChartSpec } from '../../chart/range-area';\nimport type { IRangeColumnChartSpec, IRangeColumn3dChartSpec } from '../../chart/range-column';\nimport type { IRoseChartSpec } from '../../chart/rose';\nimport type { ISankeyChartSpec } from '../../chart/sankey';\nimport type { IScatterChartSpec } from '../../chart/scatter';\nimport type { ISequenceChartSpec } from '../../chart/sequence';\nimport type { ISunburstChartSpec } from '../../chart/sunburst';\nimport type { ITreemapChartSpec } from '../../chart/treemap';\nimport type { IWaterfallChartSpec } from '../../chart/waterfall';\nimport type { ICorrelationChartSpec } from '../../chart/correlation';\nimport type { IWordCloudChartSpec, IWordCloud3dChartSpec } from '../../chart/word-cloud';\nimport type { IChartSpec } from './common';\n\nexport interface ChartSpecMap {\n readonly common: ICommonChartSpec;\n readonly area: IAreaChartSpec;\n readonly line: ILineChartSpec;\n readonly bar: IBarChartSpec;\n readonly bar3d: IBar3dChartSpec;\n readonly histogram: IHistogramChartSpec;\n readonly histogram3d: IHistogram3dChartSpec;\n readonly rangeColumn: IRangeColumnChartSpec;\n readonly rangeColumn3d: IRangeColumn3dChartSpec;\n readonly rangeArea: IRangeAreaChartSpec;\n readonly map: IMapChartSpec;\n readonly pie: IPieChartSpec;\n readonly pie3d: IPie3dChartSpec;\n readonly radar: IRadarChartSpec;\n readonly rose: IRoseChartSpec;\n readonly scatter: IScatterChartSpec;\n readonly sequence: ISequenceChartSpec;\n readonly circleProgress: ICircularProgressChartSpec;\n readonly linearProgress: ILinearProgressChartSpec;\n readonly wordCloud: IWordCloudChartSpec;\n readonly wordCloud3d: IWordCloud3dChartSpec;\n readonly funnel: IFunnelChartSpec;\n readonly funnel3d: IFunnel3dChartSpec;\n readonly waterfall: IWaterfallChartSpec;\n readonly boxplot: IBoxPlotChartSpec;\n readonly gauge: IGaugeChartSpec;\n readonly sankey: ISankeyChartSpec;\n readonly treemap: ITreemapChartSpec;\n readonly sunburst: ISunburstChartSpec;\n readonly circlePacking: ICirclePackingChartSpec;\n readonly heatmap: IHeatmapChartSpec;\n readonly correlation: ICorrelationChartSpec;\n}\n\nexport type ISpec = ChartSpecMap[keyof ChartSpecMap] | IChartSpec;\n"]}
@@ -2,3 +2,4 @@ import type { IRegion, ISeriesFilter } from '../region/interface';
2
2
  import type { ISeries } from '../series/interface';
3
3
  export declare function eachSeries(regions: IRegion[], callback: (s: ISeries) => boolean | void, filter?: ISeriesFilter): boolean;
4
4
  export declare function getSeries(regions: IRegion[], filter?: ISeriesFilter): ISeries[];
5
+ export declare const getFirstSeries: (regions: IRegion[], coordinateType?: 'cartesian' | 'polar') => ISeries;
package/esm/util/model.js CHANGED
@@ -12,4 +12,16 @@ export function getSeries(regions, filter) {
12
12
  for (const r of regions) for (const s of r.getSeries(filter)) result.push(s);
13
13
  return result;
14
14
  }
15
+
16
+ export const getFirstSeries = (regions, coordinateType) => {
17
+ for (let i = 0; i < regions.length; i++) {
18
+ const series = regions[i].getSeries();
19
+ for (let j = 0; j < series.length; j++) {
20
+ const s = series[j];
21
+ if (coordinateType && s && s.coordinate === coordinateType) return s;
22
+ if (!coordinateType && s) return s;
23
+ }
24
+ }
25
+ return null;
26
+ };
15
27
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,UAAU,UAAU,CAAC,OAAkB,EAAE,QAAwC,EAAE,MAAsB;IAC7G,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;QACpC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;YACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;gBACnC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBAChC,IAAI,IAAI,EAAE;oBACR,OAAO,IAAI,CAAC;iBACb;aACF;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAkB,EAAE,MAAsB;IAClE,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","file":"model.js","sourcesContent":["import type { IRegion, ISeriesFilter } from '../region/interface';\nimport type { ISeries } from '../series/interface';\nimport { isFunction } from './type';\n\nexport function eachSeries(regions: IRegion[], callback: (s: ISeries) => boolean | void, filter?: ISeriesFilter) {\n let flag = false;\n if (callback && isFunction(callback)) {\n for (const r of regions) {\n for (const s of r.getSeries(filter)) {\n flag = !!callback.call(null, s);\n if (flag) {\n return flag;\n }\n }\n }\n }\n return flag;\n}\n\nexport function getSeries(regions: IRegion[], filter?: ISeriesFilter) {\n const result: ISeries[] = [];\n for (const r of regions) {\n for (const s of r.getSeries(filter)) {\n result.push(s);\n }\n }\n return result;\n}\n"]}
1
+ {"version":3,"sources":["../src/util/model.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,UAAU,UAAU,CAAC,OAAkB,EAAE,QAAwC,EAAE,MAAsB;IAC7G,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;QACpC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;YACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;gBACnC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBAChC,IAAI,IAAI,EAAE;oBACR,OAAO,IAAI,CAAC;iBACb;aACF;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAkB,EAAE,MAAsB;IAClE,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAkB,EAAE,cAAsC,EAAE,EAAE;IAC3F,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,cAAc,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,cAAc,EAAE;gBAC1D,OAAO,CAAC,CAAC;aACV;YACD,IAAI,CAAC,cAAc,IAAI,CAAC,EAAE;gBACxB,OAAO,CAAC,CAAC;aACV;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","file":"model.js","sourcesContent":["import type { IChart } from '../chart/interface';\nimport type { IRegion, ISeriesFilter } from '../region/interface';\nimport type { ISeries } from '../series/interface';\nimport { isFunction } from './type';\n\nexport function eachSeries(regions: IRegion[], callback: (s: ISeries) => boolean | void, filter?: ISeriesFilter) {\n let flag = false;\n if (callback && isFunction(callback)) {\n for (const r of regions) {\n for (const s of r.getSeries(filter)) {\n flag = !!callback.call(null, s);\n if (flag) {\n return flag;\n }\n }\n }\n }\n return flag;\n}\n\nexport function getSeries(regions: IRegion[], filter?: ISeriesFilter) {\n const result: ISeries[] = [];\n for (const r of regions) {\n for (const s of r.getSeries(filter)) {\n result.push(s);\n }\n }\n return result;\n}\n\nexport const getFirstSeries = (regions: IRegion[], coordinateType?: 'cartesian' | 'polar') => {\n for (let i = 0; i < regions.length; i++) {\n const r = regions[i];\n const series = r.getSeries();\n for (let j = 0; j < series.length; j++) {\n const s = series[j];\n if (coordinateType && s && s.coordinate === coordinateType) {\n return s;\n }\n if (!coordinateType && s) {\n return s;\n }\n }\n }\n return null;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vchart",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "charts lib based @visactor/VGrammar",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -75,18 +75,18 @@
75
75
  "canvas": "2.11.2",
76
76
  "size-limit": "9.0.0",
77
77
  "@size-limit/file": "9.0.0",
78
- "@internal/typescript-json-schema": "0.0.1",
79
78
  "@internal/bundler": "0.0.1",
79
+ "@internal/typescript-json-schema": "0.0.1",
80
80
  "@internal/eslint-config": "0.0.1",
81
81
  "@internal/ts-config": "0.0.1"
82
82
  },
83
83
  "dependencies": {
84
- "@visactor/vutils": "~0.17.1",
85
- "@visactor/vdataset": "~0.17.1",
86
- "@visactor/vscale": "~0.17.1",
87
- "@visactor/vrender-core": "~0.16.19",
88
- "@visactor/vrender-kits": "~0.16.19",
89
- "@visactor/vrender-components": "~0.16.19",
84
+ "@visactor/vutils": "~0.16.19",
85
+ "@visactor/vdataset": "~0.16.19",
86
+ "@visactor/vscale": "~0.16.19",
87
+ "@visactor/vrender-core": "~0.16.21",
88
+ "@visactor/vrender-kits": "~0.16.21",
89
+ "@visactor/vrender-components": "~0.16.21",
90
90
  "@visactor/vgrammar-core": "~0.9.4",
91
91
  "@visactor/vgrammar-projection": "~0.9.4",
92
92
  "@visactor/vgrammar-wordcloud": "~0.9.4",
@@ -94,7 +94,7 @@
94
94
  "@visactor/vgrammar-hierarchy": "~0.9.4",
95
95
  "@visactor/vgrammar-sankey": "~0.9.4",
96
96
  "@visactor/vgrammar-util": "~0.9.4",
97
- "@visactor/vutils-extension": "1.7.4"
97
+ "@visactor/vutils-extension": "1.7.5"
98
98
  },
99
99
  "publishConfig": {
100
100
  "access": "public",