@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.es.js
CHANGED
|
@@ -61800,7 +61800,7 @@ const lookup = (data, opt) => {
|
|
|
61800
61800
|
});
|
|
61801
61801
|
};
|
|
61802
61802
|
|
|
61803
|
-
const version = "2.0.
|
|
61803
|
+
const version = "2.0.16";
|
|
61804
61804
|
|
|
61805
61805
|
const addVChartProperty = (data, op) => {
|
|
61806
61806
|
const context = op.beforeCall();
|
|
@@ -81368,6 +81368,41 @@ const SHAPE_TYPE = [
|
|
|
81368
81368
|
'rect'
|
|
81369
81369
|
];
|
|
81370
81370
|
|
|
81371
|
+
class WordMeasureCache {
|
|
81372
|
+
constructor(maxSize = 1000) {
|
|
81373
|
+
this._map = new Map();
|
|
81374
|
+
this._maxSize = maxSize;
|
|
81375
|
+
}
|
|
81376
|
+
get(key) {
|
|
81377
|
+
const v = this._map.get(key);
|
|
81378
|
+
if (!v) {
|
|
81379
|
+
return undefined;
|
|
81380
|
+
}
|
|
81381
|
+
this._map.delete(key);
|
|
81382
|
+
this._map.set(key, v);
|
|
81383
|
+
return v;
|
|
81384
|
+
}
|
|
81385
|
+
set(key, value) {
|
|
81386
|
+
if (this._map.has(key)) {
|
|
81387
|
+
this._map.set(key, value);
|
|
81388
|
+
return;
|
|
81389
|
+
}
|
|
81390
|
+
if (this._map.size >= this._maxSize) {
|
|
81391
|
+
const oldest = this._map.keys().next().value;
|
|
81392
|
+
if (oldest !== undefined) {
|
|
81393
|
+
this._map.delete(oldest);
|
|
81394
|
+
}
|
|
81395
|
+
}
|
|
81396
|
+
this._map.set(key, value);
|
|
81397
|
+
}
|
|
81398
|
+
clear() {
|
|
81399
|
+
this._map.clear();
|
|
81400
|
+
}
|
|
81401
|
+
size() {
|
|
81402
|
+
return this._map.size;
|
|
81403
|
+
}
|
|
81404
|
+
}
|
|
81405
|
+
|
|
81371
81406
|
const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
81372
81407
|
|
|
81373
81408
|
const wordCloudSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["word"]: { name: "word", type: "text" }, ["fillingWord"]: { name: "fillingWord", type: "text" }, ["wordMask"]: { name: "wordMask", type: "rect" } });
|
|
@@ -81459,11 +81494,16 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81459
81494
|
!SHAPE_TYPE.includes(this._maskShape) &&
|
|
81460
81495
|
!['fast', 'grid', 'cloud'].includes(this._wordCloudConfig.layoutMode);
|
|
81461
81496
|
this._defaultFontFamily = this._option.getTheme('fontFamily');
|
|
81497
|
+
if (!this._wordMeasureCache) {
|
|
81498
|
+
this._wordMeasureCache = new WordMeasureCache(1000);
|
|
81499
|
+
}
|
|
81462
81500
|
}
|
|
81463
81501
|
initData() {
|
|
81464
81502
|
var _a, _b;
|
|
81465
81503
|
super.initData();
|
|
81466
81504
|
(_b = (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.addListener('change', () => {
|
|
81505
|
+
var _a;
|
|
81506
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81467
81507
|
this._dataChange = true;
|
|
81468
81508
|
this.compile();
|
|
81469
81509
|
});
|
|
@@ -81654,7 +81694,7 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81654
81694
|
var _a, _b, _c, _d, _e, _f;
|
|
81655
81695
|
const fillingWordStyleSpec = (_b = (_a = this._spec.fillingWord) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
|
|
81656
81696
|
const wordCloudShapeConfig = (_c = this._wordCloudShapeConfig) !== null && _c !== void 0 ? _c : {};
|
|
81657
|
-
return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { createImage, rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: isValid$1(wordCloudShapeConfig.fillingFontFamilyField)
|
|
81697
|
+
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)
|
|
81658
81698
|
? { field: wordCloudShapeConfig.fillingFontFamilyField }
|
|
81659
81699
|
: (_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)
|
|
81660
81700
|
? { field: wordCloudShapeConfig.fillingFontStyleField }
|
|
@@ -81703,6 +81743,7 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81703
81743
|
return [this._wordMark];
|
|
81704
81744
|
}
|
|
81705
81745
|
reInit() {
|
|
81746
|
+
var _a;
|
|
81706
81747
|
super.reInit();
|
|
81707
81748
|
if (this._keyWordColorCallback) {
|
|
81708
81749
|
this._keyWordColorCallback = null;
|
|
@@ -81710,6 +81751,13 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81710
81751
|
if (this._fillingColorCallback) {
|
|
81711
81752
|
this._fillingColorCallback = null;
|
|
81712
81753
|
}
|
|
81754
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81755
|
+
}
|
|
81756
|
+
release() {
|
|
81757
|
+
var _a;
|
|
81758
|
+
super.release();
|
|
81759
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81760
|
+
this._wordMeasureCache = undefined;
|
|
81713
81761
|
}
|
|
81714
81762
|
}
|
|
81715
81763
|
BaseWordCloudSeries.mark = wordCloudSeriesMark;
|
|
@@ -85488,6 +85536,30 @@ var WORDCLOUD_SHAPE_HOOK_EVENT;
|
|
|
85488
85536
|
!function (WORDCLOUD_SHAPE_HOOK_EVENT) {
|
|
85489
85537
|
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";
|
|
85490
85538
|
}(WORDCLOUD_SHAPE_HOOK_EVENT || (WORDCLOUD_SHAPE_HOOK_EVENT = {}));
|
|
85539
|
+
class MapWordMeasureCache {
|
|
85540
|
+
constructor(maxSize = 1e3) {
|
|
85541
|
+
this._map = new Map(), this._maxSize = maxSize;
|
|
85542
|
+
}
|
|
85543
|
+
get(key) {
|
|
85544
|
+
const value = this._map.get(key);
|
|
85545
|
+
if (void 0 !== value) return this._map.delete(key), this._map.set(key, value), value;
|
|
85546
|
+
}
|
|
85547
|
+
set(key, value) {
|
|
85548
|
+
if (this._map.has(key)) this._map.set(key, value);else {
|
|
85549
|
+
if (this._map.size >= this._maxSize) {
|
|
85550
|
+
const firstKey = this._map.keys().next().value;
|
|
85551
|
+
void 0 !== firstKey && this._map.delete(firstKey);
|
|
85552
|
+
}
|
|
85553
|
+
this._map.set(key, value);
|
|
85554
|
+
}
|
|
85555
|
+
}
|
|
85556
|
+
clear() {
|
|
85557
|
+
this._map.clear();
|
|
85558
|
+
}
|
|
85559
|
+
size() {
|
|
85560
|
+
return this._map.size;
|
|
85561
|
+
}
|
|
85562
|
+
}
|
|
85491
85563
|
const colorListEqual = (arr0, arr1) => {
|
|
85492
85564
|
if (1 === arr1.length && "#537EF5" === arr1[0]) return !0;
|
|
85493
85565
|
if (!Array.isArray(arr0) || !Array.isArray(arr1) || arr0.length !== arr1.length) return !1;
|
|
@@ -85575,7 +85647,7 @@ function layout(words, layoutConfig, segmentationOutput) {
|
|
|
85575
85647
|
ratio: ratio
|
|
85576
85648
|
} = region;
|
|
85577
85649
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85578
|
-
measureSprite(canvas, ctx, words, i);
|
|
85650
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85579
85651
|
const word = regionWords[i];
|
|
85580
85652
|
word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85581
85653
|
}
|
|
@@ -85585,7 +85657,7 @@ function layout(words, layoutConfig, segmentationOutput) {
|
|
|
85585
85657
|
if (0 === failedWords.length) break;
|
|
85586
85658
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85587
85659
|
const word = failedWords[i];
|
|
85588
|
-
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);
|
|
85660
|
+
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);
|
|
85589
85661
|
}
|
|
85590
85662
|
}
|
|
85591
85663
|
layoutConfig.board = board;
|
|
@@ -85631,7 +85703,7 @@ function layoutGlobalShrink(words, layoutConfig, segmentationOutput) {
|
|
|
85631
85703
|
} = region;
|
|
85632
85704
|
let restartTag = !1;
|
|
85633
85705
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85634
|
-
measureSprite(canvas, ctx, words, i);
|
|
85706
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85635
85707
|
const word = regionWords[i];
|
|
85636
85708
|
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 {
|
|
85637
85709
|
if (!word.skip && word.weight > weightStd && globalShinkFactor > globalShinkLimit) {
|
|
@@ -85656,7 +85728,7 @@ function layoutGlobalShrink(words, layoutConfig, segmentationOutput) {
|
|
|
85656
85728
|
if (0 === failedWords.length) break;
|
|
85657
85729
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85658
85730
|
const word = failedWords[i];
|
|
85659
|
-
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);
|
|
85731
|
+
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);
|
|
85660
85732
|
}
|
|
85661
85733
|
}
|
|
85662
85734
|
layoutConfig.board = board;
|
|
@@ -85701,7 +85773,7 @@ function layoutSelfEnlarge(words, layoutConfig, segmentationOutput) {
|
|
|
85701
85773
|
} = region;
|
|
85702
85774
|
let restartTag = !1;
|
|
85703
85775
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85704
|
-
measureSprite(canvas, ctx, words, i);
|
|
85776
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85705
85777
|
const word = regionWords[i];
|
|
85706
85778
|
if (word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor)) {
|
|
85707
85779
|
if (word.hasPlaced = !0, word.weight >= weightStd && importantWordSuccessedNum++, importantWordSuccessedNum >= importantCount && !layoutFinish) {
|
|
@@ -85727,7 +85799,7 @@ function layoutSelfEnlarge(words, layoutConfig, segmentationOutput) {
|
|
|
85727
85799
|
if (0 === failedWords.length) break;
|
|
85728
85800
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85729
85801
|
const word = failedWords[i];
|
|
85730
|
-
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);
|
|
85802
|
+
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);
|
|
85731
85803
|
}
|
|
85732
85804
|
}
|
|
85733
85805
|
layoutConfig.board = board;
|
|
@@ -85806,8 +85878,13 @@ function archimedeanSpiral(ratio) {
|
|
|
85806
85878
|
return [ratio * (t *= .1) * Math.cos(t), t * Math.sin(t)];
|
|
85807
85879
|
};
|
|
85808
85880
|
}
|
|
85809
|
-
function measureSprite(canvas, ctx, words, wi) {
|
|
85810
|
-
|
|
85881
|
+
function measureSprite(canvas, ctx, words, wi, cache) {
|
|
85882
|
+
const targetWord = words[wi];
|
|
85883
|
+
if (targetWord.sprite || 0 === targetWord.fontSize) return;
|
|
85884
|
+
if (cache) {
|
|
85885
|
+
const cached = cache.get(getWordMeasureKey(targetWord));
|
|
85886
|
+
if (cached) return targetWord.sprite = cached.sprite, targetWord.bounds = cached.bounds, targetWord.wordSize = cached.wordSize, void (targetWord.hasText = !0);
|
|
85887
|
+
}
|
|
85811
85888
|
const cw = 2048,
|
|
85812
85889
|
radians = Math.PI / 180,
|
|
85813
85890
|
n = words.length;
|
|
@@ -85870,14 +85947,25 @@ function measureSprite(canvas, ctx, words, wi) {
|
|
|
85870
85947
|
}
|
|
85871
85948
|
seen && (j < dTop && (dTop = j), j > dBottom && (dBottom = j));
|
|
85872
85949
|
}
|
|
85873
|
-
word.bounds = {
|
|
85950
|
+
if (word.bounds = {
|
|
85874
85951
|
dTop: (wordSize[1] >> 1) - dTop,
|
|
85875
85952
|
dBottom: dBottom - (wordSize[1] >> 1),
|
|
85876
85953
|
dLeft: (wordSize[0] >> 1) - dLeft,
|
|
85877
85954
|
dRight: dRight - (wordSize[0] >> 1)
|
|
85878
|
-
}, word.sprite = sprite,
|
|
85955
|
+
}, word.sprite = sprite, cache) {
|
|
85956
|
+
const key = getWordMeasureKey(word);
|
|
85957
|
+
cache.set(key, {
|
|
85958
|
+
sprite: sprite,
|
|
85959
|
+
bounds: word.bounds,
|
|
85960
|
+
wordSize: wordSize
|
|
85961
|
+
});
|
|
85962
|
+
}
|
|
85963
|
+
delete word.LT;
|
|
85879
85964
|
}
|
|
85880
85965
|
}
|
|
85966
|
+
function getWordMeasureKey(word) {
|
|
85967
|
+
return String(word.text) + "|" + String(word.fontFamily) + "|" + String(word.fontStyle) + "|" + String(word.fontWeight) + "|" + String(word.fontSize) + "|" + String(word.rotate) + "|" + String(word.padding);
|
|
85968
|
+
}
|
|
85881
85969
|
function initBoardWithShape(segmentationOutput) {
|
|
85882
85970
|
const {
|
|
85883
85971
|
segmentation: {
|
|
@@ -85974,7 +86062,7 @@ function filling(words, layoutConfig, segmentationOutput) {
|
|
|
85974
86062
|
} = shapeBounds,
|
|
85975
86063
|
[startX, startY] = [x1 + ~~(randomGenerator() * fillingXStep * 2), y1 + ~~(randomGenerator() * fillingYStep * 2)];
|
|
85976
86064
|
for (let y = startY; y <= y2; y += fillingYStep) for (let x = startX; x <= x2; x += fillingXStep) {
|
|
85977
|
-
measureSprite(canvas, ctx, fillingWords, wi);
|
|
86065
|
+
measureSprite(canvas, ctx, fillingWords, wi, layoutConfig.measureCache);
|
|
85978
86066
|
const word = fillingWords[wi];
|
|
85979
86067
|
word.x = x, word.y = y;
|
|
85980
86068
|
const {
|
|
@@ -86113,7 +86201,7 @@ let Layout$1 = class Layout {
|
|
|
86113
86201
|
return this.progressiveResult;
|
|
86114
86202
|
}
|
|
86115
86203
|
doLayout() {
|
|
86116
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
86204
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
86117
86205
|
const segmentationInput = this.segmentationInput,
|
|
86118
86206
|
segmentationOutput = segmentation(segmentationInput);
|
|
86119
86207
|
if (!segmentationOutput.segmentation.regions.length) return;
|
|
@@ -86140,35 +86228,36 @@ let Layout$1 = class Layout {
|
|
|
86140
86228
|
const layoutConfig = {
|
|
86141
86229
|
size: options.size,
|
|
86142
86230
|
ratio: options.ratio || .8,
|
|
86231
|
+
measureCache: null !== (_a = options.measureCache) && void 0 !== _a ? _a : new MapWordMeasureCache(),
|
|
86143
86232
|
shapeUrl: options.shape,
|
|
86144
86233
|
random: void 0 === options.random || options.random,
|
|
86145
|
-
textLayoutTimes: null !== (
|
|
86234
|
+
textLayoutTimes: null !== (_b = options.textLayoutTimes) && void 0 !== _b ? _b : 3,
|
|
86146
86235
|
removeWhiteBorder: options.removeWhiteBorder,
|
|
86147
|
-
layoutMode: null !== (
|
|
86148
|
-
fontSizeShrinkFactor: null !== (
|
|
86149
|
-
stepFactor: null !== (
|
|
86150
|
-
importantWordCount: null !== (
|
|
86236
|
+
layoutMode: null !== (_c = options.layoutMode) && void 0 !== _c ? _c : "default",
|
|
86237
|
+
fontSizeShrinkFactor: null !== (_d = options.fontSizeShrinkFactor) && void 0 !== _d ? _d : .8,
|
|
86238
|
+
stepFactor: null !== (_e = options.stepFactor) && void 0 !== _e ? _e : 1,
|
|
86239
|
+
importantWordCount: null !== (_f = options.importantWordCount) && void 0 !== _f ? _f : 10,
|
|
86151
86240
|
globalShinkLimit: options.globalShinkLimit || .2,
|
|
86152
|
-
fontSizeEnlargeFactor: null !== (
|
|
86153
|
-
fillingRatio: null !== (
|
|
86154
|
-
fillingTimes: null !== (
|
|
86155
|
-
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (
|
|
86156
|
-
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (
|
|
86241
|
+
fontSizeEnlargeFactor: null !== (_g = options.fontSizeEnlargeFactor) && void 0 !== _g ? _g : 1.5,
|
|
86242
|
+
fillingRatio: null !== (_h = options.fillingRatio) && void 0 !== _h ? _h : .7,
|
|
86243
|
+
fillingTimes: null !== (_j = options.fillingTimes) && void 0 !== _j ? _j : 4,
|
|
86244
|
+
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (_k = options.fillingXStep) && void 0 !== _k ? _k : 4,
|
|
86245
|
+
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (_l = options.fillingYStep) && void 0 !== _l ? _l : 4,
|
|
86157
86246
|
fillingInitialFontSize: options.fillingInitialFontSize,
|
|
86158
86247
|
fillingDeltaFontSize: options.fillingDeltaFontSize,
|
|
86159
|
-
fillingInitialOpacity: null !== (
|
|
86160
|
-
fillingDeltaOpacity: null !== (
|
|
86248
|
+
fillingInitialOpacity: null !== (_m = options.fillingInitialOpacity) && void 0 !== _m ? _m : .8,
|
|
86249
|
+
fillingDeltaOpacity: null !== (_o = options.fillingDeltaOpacity) && void 0 !== _o ? _o : .05,
|
|
86161
86250
|
getFillingFontFamily: simpleField(options.fillingFontFamily || "sans-serif"),
|
|
86162
86251
|
getFillingFontStyle: simpleField(options.fillingFontStyle || "normal"),
|
|
86163
86252
|
getFillingFontWeight: simpleField(options.fillingFontWeight || "normal"),
|
|
86164
|
-
getFillingPadding: simpleField(null !== (
|
|
86165
|
-
fillingRotateList: null !== (
|
|
86166
|
-
fillingDeltaFontSizeFactor: null !== (
|
|
86253
|
+
getFillingPadding: simpleField(null !== (_p = options.fillingPadding) && void 0 !== _p ? _p : .4),
|
|
86254
|
+
fillingRotateList: null !== (_q = options.fillingRotateList) && void 0 !== _q ? _q : [0, 90],
|
|
86255
|
+
fillingDeltaFontSizeFactor: null !== (_r = options.fillingDeltaFontSizeFactor) && void 0 !== _r ? _r : .2,
|
|
86167
86256
|
fillingColorList: options.fillingColorList || ["#537EF5"],
|
|
86168
86257
|
sameColorList: !1,
|
|
86169
|
-
minInitFontSize: null !== (
|
|
86170
|
-
minFontSize: null !== (
|
|
86171
|
-
minFillFontSize: null !== (
|
|
86258
|
+
minInitFontSize: null !== (_s = options.minInitFontSize) && void 0 !== _s ? _s : 10,
|
|
86259
|
+
minFontSize: null !== (_t = options.minFontSize) && void 0 !== _t ? _t : 4,
|
|
86260
|
+
minFillFontSize: null !== (_u = options.minFillFontSize) && void 0 !== _u ? _u : 2
|
|
86172
86261
|
},
|
|
86173
86262
|
sameColorList = colorListEqual(wordsConfig.colorList, layoutConfig.fillingColorList);
|
|
86174
86263
|
layoutConfig.sameColorList = sameColorList, initColorScale(data, wordsConfig, layoutConfig, options), initFillingWordsFontSize(data, wordsConfig, layoutConfig, segmentationOutput);
|
|
@@ -86215,8 +86304,8 @@ let Layout$1 = class Layout {
|
|
|
86215
86304
|
successedWords: successedWords,
|
|
86216
86305
|
failedWords: failedWords
|
|
86217
86306
|
} = cloud(words, layoutConfig, segmentationOutput),
|
|
86218
|
-
textKey = null !== (
|
|
86219
|
-
dataIndexKey = null !== (
|
|
86307
|
+
textKey = null !== (_w = null === (_v = options.text) || void 0 === _v ? void 0 : _v.field) && void 0 !== _w ? _w : "textKey",
|
|
86308
|
+
dataIndexKey = null !== (_x = options.dataIndexKey) && void 0 !== _x ? _x : "defaultDataIndexKey",
|
|
86220
86309
|
as = options.as ? Object.assign(Object.assign({}, OUTPUT), options.as) : OUTPUT;
|
|
86221
86310
|
let w, t;
|
|
86222
86311
|
const modKeywords = [];
|
|
@@ -102877,9 +102966,9 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
102877
102966
|
return 'cartesian';
|
|
102878
102967
|
}
|
|
102879
102968
|
_createMarkerComponent() {
|
|
102880
|
-
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;
|
|
102969
|
+
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;
|
|
102881
102970
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
102882
|
-
const
|
|
102971
|
+
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"]);
|
|
102883
102972
|
let itemContentState = null;
|
|
102884
102973
|
let itemContentStyle = null;
|
|
102885
102974
|
let defaultStyle = {};
|
|
@@ -102889,61 +102978,61 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
102889
102978
|
dx: 0,
|
|
102890
102979
|
dy: 0
|
|
102891
102980
|
};
|
|
102892
|
-
itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_c = (_b = label === null || label === void 0 ? void 0 : label.
|
|
102981
|
+
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);
|
|
102893
102982
|
}
|
|
102894
102983
|
else if (type === 'richText') {
|
|
102895
|
-
itemContentState = (
|
|
102984
|
+
itemContentState = (_e = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _e !== void 0 ? _e : state;
|
|
102896
102985
|
defaultStyle = {
|
|
102897
102986
|
width: 100,
|
|
102898
102987
|
height: 100
|
|
102899
102988
|
};
|
|
102900
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
102989
|
+
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);
|
|
102901
102990
|
}
|
|
102902
102991
|
else if (type === 'symbol') {
|
|
102903
|
-
itemContentState = (
|
|
102992
|
+
itemContentState = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _h !== void 0 ? _h : state;
|
|
102904
102993
|
defaultStyle = {
|
|
102905
102994
|
symbolType: 'star',
|
|
102906
102995
|
fill: 'rgb(48, 115, 242)',
|
|
102907
102996
|
fillOpacity: 0.8,
|
|
102908
102997
|
size: 20
|
|
102909
102998
|
};
|
|
102910
|
-
itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (
|
|
102999
|
+
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));
|
|
102911
103000
|
}
|
|
102912
103001
|
else if (type === 'image') {
|
|
102913
|
-
itemContentState = (
|
|
103002
|
+
itemContentState = (_l = image === null || image === void 0 ? void 0 : image.state) !== null && _l !== void 0 ? _l : state;
|
|
102914
103003
|
defaultStyle = {
|
|
102915
103004
|
width: 80,
|
|
102916
103005
|
height: 80
|
|
102917
103006
|
};
|
|
102918
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
103007
|
+
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);
|
|
102919
103008
|
}
|
|
102920
103009
|
else if (type === 'custom') {
|
|
102921
|
-
itemContentState = (
|
|
102922
|
-
itemContentStyle = transformStyle((
|
|
103010
|
+
itemContentState = (_p = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _p !== void 0 ? _p : state;
|
|
103011
|
+
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);
|
|
102923
103012
|
}
|
|
102924
103013
|
const markPointAttrs = {
|
|
102925
103014
|
zIndex: this.layoutZIndex,
|
|
102926
|
-
interactive: (
|
|
102927
|
-
hover: (
|
|
102928
|
-
select: (
|
|
103015
|
+
interactive: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
|
|
103016
|
+
hover: (_t = this._spec.interactive) !== null && _t !== void 0 ? _t : true,
|
|
103017
|
+
select: (_u = this._spec.interactive) !== null && _u !== void 0 ? _u : true,
|
|
102929
103018
|
position: { x: 0, y: 0 },
|
|
102930
|
-
clipInRange: (
|
|
103019
|
+
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
102931
103020
|
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) }),
|
|
102932
103021
|
targetSymbol: {
|
|
102933
|
-
offset: (
|
|
102934
|
-
visible: (
|
|
102935
|
-
size: (
|
|
103022
|
+
offset: (_w = targetSymbol.offset) !== null && _w !== void 0 ? _w : 0,
|
|
103023
|
+
visible: (_x = targetSymbol.visible) !== null && _x !== void 0 ? _x : false,
|
|
103024
|
+
size: (_y = targetSymbol.size) !== null && _y !== void 0 ? _y : 20,
|
|
102936
103025
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
102937
103026
|
},
|
|
102938
103027
|
state: {
|
|
102939
|
-
line: transformState((
|
|
102940
|
-
lineStartSymbol: transformState((
|
|
102941
|
-
lineEndSymbol: transformState((
|
|
103028
|
+
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),
|
|
103029
|
+
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),
|
|
103030
|
+
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),
|
|
102942
103031
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
102943
|
-
textBackground: transformState((
|
|
102944
|
-
targetItem: transformState((
|
|
103032
|
+
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),
|
|
103033
|
+
targetItem: transformState((_8 = (_7 = this._spec.targetSymbol) === null || _7 === void 0 ? void 0 : _7.state) !== null && _8 !== void 0 ? _8 : {}, this._markerData, this._markAttributeContext)
|
|
102945
103034
|
},
|
|
102946
|
-
animation: (
|
|
103035
|
+
animation: (_9 = this._spec.animation) !== null && _9 !== void 0 ? _9 : false,
|
|
102947
103036
|
animationEnter: this._spec.animationEnter,
|
|
102948
103037
|
animationExit: this._spec.animationExit,
|
|
102949
103038
|
animationUpdate: this._spec.animationUpdate
|