@visactor/vchart 1.7.3 → 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.
- package/build/es5/index.js +1 -1
- package/build/index.js +29779 -32796
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base-chart.js +3 -2
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +5 -2
- package/cjs/component/axis/base-axis.js +41 -14
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +2 -1
- package/cjs/component/axis/cartesian/axis.js +10 -28
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/time-axis.js +9 -17
- package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +11 -15
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +2 -0
- package/cjs/component/axis/polar/axis.js +10 -26
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/brush/brush.js +2 -3
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +26 -24
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/geo/projection.js +10 -6
- package/cjs/component/geo/projection.js.map +1 -1
- package/cjs/component/label/label.d.ts +2 -1
- package/cjs/component/label/label.js +13 -8
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/util.d.ts +1 -8
- package/cjs/component/label/util.js +6 -11
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/marker/base-marker.js +4 -10
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +16 -15
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js +22 -21
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js +30 -26
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/constant/index.d.ts +2 -1
- package/cjs/constant/index.js +1 -1
- package/cjs/constant/index.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.js +5 -17
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/common.d.ts +1 -0
- package/cjs/event/events/dimension/util/common.js +9 -1
- package/cjs/event/events/dimension/util/common.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.js +4 -17
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/event/events/index.d.ts +1 -0
- package/cjs/event/events/index.js +16 -1
- package/cjs/event/events/index.js.map +1 -1
- package/cjs/event/index.d.ts +2 -0
- package/cjs/event/index.js +21 -0
- package/cjs/event/index.js.map +1 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interaction/interface.js +1 -1
- package/cjs/region/interface.d.ts +1 -0
- package/cjs/region/interface.js.map +1 -1
- package/cjs/region/region.d.ts +3 -0
- package/cjs/region/region.js +26 -14
- package/cjs/region/region.js.map +1 -1
- package/cjs/series/area/area.js +8 -8
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/area/interface.d.ts +2 -2
- package/cjs/series/area/interface.js.map +1 -1
- package/cjs/series/bar/bar.js +3 -3
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/bar/interface.d.ts +2 -2
- package/cjs/series/bar/interface.js.map +1 -1
- package/cjs/series/base/base-series.js +2 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/circle-packing/circle-packing.js +2 -2
- package/cjs/series/circle-packing/circle-packing.js.map +1 -1
- package/cjs/series/correlation/correlation.js +30 -26
- package/cjs/series/correlation/correlation.js.map +1 -1
- package/cjs/series/dot/dot.js +2 -2
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/funnel/funnel.js +8 -8
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/line/interface.d.ts +2 -2
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/mixin/line-mixin.js +1 -0
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +2 -0
- package/cjs/series/pie/pie.js +29 -23
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/rose/rose.d.ts +3 -0
- package/cjs/series/rose/rose.js +15 -2
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/sankey.js +8 -7
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/interface.d.ts +2 -2
- package/cjs/series/scatter/interface.js.map +1 -1
- package/cjs/series/waterfall/waterfall.js +2 -2
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/cjs/series/word-cloud/base.d.ts +3 -0
- package/cjs/series/word-cloud/base.js +86 -73
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.d.ts +22 -1
- package/cjs/series/word-cloud/word-cloud-3d.js +29 -148
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/typings/spec/chart.d.ts +2 -1
- package/cjs/typings/spec/chart.js.map +1 -1
- package/cjs/util/model.d.ts +1 -0
- package/cjs/util/model.js +15 -1
- package/cjs/util/model.js.map +1 -1
- package/esm/chart/base-chart.js +3 -2
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +5 -2
- package/esm/component/axis/base-axis.js +47 -13
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +2 -1
- package/esm/component/axis/cartesian/axis.js +9 -34
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/time-axis.js +9 -17
- package/esm/component/axis/cartesian/time-axis.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +7 -5
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +2 -0
- package/esm/component/axis/polar/axis.js +9 -32
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/brush/brush.js +2 -3
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +26 -24
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/geo/projection.js +10 -6
- package/esm/component/geo/projection.js.map +1 -1
- package/esm/component/label/label.d.ts +2 -1
- package/esm/component/label/label.js +12 -8
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/util.d.ts +1 -8
- package/esm/component/label/util.js +2 -8
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/marker/base-marker.js +5 -9
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +16 -15
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js +22 -21
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js +30 -26
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/constant/index.d.ts +2 -1
- package/esm/constant/index.js +1 -1
- package/esm/constant/index.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.js +7 -18
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/common.d.ts +1 -0
- package/esm/event/events/dimension/util/common.js +5 -0
- package/esm/event/events/dimension/util/common.js.map +1 -1
- package/esm/event/events/dimension/util/polar.js +6 -17
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/event/events/index.d.ts +1 -0
- package/esm/event/events/index.js +2 -0
- package/esm/event/events/index.js.map +1 -1
- package/esm/event/index.d.ts +2 -0
- package/esm/event/index.js +4 -0
- package/esm/event/index.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/interaction/interface.js +1 -1
- package/esm/region/interface.d.ts +1 -0
- package/esm/region/interface.js.map +1 -1
- package/esm/region/region.d.ts +3 -0
- package/esm/region/region.js +26 -14
- package/esm/region/region.js.map +1 -1
- package/esm/series/area/area.js +8 -8
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/area/interface.d.ts +2 -2
- package/esm/series/area/interface.js.map +1 -1
- package/esm/series/bar/bar.js +3 -3
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/bar/interface.d.ts +2 -2
- package/esm/series/bar/interface.js.map +1 -1
- package/esm/series/base/base-series.js +2 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/circle-packing/circle-packing.js +2 -2
- package/esm/series/circle-packing/circle-packing.js.map +1 -1
- package/esm/series/correlation/correlation.js +30 -26
- package/esm/series/correlation/correlation.js.map +1 -1
- package/esm/series/dot/dot.js +2 -2
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/funnel/funnel.js +8 -8
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/line/interface.d.ts +2 -2
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/mixin/line-mixin.js +1 -0
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/pie.d.ts +2 -0
- package/esm/series/pie/pie.js +26 -19
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/rose/rose.d.ts +3 -0
- package/esm/series/rose/rose.js +15 -2
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/sankey.js +8 -7
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/interface.d.ts +2 -2
- package/esm/series/scatter/interface.js.map +1 -1
- package/esm/series/waterfall/waterfall.js +1 -3
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/esm/series/word-cloud/base.d.ts +3 -0
- package/esm/series/word-cloud/base.js +86 -73
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.d.ts +22 -1
- package/esm/series/word-cloud/word-cloud-3d.js +29 -153
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/typings/spec/chart.d.ts +2 -1
- package/esm/typings/spec/chart.js.map +1 -1
- package/esm/util/model.d.ts +1 -0
- package/esm/util/model.js +12 -0
- package/esm/util/model.js.map +1 -1
- package/package.json +9 -9
|
@@ -4,120 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.registerWordCloudShape3dSeries = exports.registerWordCloud3dSeries = exports.WordCloud3dSeries = void 0;
|
|
6
6
|
|
|
7
|
-
const constant_1 = require("../../constant"), text_1 = require("../../mark/text"), type_1 = require("../interface/type"), utils_1 = require("../../animation/utils"),
|
|
7
|
+
const constant_1 = require("../../constant"), text_1 = require("../../mark/text"), type_1 = require("../interface/type"), utils_1 = require("../../animation/utils"), base_1 = require("./base"), factory_1 = require("../../core/factory"), animation_1 = require("./animation"), vgrammar_wordcloud_1 = require("@visactor/vgrammar-wordcloud"), vgrammar_wordcloud_shape_1 = require("@visactor/vgrammar-wordcloud-shape");
|
|
8
8
|
|
|
9
9
|
class WordCloud3dSeries extends base_1.BaseWordCloudSeries {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments), this.type = type_1.SeriesTypeEnum.wordCloud3d;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
var _a
|
|
15
|
-
super.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
wordCloudTransforms.push({
|
|
26
|
-
type: "map",
|
|
27
|
-
as: word_cloud_1.WORD_CLOUD_ANGLE,
|
|
28
|
-
callback: () => rotateAngles[Math.floor(Math.random() * rotateAngles.length)]
|
|
29
|
-
}), wordCloudTransforms.push({
|
|
30
|
-
type: "map",
|
|
31
|
-
as: word_cloud_1.WORD_CLOUD_FILLING_ANGLE,
|
|
32
|
-
callback: () => fillingRotateAngles[Math.floor(Math.random() * fillingRotateAngles.length)]
|
|
33
|
-
}), (null === (_b = this._spec.word) || void 0 === _b ? void 0 : _b.formatMethod) && wordCloudTransforms.push({
|
|
34
|
-
type: "map",
|
|
35
|
-
as: word_cloud_1.WORD_CLOUD_TEXT,
|
|
36
|
-
callback: this._spec.word.formatMethod
|
|
13
|
+
_wordCloudTransformOption() {
|
|
14
|
+
var _a;
|
|
15
|
+
return Object.assign(Object.assign({}, super._wordCloudTransformOption()), {
|
|
16
|
+
postProjection: null !== (_a = this._spec.postProjection) && void 0 !== _a ? _a : "StereographicProjection",
|
|
17
|
+
depth_3d: this._spec.depth_3d
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
_wordCloudShapeTransformOption() {
|
|
21
|
+
var _a;
|
|
22
|
+
return Object.assign(Object.assign({}, super._wordCloudShapeTransformOption()), {
|
|
23
|
+
postProjection: null !== (_a = this._spec.postProjection) && void 0 !== _a ? _a : "StereographicProjection",
|
|
24
|
+
depth_3d: this._spec.depth_3d
|
|
37
25
|
});
|
|
38
|
-
const textField = (null === (_c = this._spec.word) || void 0 === _c ? void 0 : _c.formatMethod) ? word_cloud_1.WORD_CLOUD_TEXT : this._nameField;
|
|
39
|
-
this._isWordCloudShape ? wordCloudTransforms.push({
|
|
40
|
-
type: "wordcloudShape",
|
|
41
|
-
size: [ this._region.getLayoutRect().width, this._region.getLayoutRect().height ],
|
|
42
|
-
shape: this._maskShape,
|
|
43
|
-
postProjection: null !== (_m = this._spec.postProjection) && void 0 !== _m ? _m : "StereographicProjection",
|
|
44
|
-
dataIndexKey: constant_1.DEFAULT_DATA_KEY,
|
|
45
|
-
text: {
|
|
46
|
-
field: textField
|
|
47
|
-
},
|
|
48
|
-
fontSize: valueField ? {
|
|
49
|
-
field: valueField
|
|
50
|
-
} : this._fontSizeRange[0],
|
|
51
|
-
fontSizeRange: this._fontSizeRange,
|
|
52
|
-
padding: this._fontPadding,
|
|
53
|
-
rotateList: rotateAngles,
|
|
54
|
-
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,
|
|
55
|
-
fontWeight: fontWeightField ? {
|
|
56
|
-
field: fontWeightField
|
|
57
|
-
} : valueField ? {
|
|
58
|
-
field: word_cloud_1.WORD_CLOUD_WEIGHT
|
|
59
|
-
} : null,
|
|
60
|
-
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,
|
|
61
|
-
depth_3d: this._spec.depth_3d,
|
|
62
|
-
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,
|
|
63
|
-
fillingPadding: this._fillingFontPadding,
|
|
64
|
-
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,
|
|
65
|
-
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,
|
|
66
|
-
fillingRotateList: fillingRotateAngles,
|
|
67
|
-
fillingTimes: null === (_8 = this._wordCloudShapeConfig) || void 0 === _8 ? void 0 : _8.fillingTimes,
|
|
68
|
-
fillingXStep: null === (_9 = this._wordCloudShapeConfig) || void 0 === _9 ? void 0 : _9.fillingXStep,
|
|
69
|
-
fillingYStep: null === (_10 = this._wordCloudShapeConfig) || void 0 === _10 ? void 0 : _10.fillingYStep,
|
|
70
|
-
fillingXRatioStep: null === (_11 = this._wordCloudShapeConfig) || void 0 === _11 ? void 0 : _11.fillingXRatioStep,
|
|
71
|
-
fillingYRatioStep: null === (_12 = this._wordCloudShapeConfig) || void 0 === _12 ? void 0 : _12.fillingYRatioStep,
|
|
72
|
-
fillingInitialOpacity: null === (_13 = this._wordCloudShapeConfig) || void 0 === _13 ? void 0 : _13.fillingInitialOpacity,
|
|
73
|
-
fillingDeltaOpacity: null === (_14 = this._wordCloudShapeConfig) || void 0 === _14 ? void 0 : _14.fillingDeltaOpacity,
|
|
74
|
-
fillingInitialFontSize: null === (_15 = this._wordCloudShapeConfig) || void 0 === _15 ? void 0 : _15.fillingInitialFontSize,
|
|
75
|
-
fillingDeltaFontSize: null === (_16 = this._wordCloudShapeConfig) || void 0 === _16 ? void 0 : _16.fillingDeltaFontSize,
|
|
76
|
-
ratio: null === (_17 = this._wordCloudShapeConfig) || void 0 === _17 ? void 0 : _17.ratio,
|
|
77
|
-
fillingRatio: null === (_18 = this._wordCloudShapeConfig) || void 0 === _18 ? void 0 : _18.fillingRatio,
|
|
78
|
-
removeWhiteBorder: null === (_19 = this._wordCloudShapeConfig) || void 0 === _19 ? void 0 : _19.removeWhiteBorder,
|
|
79
|
-
textLayoutTimes: null === (_20 = this._wordCloudShapeConfig) || void 0 === _20 ? void 0 : _20.textLayoutTimes,
|
|
80
|
-
fontSizeShrinkFactor: null === (_21 = this._wordCloudShapeConfig) || void 0 === _21 ? void 0 : _21.fontSizeShrinkFactor,
|
|
81
|
-
stepFactor: null === (_22 = this._wordCloudShapeConfig) || void 0 === _22 ? void 0 : _22.stepFactor,
|
|
82
|
-
layoutMode: null === (_23 = this._wordCloudShapeConfig) || void 0 === _23 ? void 0 : _23.layoutMode,
|
|
83
|
-
importantWordCount: null === (_24 = this._wordCloudShapeConfig) || void 0 === _24 ? void 0 : _24.importantWordCount,
|
|
84
|
-
globalShinkLimit: null === (_25 = this._wordCloudShapeConfig) || void 0 === _25 ? void 0 : _25.globalShinkLimit,
|
|
85
|
-
fontSizeEnlargeFactor: null === (_26 = this._wordCloudShapeConfig) || void 0 === _26 ? void 0 : _26.fontSizeEnlargeFactor,
|
|
86
|
-
fillingDeltaFontSizeFactor: null === (_27 = this._wordCloudShapeConfig) || void 0 === _27 ? void 0 : _27.fillingDeltaFontSizeFactor
|
|
87
|
-
}) : (wordCloudTransforms.push({
|
|
88
|
-
type: "wordcloud",
|
|
89
|
-
layoutType: this._wordCloudConfig.layoutMode,
|
|
90
|
-
size: [ this._region.getLayoutRect().width, this._region.getLayoutRect().height ],
|
|
91
|
-
shape: this._maskShape,
|
|
92
|
-
postProjection: null !== (_d = this._spec.postProjection) && void 0 !== _d ? _d : "StereographicProjection",
|
|
93
|
-
dataIndexKey: constant_1.DEFAULT_DATA_KEY,
|
|
94
|
-
text: {
|
|
95
|
-
field: textField
|
|
96
|
-
},
|
|
97
|
-
fontSize: valueField ? {
|
|
98
|
-
field: valueField
|
|
99
|
-
} : this._fontSizeRange[0],
|
|
100
|
-
fontSizeRange: this._fontSizeRange,
|
|
101
|
-
padding: this._fontPadding,
|
|
102
|
-
rotate: {
|
|
103
|
-
field: word_cloud_1.WORD_CLOUD_ANGLE
|
|
104
|
-
},
|
|
105
|
-
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,
|
|
106
|
-
fontWeight: fontWeightField ? {
|
|
107
|
-
field: fontWeightField
|
|
108
|
-
} : valueField ? {
|
|
109
|
-
field: word_cloud_1.WORD_CLOUD_WEIGHT
|
|
110
|
-
} : null,
|
|
111
|
-
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,
|
|
112
|
-
depth_3d: this._spec.depth_3d,
|
|
113
|
-
randomVisible: this._random,
|
|
114
|
-
clip: "clip" === this._wordCloudConfig.drawOutOfBound,
|
|
115
|
-
shrink: this._wordCloudConfig.zoomToFit.shrink,
|
|
116
|
-
enlarge: this._wordCloudConfig.zoomToFit.enlarge,
|
|
117
|
-
minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin,
|
|
118
|
-
progressiveTime: this._wordCloudConfig.progressiveTime,
|
|
119
|
-
progressiveStep: this._wordCloudConfig.progressiveStep
|
|
120
|
-
}), this._wordMark.getProduct().transform(wordCloudTransforms)), this._data.getProduct().transform(wordCloudTransforms);
|
|
121
26
|
}
|
|
122
27
|
initMark() {
|
|
123
28
|
this._wordMark = this._createMark(base_1.BaseWordCloudSeries.mark.word, {
|
|
@@ -131,67 +36,43 @@ class WordCloud3dSeries extends base_1.BaseWordCloudSeries {
|
|
|
131
36
|
}));
|
|
132
37
|
}
|
|
133
38
|
initMarkStyle() {
|
|
134
|
-
|
|
39
|
+
super.initMarkStyle();
|
|
135
40
|
const wordMark = this._wordMark, fillingWordMark = this._fillingWordMark;
|
|
136
|
-
wordMark &&
|
|
137
|
-
fill: this._colorHexField ? datum => datum[this._colorHexField] : this.getWordColorAttribute(this._seriesField, !1),
|
|
138
|
-
text: datum => datum[this._nameField],
|
|
139
|
-
x: datum => datum.x,
|
|
140
|
-
y: datum => datum.y,
|
|
41
|
+
wordMark && this.setMarkStyle(wordMark, {
|
|
141
42
|
z: datum => {
|
|
142
43
|
var _a;
|
|
143
44
|
return null !== (_a = datum.z) && void 0 !== _a ? _a : 0;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
fontSize: datum => datum.fontSize,
|
|
147
|
-
fontStyle: datum => datum.fontStyle,
|
|
148
|
-
fontWeight: datum => datum.fontWeight,
|
|
149
|
-
angle: datum => datum.angle,
|
|
150
|
-
visible: datum => !datum.isFillingWord
|
|
151
|
-
}, "normal", constant_1.AttributeLevel.Series), this.setMarkStyle(wordMark, {
|
|
152
|
-
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
|
|
153
|
-
}, "normal", constant_1.AttributeLevel.User_Mark)), fillingWordMark && (this.setMarkStyle(fillingWordMark, {
|
|
154
|
-
fill: this._wordCloudShapeConfig.fillingColorHexField ? datum => datum[this._wordCloudShapeConfig.fillingColorHexField] : this.getWordColorAttribute(this._wordCloudShapeConfig.fillingSeriesField, !0),
|
|
155
|
-
text: datum => datum[this._nameField],
|
|
156
|
-
x: datum => datum.x,
|
|
157
|
-
y: datum => datum.y,
|
|
45
|
+
}
|
|
46
|
+
}, "normal", constant_1.AttributeLevel.Series), fillingWordMark && this.setMarkStyle(fillingWordMark, {
|
|
158
47
|
z: datum => {
|
|
159
48
|
var _a;
|
|
160
49
|
return null !== (_a = datum.z) && void 0 !== _a ? _a : 0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
fontSize: datum => datum.fontSize,
|
|
164
|
-
fontStyle: datum => datum.fontStyle,
|
|
165
|
-
fontWeight: datum => datum.fontWeight,
|
|
166
|
-
angle: datum => datum.angle,
|
|
167
|
-
visible: datum => datum.isFillingWord
|
|
168
|
-
}, "normal", constant_1.AttributeLevel.Series), this.setMarkStyle(fillingWordMark, {
|
|
169
|
-
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
|
|
170
|
-
}, "normal", constant_1.AttributeLevel.User_Mark)), this._trigger.registerMark(wordMark),
|
|
171
|
-
this._trigger.registerMark(fillingWordMark);
|
|
50
|
+
}
|
|
51
|
+
}, "normal", constant_1.AttributeLevel.Series);
|
|
172
52
|
}
|
|
173
53
|
initAnimation() {
|
|
174
|
-
var _a, _b;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
54
|
+
var _a, _b, _c;
|
|
55
|
+
const padding = null !== (_a = this._padding) && void 0 !== _a ? _a : {};
|
|
56
|
+
this._wordMark && this._wordMark.setAnimationConfig((0, utils_1.animationConfig)(null === (_b = factory_1.Factory.getAnimationInKey("wordCloud3d")) || void 0 === _b ? void 0 : _b((() => {
|
|
57
|
+
var _a;
|
|
58
|
+
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;
|
|
178
59
|
return {
|
|
179
60
|
center: {
|
|
180
61
|
x: r,
|
|
181
62
|
y: r,
|
|
182
|
-
z: null !== (
|
|
63
|
+
z: null !== (_a = this._spec.depth_3d) && void 0 !== _a ? _a : r
|
|
183
64
|
},
|
|
184
65
|
r: r
|
|
185
66
|
};
|
|
186
67
|
})), (0, utils_1.userAnimationConfig)(type_1.SeriesMarkNameEnum.word, this._spec, this._markAttributeContext))),
|
|
187
|
-
this._fillingWordMark && this._fillingWordMark.setAnimationConfig((0, utils_1.animationConfig)(null === (
|
|
188
|
-
var _a
|
|
189
|
-
const srView = this.getCompiler().getVGrammarView(), width = srView.width() -
|
|
68
|
+
this._fillingWordMark && this._fillingWordMark.setAnimationConfig((0, utils_1.animationConfig)(null === (_c = factory_1.Factory.getAnimationInKey("wordCloud3d")) || void 0 === _c ? void 0 : _c((() => {
|
|
69
|
+
var _a;
|
|
70
|
+
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;
|
|
190
71
|
return {
|
|
191
72
|
center: {
|
|
192
73
|
x: r,
|
|
193
74
|
y: r,
|
|
194
|
-
z: null !== (
|
|
75
|
+
z: null !== (_a = this._spec.depth_3d) && void 0 !== _a ? _a : r
|
|
195
76
|
},
|
|
196
77
|
r: r
|
|
197
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/series/word-cloud/word-cloud-3d.ts"],"names":[],"mappings":";;;AAAA,6CAAkE;AAClE,0CAA2D;AAC3D,4CAAuE;AAGvE,iDAA6E;AAC7E,6CAA+C;AAC/C,2DAAiD;AACjD,0DAKmC;AAEnC,iCAA6C;AAC7C,gDAA6C;AAC7C,2CAA2D;AAC3D,qEAA2E;AAC3E,iFAAsF;AAEtF,MAAa,iBAEX,SAAQ,0BAAsB;IAFhC;;QAIE,SAAI,GAAG,qBAAc,CAAC,WAAW,CAAC;IAkQpC,CAAC;IAhQC,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,MAAM,mBAAmB,GAAU,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,oBAAW,EAAE,CAAC;QACrC,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC9C,MAAM,mBAAmB,GAAG,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAAC;QAG3E,IAAI,UAAU,EAAE;YACd,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,IAAA,sBAAM,EAAC,MAAA,IAAI,CAAC,WAAW,EAAE,0CAAE,UAAU,CAAC,GAAG,CAAC,CAAC,KAAU,E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G,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,IAAA,2BAAmB,EAAC,yBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAC5F,CACF,CAAC;SACH;IACH,CAAC;;AArQH,8CAsQC;AAnQiB,sBAAI,GAAW,qBAAc,CAAC,WAAW,CAAC;AAqQrD,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,gDAA2B,GAAE,CAAC;IAC9B,iBAAO,CAAC,YAAY,CAAC,eAAQ,CAAC,IAAI,EAAE,eAAQ,CAAC,CAAC;IAC9C,iBAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAClE,IAAA,wCAA4B,GAAE,CAAC;AACjC,CAAC,CAAC;AALW,QAAA,yBAAyB,6BAKpC;AAEK,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,IAAA,2DAAgC,GAAE,CAAC;IACnC,IAAA,iCAAyB,GAAE,CAAC;AAC9B,CAAC,CAAC;AAHW,QAAA,8BAA8B,kCAGzC","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,6CAAgD;AAChD,0CAA2D;AAC3D,4CAAuE;AAGvE,iDAA6E;AAC7E,iCAA6C;AAC7C,gDAA6C;AAC7C,2CAA2D;AAC3D,qEAA2E;AAC3E,iFAAsF;AAEtF,MAAa,iBAEX,SAAQ,0BAAsB;IAFhC;;QAIE,SAAI,GAAG,qBAAc,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,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,0BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE;YAC/D,QAAQ,EAAE,IAAI,CAAC,YAAY;YAC3B,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,IAAI;SACnB,CAAc,CAAC;QAChB,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,0BAAmB,CAAC,IAAI,CAAC,WAAW,EAAE;gBAC7E,QAAQ,EAAE,IAAI,CAAC,YAAY;gBAC3B,SAAS,EAAE,IAAI;gBACf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,yBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAC5F,CACF,CAAC;SACH;IACH,CAAC;;AAnGH,8CAoGC;AAjGiB,sBAAI,GAAW,qBAAc,CAAC,WAAW,CAAC;AAmGrD,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAA,gDAA2B,GAAE,CAAC;IAC9B,iBAAO,CAAC,YAAY,CAAC,eAAQ,CAAC,IAAI,EAAE,eAAQ,CAAC,CAAC;IAC9C,iBAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAClE,IAAA,wCAA4B,GAAE,CAAC;AACjC,CAAC,CAAC;AALW,QAAA,yBAAyB,6BAKpC;AAEK,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,IAAA,2DAAgC,GAAE,CAAC;IACnC,IAAA,iCAAyB,GAAE,CAAC;AAC9B,CAAC,CAAC;AAHW,QAAA,8BAA8B,kCAGzC","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"]}
|
package/cjs/util/model.d.ts
CHANGED
|
@@ -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/cjs/util/model.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.getSeries = exports.eachSeries = void 0;
|
|
5
|
+
}), exports.getFirstSeries = exports.getSeries = exports.eachSeries = void 0;
|
|
6
6
|
|
|
7
7
|
const type_1 = require("./type");
|
|
8
8
|
|
|
@@ -20,4 +20,18 @@ function getSeries(regions, filter) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
exports.eachSeries = eachSeries, exports.getSeries = getSeries;
|
|
23
|
+
|
|
24
|
+
const getFirstSeries = (regions, coordinateType) => {
|
|
25
|
+
for (let i = 0; i < regions.length; i++) {
|
|
26
|
+
const series = regions[i].getSeries();
|
|
27
|
+
for (let j = 0; j < series.length; j++) {
|
|
28
|
+
const s = series[j];
|
|
29
|
+
if (coordinateType && s && s.coordinate === coordinateType) return s;
|
|
30
|
+
if (!coordinateType && s) return s;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.getFirstSeries = getFirstSeries;
|
|
23
37
|
//# sourceMappingURL=model.js.map
|
package/cjs/util/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/util/model.ts"],"names":[],"mappings":";;;AAGA,iCAAoC;AAEpC,SAAgB,UAAU,CAAC,OAAkB,EAAE,QAAwC,EAAE,MAAsB;IAC7G,IAAI,IAAI,GAAG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AAC,cAAc,IAAI,CAAC,EAAE;gBACxB,OAAO,CAAC,CAAC;aACV;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB","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/esm/chart/base-chart.js
CHANGED
|
@@ -482,7 +482,8 @@ export class BaseChart extends CompilableBase {
|
|
|
482
482
|
progressiveThreshold: spec.progressiveThreshold,
|
|
483
483
|
background: spec.seriesBackground,
|
|
484
484
|
invalidType: spec.invalidType,
|
|
485
|
-
seriesField: spec.seriesField
|
|
485
|
+
seriesField: spec.seriesField,
|
|
486
|
+
morph: spec.morph
|
|
486
487
|
};
|
|
487
488
|
}
|
|
488
489
|
_updateLayoutRect(viewBox) {
|
|
@@ -511,7 +512,7 @@ export class BaseChart extends CompilableBase {
|
|
|
511
512
|
reMake: !1
|
|
512
513
|
}, this._spec), this.setLayoutTag(!0, null, !1), this.transformSpec(this._spec),
|
|
513
514
|
this.updateGlobalScaleTheme(), this._regions.forEach((r => r.setCurrentTheme())),
|
|
514
|
-
this.
|
|
515
|
+
this._series.forEach((s => s.setCurrentTheme())), this._components.forEach((c => c.setCurrentTheme()));
|
|
515
516
|
}
|
|
516
517
|
clear() {
|
|
517
518
|
this.getAllModels().forEach((i => {
|