@visactor/vchart 2.0.15 → 2.0.16
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.es.js +147 -58
- package/build/index.js +147 -58
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.js +1 -2
- package/cjs/animation/index.js +2 -1
- package/cjs/compile/util.js +1 -2
- package/cjs/component/marker/mark-point/base-mark-point.js +21 -21
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/component/util.js +2 -1
- package/cjs/constant/gradient.js +1 -2
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -1
- package/cjs/constant/word-cloud.js +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/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/series/word-cloud/base.d.ts +2 -0
- package/cjs/series/word-cloud/base.js +13 -4
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/measure-cache.d.ts +19 -0
- package/cjs/series/word-cloud/measure-cache.js +33 -0
- package/cjs/series/word-cloud/measure-cache.js.map +1 -0
- package/cjs/typings/visual.d.ts +13 -0
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/esm/animation/callback-disappear.js +1 -2
- package/esm/animation/index.js +2 -1
- package/esm/compile/util.js +1 -2
- package/esm/component/marker/mark-point/base-mark-point.js +21 -21
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/component/util.js +2 -1
- package/esm/constant/gradient.js +1 -2
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -1
- package/esm/constant/word-cloud.js +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/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- package/esm/series/word-cloud/base.d.ts +2 -0
- package/esm/series/word-cloud/base.js +14 -3
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/measure-cache.d.ts +19 -0
- package/esm/series/word-cloud/measure-cache.js +25 -0
- package/esm/series/word-cloud/measure-cache.js.map +1 -0
- package/esm/typings/visual.d.ts +13 -0
- package/esm/typings/visual.js.map +1 -1
- package/esm/vchart-all.js.map +1 -1
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -61806,7 +61806,7 @@
|
|
|
61806
61806
|
});
|
|
61807
61807
|
};
|
|
61808
61808
|
|
|
61809
|
-
const version = "2.0.
|
|
61809
|
+
const version = "2.0.16";
|
|
61810
61810
|
|
|
61811
61811
|
const addVChartProperty = (data, op) => {
|
|
61812
61812
|
const context = op.beforeCall();
|
|
@@ -81374,6 +81374,41 @@
|
|
|
81374
81374
|
'rect'
|
|
81375
81375
|
];
|
|
81376
81376
|
|
|
81377
|
+
class WordMeasureCache {
|
|
81378
|
+
constructor(maxSize = 1000) {
|
|
81379
|
+
this._map = new Map();
|
|
81380
|
+
this._maxSize = maxSize;
|
|
81381
|
+
}
|
|
81382
|
+
get(key) {
|
|
81383
|
+
const v = this._map.get(key);
|
|
81384
|
+
if (!v) {
|
|
81385
|
+
return undefined;
|
|
81386
|
+
}
|
|
81387
|
+
this._map.delete(key);
|
|
81388
|
+
this._map.set(key, v);
|
|
81389
|
+
return v;
|
|
81390
|
+
}
|
|
81391
|
+
set(key, value) {
|
|
81392
|
+
if (this._map.has(key)) {
|
|
81393
|
+
this._map.set(key, value);
|
|
81394
|
+
return;
|
|
81395
|
+
}
|
|
81396
|
+
if (this._map.size >= this._maxSize) {
|
|
81397
|
+
const oldest = this._map.keys().next().value;
|
|
81398
|
+
if (oldest !== undefined) {
|
|
81399
|
+
this._map.delete(oldest);
|
|
81400
|
+
}
|
|
81401
|
+
}
|
|
81402
|
+
this._map.set(key, value);
|
|
81403
|
+
}
|
|
81404
|
+
clear() {
|
|
81405
|
+
this._map.clear();
|
|
81406
|
+
}
|
|
81407
|
+
size() {
|
|
81408
|
+
return this._map.size;
|
|
81409
|
+
}
|
|
81410
|
+
}
|
|
81411
|
+
|
|
81377
81412
|
const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
81378
81413
|
|
|
81379
81414
|
const wordCloudSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["word"]: { name: "word", type: "text" }, ["fillingWord"]: { name: "fillingWord", type: "text" }, ["wordMask"]: { name: "wordMask", type: "rect" } });
|
|
@@ -81465,11 +81500,16 @@
|
|
|
81465
81500
|
!SHAPE_TYPE.includes(this._maskShape) &&
|
|
81466
81501
|
!['fast', 'grid', 'cloud'].includes(this._wordCloudConfig.layoutMode);
|
|
81467
81502
|
this._defaultFontFamily = this._option.getTheme('fontFamily');
|
|
81503
|
+
if (!this._wordMeasureCache) {
|
|
81504
|
+
this._wordMeasureCache = new WordMeasureCache(1000);
|
|
81505
|
+
}
|
|
81468
81506
|
}
|
|
81469
81507
|
initData() {
|
|
81470
81508
|
var _a, _b;
|
|
81471
81509
|
super.initData();
|
|
81472
81510
|
(_b = (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.addListener('change', () => {
|
|
81511
|
+
var _a;
|
|
81512
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81473
81513
|
this._dataChange = true;
|
|
81474
81514
|
this.compile();
|
|
81475
81515
|
});
|
|
@@ -81660,7 +81700,7 @@
|
|
|
81660
81700
|
var _a, _b, _c, _d, _e, _f;
|
|
81661
81701
|
const fillingWordStyleSpec = (_b = (_a = this._spec.fillingWord) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
|
|
81662
81702
|
const wordCloudShapeConfig = (_c = this._wordCloudShapeConfig) !== null && _c !== void 0 ? _c : {};
|
|
81663
|
-
return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { createImage, rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: isValid$1(wordCloudShapeConfig.fillingFontFamilyField)
|
|
81703
|
+
return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { createImage, measureCache: this._wordMeasureCache, rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: isValid$1(wordCloudShapeConfig.fillingFontFamilyField)
|
|
81664
81704
|
? { field: wordCloudShapeConfig.fillingFontFamilyField }
|
|
81665
81705
|
: (_d = fillingWordStyleSpec.fontFamily) !== null && _d !== void 0 ? _d : this._defaultFontFamily, fillingPadding: (_f = (_e = this._spec.fillingWord) === null || _e === void 0 ? void 0 : _e.padding) !== null && _f !== void 0 ? _f : DEFAULT_FONT_PADDING, fillingFontStyle: isValid$1(wordCloudShapeConfig.fillingFontStyleField)
|
|
81666
81706
|
? { field: wordCloudShapeConfig.fillingFontStyleField }
|
|
@@ -81709,6 +81749,7 @@
|
|
|
81709
81749
|
return [this._wordMark];
|
|
81710
81750
|
}
|
|
81711
81751
|
reInit() {
|
|
81752
|
+
var _a;
|
|
81712
81753
|
super.reInit();
|
|
81713
81754
|
if (this._keyWordColorCallback) {
|
|
81714
81755
|
this._keyWordColorCallback = null;
|
|
@@ -81716,6 +81757,13 @@
|
|
|
81716
81757
|
if (this._fillingColorCallback) {
|
|
81717
81758
|
this._fillingColorCallback = null;
|
|
81718
81759
|
}
|
|
81760
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81761
|
+
}
|
|
81762
|
+
release() {
|
|
81763
|
+
var _a;
|
|
81764
|
+
super.release();
|
|
81765
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81766
|
+
this._wordMeasureCache = undefined;
|
|
81719
81767
|
}
|
|
81720
81768
|
}
|
|
81721
81769
|
BaseWordCloudSeries.mark = wordCloudSeriesMark;
|
|
@@ -85494,6 +85542,30 @@
|
|
|
85494
85542
|
!function (WORDCLOUD_SHAPE_HOOK_EVENT) {
|
|
85495
85543
|
WORDCLOUD_SHAPE_HOOK_EVENT.BEFORE_WORDCLOUD_SHAPE_LAYOUT = "beforeWordcloudShapeLayout", WORDCLOUD_SHAPE_HOOK_EVENT.AFTER_WORDCLOUD_SHAPE_LAYOUT = "afterWordcloudShapeLayout", WORDCLOUD_SHAPE_HOOK_EVENT.AFTER_WORDCLOUD_SHAPE_DRAW = "afterWordcloudShapeDraw";
|
|
85496
85544
|
}(exports.WORDCLOUD_SHAPE_HOOK_EVENT || (exports.WORDCLOUD_SHAPE_HOOK_EVENT = {}));
|
|
85545
|
+
class MapWordMeasureCache {
|
|
85546
|
+
constructor(maxSize = 1e3) {
|
|
85547
|
+
this._map = new Map(), this._maxSize = maxSize;
|
|
85548
|
+
}
|
|
85549
|
+
get(key) {
|
|
85550
|
+
const value = this._map.get(key);
|
|
85551
|
+
if (void 0 !== value) return this._map.delete(key), this._map.set(key, value), value;
|
|
85552
|
+
}
|
|
85553
|
+
set(key, value) {
|
|
85554
|
+
if (this._map.has(key)) this._map.set(key, value);else {
|
|
85555
|
+
if (this._map.size >= this._maxSize) {
|
|
85556
|
+
const firstKey = this._map.keys().next().value;
|
|
85557
|
+
void 0 !== firstKey && this._map.delete(firstKey);
|
|
85558
|
+
}
|
|
85559
|
+
this._map.set(key, value);
|
|
85560
|
+
}
|
|
85561
|
+
}
|
|
85562
|
+
clear() {
|
|
85563
|
+
this._map.clear();
|
|
85564
|
+
}
|
|
85565
|
+
size() {
|
|
85566
|
+
return this._map.size;
|
|
85567
|
+
}
|
|
85568
|
+
}
|
|
85497
85569
|
const colorListEqual = (arr0, arr1) => {
|
|
85498
85570
|
if (1 === arr1.length && "#537EF5" === arr1[0]) return !0;
|
|
85499
85571
|
if (!Array.isArray(arr0) || !Array.isArray(arr1) || arr0.length !== arr1.length) return !1;
|
|
@@ -85581,7 +85653,7 @@
|
|
|
85581
85653
|
ratio: ratio
|
|
85582
85654
|
} = region;
|
|
85583
85655
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85584
|
-
measureSprite(canvas, ctx, words, i);
|
|
85656
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85585
85657
|
const word = regionWords[i];
|
|
85586
85658
|
word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85587
85659
|
}
|
|
@@ -85591,7 +85663,7 @@
|
|
|
85591
85663
|
if (0 === failedWords.length) break;
|
|
85592
85664
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85593
85665
|
const word = failedWords[i];
|
|
85594
|
-
measureSprite(canvas, ctx, failedWords, i), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85666
|
+
measureSprite(canvas, ctx, failedWords, i, layoutConfig.measureCache), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85595
85667
|
}
|
|
85596
85668
|
}
|
|
85597
85669
|
layoutConfig.board = board;
|
|
@@ -85637,7 +85709,7 @@
|
|
|
85637
85709
|
} = region;
|
|
85638
85710
|
let restartTag = !1;
|
|
85639
85711
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85640
|
-
measureSprite(canvas, ctx, words, i);
|
|
85712
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85641
85713
|
const word = regionWords[i];
|
|
85642
85714
|
if (word.x = center[0], word.y = center[1], !word.skip && word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor)) word.hasPlaced = !0;else {
|
|
85643
85715
|
if (!word.skip && word.weight > weightStd && globalShinkFactor > globalShinkLimit) {
|
|
@@ -85662,7 +85734,7 @@
|
|
|
85662
85734
|
if (0 === failedWords.length) break;
|
|
85663
85735
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85664
85736
|
const word = failedWords[i];
|
|
85665
|
-
measureSprite(canvas, ctx, failedWords, i), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85737
|
+
measureSprite(canvas, ctx, failedWords, i, layoutConfig.measureCache), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85666
85738
|
}
|
|
85667
85739
|
}
|
|
85668
85740
|
layoutConfig.board = board;
|
|
@@ -85707,7 +85779,7 @@
|
|
|
85707
85779
|
} = region;
|
|
85708
85780
|
let restartTag = !1;
|
|
85709
85781
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85710
|
-
measureSprite(canvas, ctx, words, i);
|
|
85782
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85711
85783
|
const word = regionWords[i];
|
|
85712
85784
|
if (word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor)) {
|
|
85713
85785
|
if (word.hasPlaced = !0, word.weight >= weightStd && importantWordSuccessedNum++, importantWordSuccessedNum >= importantCount && !layoutFinish) {
|
|
@@ -85733,7 +85805,7 @@
|
|
|
85733
85805
|
if (0 === failedWords.length) break;
|
|
85734
85806
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85735
85807
|
const word = failedWords[i];
|
|
85736
|
-
measureSprite(canvas, ctx, failedWords, i), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85808
|
+
measureSprite(canvas, ctx, failedWords, i, layoutConfig.measureCache), word.x = shapeCenter[0], word.y = shapeCenter[1], word.hasText && place(board, word, shapeMaxR, shapeRatio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85737
85809
|
}
|
|
85738
85810
|
}
|
|
85739
85811
|
layoutConfig.board = board;
|
|
@@ -85812,8 +85884,13 @@
|
|
|
85812
85884
|
return [ratio * (t *= .1) * Math.cos(t), t * Math.sin(t)];
|
|
85813
85885
|
};
|
|
85814
85886
|
}
|
|
85815
|
-
function measureSprite(canvas, ctx, words, wi) {
|
|
85816
|
-
|
|
85887
|
+
function measureSprite(canvas, ctx, words, wi, cache) {
|
|
85888
|
+
const targetWord = words[wi];
|
|
85889
|
+
if (targetWord.sprite || 0 === targetWord.fontSize) return;
|
|
85890
|
+
if (cache) {
|
|
85891
|
+
const cached = cache.get(getWordMeasureKey(targetWord));
|
|
85892
|
+
if (cached) return targetWord.sprite = cached.sprite, targetWord.bounds = cached.bounds, targetWord.wordSize = cached.wordSize, void (targetWord.hasText = !0);
|
|
85893
|
+
}
|
|
85817
85894
|
const cw = 2048,
|
|
85818
85895
|
radians = Math.PI / 180,
|
|
85819
85896
|
n = words.length;
|
|
@@ -85876,14 +85953,25 @@
|
|
|
85876
85953
|
}
|
|
85877
85954
|
seen && (j < dTop && (dTop = j), j > dBottom && (dBottom = j));
|
|
85878
85955
|
}
|
|
85879
|
-
word.bounds = {
|
|
85956
|
+
if (word.bounds = {
|
|
85880
85957
|
dTop: (wordSize[1] >> 1) - dTop,
|
|
85881
85958
|
dBottom: dBottom - (wordSize[1] >> 1),
|
|
85882
85959
|
dLeft: (wordSize[0] >> 1) - dLeft,
|
|
85883
85960
|
dRight: dRight - (wordSize[0] >> 1)
|
|
85884
|
-
}, word.sprite = sprite,
|
|
85961
|
+
}, word.sprite = sprite, cache) {
|
|
85962
|
+
const key = getWordMeasureKey(word);
|
|
85963
|
+
cache.set(key, {
|
|
85964
|
+
sprite: sprite,
|
|
85965
|
+
bounds: word.bounds,
|
|
85966
|
+
wordSize: wordSize
|
|
85967
|
+
});
|
|
85968
|
+
}
|
|
85969
|
+
delete word.LT;
|
|
85885
85970
|
}
|
|
85886
85971
|
}
|
|
85972
|
+
function getWordMeasureKey(word) {
|
|
85973
|
+
return String(word.text) + "|" + String(word.fontFamily) + "|" + String(word.fontStyle) + "|" + String(word.fontWeight) + "|" + String(word.fontSize) + "|" + String(word.rotate) + "|" + String(word.padding);
|
|
85974
|
+
}
|
|
85887
85975
|
function initBoardWithShape(segmentationOutput) {
|
|
85888
85976
|
const {
|
|
85889
85977
|
segmentation: {
|
|
@@ -85980,7 +86068,7 @@
|
|
|
85980
86068
|
} = shapeBounds,
|
|
85981
86069
|
[startX, startY] = [x1 + ~~(randomGenerator() * fillingXStep * 2), y1 + ~~(randomGenerator() * fillingYStep * 2)];
|
|
85982
86070
|
for (let y = startY; y <= y2; y += fillingYStep) for (let x = startX; x <= x2; x += fillingXStep) {
|
|
85983
|
-
measureSprite(canvas, ctx, fillingWords, wi);
|
|
86071
|
+
measureSprite(canvas, ctx, fillingWords, wi, layoutConfig.measureCache);
|
|
85984
86072
|
const word = fillingWords[wi];
|
|
85985
86073
|
word.x = x, word.y = y;
|
|
85986
86074
|
const {
|
|
@@ -86119,7 +86207,7 @@
|
|
|
86119
86207
|
return this.progressiveResult;
|
|
86120
86208
|
}
|
|
86121
86209
|
doLayout() {
|
|
86122
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
86210
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
86123
86211
|
const segmentationInput = this.segmentationInput,
|
|
86124
86212
|
segmentationOutput = segmentation(segmentationInput);
|
|
86125
86213
|
if (!segmentationOutput.segmentation.regions.length) return;
|
|
@@ -86146,35 +86234,36 @@
|
|
|
86146
86234
|
const layoutConfig = {
|
|
86147
86235
|
size: options.size,
|
|
86148
86236
|
ratio: options.ratio || .8,
|
|
86237
|
+
measureCache: null !== (_a = options.measureCache) && void 0 !== _a ? _a : new MapWordMeasureCache(),
|
|
86149
86238
|
shapeUrl: options.shape,
|
|
86150
86239
|
random: void 0 === options.random || options.random,
|
|
86151
|
-
textLayoutTimes: null !== (
|
|
86240
|
+
textLayoutTimes: null !== (_b = options.textLayoutTimes) && void 0 !== _b ? _b : 3,
|
|
86152
86241
|
removeWhiteBorder: options.removeWhiteBorder,
|
|
86153
|
-
layoutMode: null !== (
|
|
86154
|
-
fontSizeShrinkFactor: null !== (
|
|
86155
|
-
stepFactor: null !== (
|
|
86156
|
-
importantWordCount: null !== (
|
|
86242
|
+
layoutMode: null !== (_c = options.layoutMode) && void 0 !== _c ? _c : "default",
|
|
86243
|
+
fontSizeShrinkFactor: null !== (_d = options.fontSizeShrinkFactor) && void 0 !== _d ? _d : .8,
|
|
86244
|
+
stepFactor: null !== (_e = options.stepFactor) && void 0 !== _e ? _e : 1,
|
|
86245
|
+
importantWordCount: null !== (_f = options.importantWordCount) && void 0 !== _f ? _f : 10,
|
|
86157
86246
|
globalShinkLimit: options.globalShinkLimit || .2,
|
|
86158
|
-
fontSizeEnlargeFactor: null !== (
|
|
86159
|
-
fillingRatio: null !== (
|
|
86160
|
-
fillingTimes: null !== (
|
|
86161
|
-
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (
|
|
86162
|
-
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (
|
|
86247
|
+
fontSizeEnlargeFactor: null !== (_g = options.fontSizeEnlargeFactor) && void 0 !== _g ? _g : 1.5,
|
|
86248
|
+
fillingRatio: null !== (_h = options.fillingRatio) && void 0 !== _h ? _h : .7,
|
|
86249
|
+
fillingTimes: null !== (_j = options.fillingTimes) && void 0 !== _j ? _j : 4,
|
|
86250
|
+
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (_k = options.fillingXStep) && void 0 !== _k ? _k : 4,
|
|
86251
|
+
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (_l = options.fillingYStep) && void 0 !== _l ? _l : 4,
|
|
86163
86252
|
fillingInitialFontSize: options.fillingInitialFontSize,
|
|
86164
86253
|
fillingDeltaFontSize: options.fillingDeltaFontSize,
|
|
86165
|
-
fillingInitialOpacity: null !== (
|
|
86166
|
-
fillingDeltaOpacity: null !== (
|
|
86254
|
+
fillingInitialOpacity: null !== (_m = options.fillingInitialOpacity) && void 0 !== _m ? _m : .8,
|
|
86255
|
+
fillingDeltaOpacity: null !== (_o = options.fillingDeltaOpacity) && void 0 !== _o ? _o : .05,
|
|
86167
86256
|
getFillingFontFamily: simpleField(options.fillingFontFamily || "sans-serif"),
|
|
86168
86257
|
getFillingFontStyle: simpleField(options.fillingFontStyle || "normal"),
|
|
86169
86258
|
getFillingFontWeight: simpleField(options.fillingFontWeight || "normal"),
|
|
86170
|
-
getFillingPadding: simpleField(null !== (
|
|
86171
|
-
fillingRotateList: null !== (
|
|
86172
|
-
fillingDeltaFontSizeFactor: null !== (
|
|
86259
|
+
getFillingPadding: simpleField(null !== (_p = options.fillingPadding) && void 0 !== _p ? _p : .4),
|
|
86260
|
+
fillingRotateList: null !== (_q = options.fillingRotateList) && void 0 !== _q ? _q : [0, 90],
|
|
86261
|
+
fillingDeltaFontSizeFactor: null !== (_r = options.fillingDeltaFontSizeFactor) && void 0 !== _r ? _r : .2,
|
|
86173
86262
|
fillingColorList: options.fillingColorList || ["#537EF5"],
|
|
86174
86263
|
sameColorList: !1,
|
|
86175
|
-
minInitFontSize: null !== (
|
|
86176
|
-
minFontSize: null !== (
|
|
86177
|
-
minFillFontSize: null !== (
|
|
86264
|
+
minInitFontSize: null !== (_s = options.minInitFontSize) && void 0 !== _s ? _s : 10,
|
|
86265
|
+
minFontSize: null !== (_t = options.minFontSize) && void 0 !== _t ? _t : 4,
|
|
86266
|
+
minFillFontSize: null !== (_u = options.minFillFontSize) && void 0 !== _u ? _u : 2
|
|
86178
86267
|
},
|
|
86179
86268
|
sameColorList = colorListEqual(wordsConfig.colorList, layoutConfig.fillingColorList);
|
|
86180
86269
|
layoutConfig.sameColorList = sameColorList, initColorScale(data, wordsConfig, layoutConfig, options), initFillingWordsFontSize(data, wordsConfig, layoutConfig, segmentationOutput);
|
|
@@ -86221,8 +86310,8 @@
|
|
|
86221
86310
|
successedWords: successedWords,
|
|
86222
86311
|
failedWords: failedWords
|
|
86223
86312
|
} = cloud(words, layoutConfig, segmentationOutput),
|
|
86224
|
-
textKey = null !== (
|
|
86225
|
-
dataIndexKey = null !== (
|
|
86313
|
+
textKey = null !== (_w = null === (_v = options.text) || void 0 === _v ? void 0 : _v.field) && void 0 !== _w ? _w : "textKey",
|
|
86314
|
+
dataIndexKey = null !== (_x = options.dataIndexKey) && void 0 !== _x ? _x : "defaultDataIndexKey",
|
|
86226
86315
|
as = options.as ? Object.assign(Object.assign({}, OUTPUT), options.as) : OUTPUT;
|
|
86227
86316
|
let w, t;
|
|
86228
86317
|
const modKeywords = [];
|
|
@@ -102883,9 +102972,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102883
102972
|
return 'cartesian';
|
|
102884
102973
|
}
|
|
102885
102974
|
_createMarkerComponent() {
|
|
102886
|
-
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;
|
|
102975
|
+
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;
|
|
102887
102976
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
102888
|
-
const
|
|
102977
|
+
const _10 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _10, restItemContent = __rest$e(_10, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
|
|
102889
102978
|
let itemContentState = null;
|
|
102890
102979
|
let itemContentStyle = null;
|
|
102891
102980
|
let defaultStyle = {};
|
|
@@ -102895,61 +102984,61 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102895
102984
|
dx: 0,
|
|
102896
102985
|
dy: 0
|
|
102897
102986
|
};
|
|
102898
|
-
itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_c = (_b = label === null || label === void 0 ? void 0 : label.
|
|
102987
|
+
itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_d = (_c = (_b = label === null || label === void 0 ? void 0 : label.style) !== null && _b !== void 0 ? _b : label === null || label === void 0 ? void 0 : label.textStyle) !== null && _c !== void 0 ? _c : textStyle) !== null && _d !== void 0 ? _d : style) }), this._markerData, this._markAttributeContext);
|
|
102899
102988
|
}
|
|
102900
102989
|
else if (type === 'richText') {
|
|
102901
|
-
itemContentState = (
|
|
102990
|
+
itemContentState = (_e = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _e !== void 0 ? _e : state;
|
|
102902
102991
|
defaultStyle = {
|
|
102903
102992
|
width: 100,
|
|
102904
102993
|
height: 100
|
|
102905
102994
|
};
|
|
102906
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
102995
|
+
itemContentStyle = transformStyle(merge$1(defaultStyle, (_g = (_f = richText === null || richText === void 0 ? void 0 : richText.style) !== null && _f !== void 0 ? _f : richTextStyle) !== null && _g !== void 0 ? _g : style), this._markerData, this._markAttributeContext);
|
|
102907
102996
|
}
|
|
102908
102997
|
else if (type === 'symbol') {
|
|
102909
|
-
itemContentState = (
|
|
102998
|
+
itemContentState = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _h !== void 0 ? _h : state;
|
|
102910
102999
|
defaultStyle = {
|
|
102911
103000
|
symbolType: 'star',
|
|
102912
103001
|
fill: 'rgb(48, 115, 242)',
|
|
102913
103002
|
fillOpacity: 0.8,
|
|
102914
103003
|
size: 20
|
|
102915
103004
|
};
|
|
102916
|
-
itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (
|
|
103005
|
+
itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (_k = (_j = symbol === null || symbol === void 0 ? void 0 : symbol.style) !== null && _j !== void 0 ? _j : symbolStyle) !== null && _k !== void 0 ? _k : style), this._markerData, this._markAttributeContext));
|
|
102917
103006
|
}
|
|
102918
103007
|
else if (type === 'image') {
|
|
102919
|
-
itemContentState = (
|
|
103008
|
+
itemContentState = (_l = image === null || image === void 0 ? void 0 : image.state) !== null && _l !== void 0 ? _l : state;
|
|
102920
103009
|
defaultStyle = {
|
|
102921
103010
|
width: 80,
|
|
102922
103011
|
height: 80
|
|
102923
103012
|
};
|
|
102924
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
103013
|
+
itemContentStyle = transformStyle(merge$1(defaultStyle, (_o = (_m = image === null || image === void 0 ? void 0 : image.style) !== null && _m !== void 0 ? _m : imageStyle) !== null && _o !== void 0 ? _o : style), this._markerData, this._markAttributeContext);
|
|
102925
103014
|
}
|
|
102926
103015
|
else if (type === 'custom') {
|
|
102927
|
-
itemContentState = (
|
|
102928
|
-
itemContentStyle = transformStyle((
|
|
103016
|
+
itemContentState = (_p = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _p !== void 0 ? _p : state;
|
|
103017
|
+
itemContentStyle = transformStyle((_r = (_q = customMark === null || customMark === void 0 ? void 0 : customMark.style) !== null && _q !== void 0 ? _q : customMarkStyle) !== null && _r !== void 0 ? _r : style, this._markerData, this._markAttributeContext);
|
|
102929
103018
|
}
|
|
102930
103019
|
const markPointAttrs = {
|
|
102931
103020
|
zIndex: this.layoutZIndex,
|
|
102932
|
-
interactive: (
|
|
102933
|
-
hover: (
|
|
102934
|
-
select: (
|
|
103021
|
+
interactive: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
|
|
103022
|
+
hover: (_t = this._spec.interactive) !== null && _t !== void 0 ? _t : true,
|
|
103023
|
+
select: (_u = this._spec.interactive) !== null && _u !== void 0 ? _u : true,
|
|
102935
103024
|
position: { x: 0, y: 0 },
|
|
102936
|
-
clipInRange: (
|
|
103025
|
+
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
102937
103026
|
itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()), offsetY: transformOffset(itemContent.offsetX, this._relativeSeries.getRegion()) }, restItemContent), { style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext) }),
|
|
102938
103027
|
targetSymbol: {
|
|
102939
|
-
offset: (
|
|
102940
|
-
visible: (
|
|
102941
|
-
size: (
|
|
103028
|
+
offset: (_w = targetSymbol.offset) !== null && _w !== void 0 ? _w : 0,
|
|
103029
|
+
visible: (_x = targetSymbol.visible) !== null && _x !== void 0 ? _x : false,
|
|
103030
|
+
size: (_y = targetSymbol.size) !== null && _y !== void 0 ? _y : 20,
|
|
102942
103031
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
102943
103032
|
},
|
|
102944
103033
|
state: {
|
|
102945
|
-
line: transformState((
|
|
102946
|
-
lineStartSymbol: transformState((
|
|
102947
|
-
lineEndSymbol: transformState((
|
|
103034
|
+
line: transformState((_0 = (_z = this._spec.itemLine.line) === null || _z === void 0 ? void 0 : _z.state) !== null && _0 !== void 0 ? _0 : {}, this._markerData, this._markAttributeContext),
|
|
103035
|
+
lineStartSymbol: transformState((_2 = (_1 = this._spec.itemLine.startSymbol) === null || _1 === void 0 ? void 0 : _1.state) !== null && _2 !== void 0 ? _2 : {}, this._markerData, this._markAttributeContext),
|
|
103036
|
+
lineEndSymbol: transformState((_4 = (_3 = this._spec.itemLine.endSymbol) === null || _3 === void 0 ? void 0 : _3.state) !== null && _4 !== void 0 ? _4 : {}, this._markerData, this._markAttributeContext),
|
|
102948
103037
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
102949
|
-
textBackground: transformState((
|
|
102950
|
-
targetItem: transformState((
|
|
103038
|
+
textBackground: transformState((_6 = (_5 = this._spec.itemContent.text) === null || _5 === void 0 ? void 0 : _5.labelBackground) === null || _6 === void 0 ? void 0 : _6.state, this._markerData, this._markAttributeContext),
|
|
103039
|
+
targetItem: transformState((_8 = (_7 = this._spec.targetSymbol) === null || _7 === void 0 ? void 0 : _7.state) !== null && _8 !== void 0 ? _8 : {}, this._markerData, this._markAttributeContext)
|
|
102951
103040
|
},
|
|
102952
|
-
animation: (
|
|
103041
|
+
animation: (_9 = this._spec.animation) !== null && _9 !== void 0 ? _9 : false,
|
|
102953
103042
|
animationEnter: this._spec.animationEnter,
|
|
102954
103043
|
animationExit: this._spec.animationExit,
|
|
102955
103044
|
animationUpdate: this._spec.animationUpdate
|