@visactor/vchart 2.0.16-alpha.0 → 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 -70
- package/build/index.js +147 -70
- 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/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/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 +2 -2
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/instance-manager.js +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/data/initialize.js +1 -1
- package/cjs/data/register.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/esm/animation/callback-disappear.js +1 -2
- package/esm/animation/index.js +2 -1
- 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/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 +2 -2
- package/esm/core/index.js.map +1 -1
- package/esm/core/instance-manager.js +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/data/initialize.js +1 -1
- package/esm/data/register.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/package.json +10 -10
package/build/index.es.js
CHANGED
|
@@ -28856,18 +28856,6 @@ let LynxEnvContribution = class extends BaseEnvContribution {
|
|
|
28856
28856
|
getStaticCanvasCount() {
|
|
28857
28857
|
return 9999;
|
|
28858
28858
|
}
|
|
28859
|
-
createDom(params) {
|
|
28860
|
-
const {
|
|
28861
|
-
tagName = "div",
|
|
28862
|
-
parent: parent
|
|
28863
|
-
} = params,
|
|
28864
|
-
element = document.createElement(tagName);
|
|
28865
|
-
if (this.updateDom(element, params), parent) {
|
|
28866
|
-
const pd = isString$1(parent) ? lynx.getElementById(parent) : parent;
|
|
28867
|
-
pd && pd.appendChild && pd.appendChild(element);
|
|
28868
|
-
}
|
|
28869
|
-
return element;
|
|
28870
|
-
}
|
|
28871
28859
|
loadImage(url) {
|
|
28872
28860
|
return createImageElement(url, !1).then(img => ({
|
|
28873
28861
|
data: img,
|
|
@@ -61812,7 +61800,7 @@ const lookup = (data, opt) => {
|
|
|
61812
61800
|
});
|
|
61813
61801
|
};
|
|
61814
61802
|
|
|
61815
|
-
const version = "2.0.
|
|
61803
|
+
const version = "2.0.16";
|
|
61816
61804
|
|
|
61817
61805
|
const addVChartProperty = (data, op) => {
|
|
61818
61806
|
const context = op.beforeCall();
|
|
@@ -81380,6 +81368,41 @@ const SHAPE_TYPE = [
|
|
|
81380
81368
|
'rect'
|
|
81381
81369
|
];
|
|
81382
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
|
+
|
|
81383
81406
|
const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
81384
81407
|
|
|
81385
81408
|
const wordCloudSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["word"]: { name: "word", type: "text" }, ["fillingWord"]: { name: "fillingWord", type: "text" }, ["wordMask"]: { name: "wordMask", type: "rect" } });
|
|
@@ -81471,11 +81494,16 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81471
81494
|
!SHAPE_TYPE.includes(this._maskShape) &&
|
|
81472
81495
|
!['fast', 'grid', 'cloud'].includes(this._wordCloudConfig.layoutMode);
|
|
81473
81496
|
this._defaultFontFamily = this._option.getTheme('fontFamily');
|
|
81497
|
+
if (!this._wordMeasureCache) {
|
|
81498
|
+
this._wordMeasureCache = new WordMeasureCache(1000);
|
|
81499
|
+
}
|
|
81474
81500
|
}
|
|
81475
81501
|
initData() {
|
|
81476
81502
|
var _a, _b;
|
|
81477
81503
|
super.initData();
|
|
81478
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();
|
|
81479
81507
|
this._dataChange = true;
|
|
81480
81508
|
this.compile();
|
|
81481
81509
|
});
|
|
@@ -81666,7 +81694,7 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81666
81694
|
var _a, _b, _c, _d, _e, _f;
|
|
81667
81695
|
const fillingWordStyleSpec = (_b = (_a = this._spec.fillingWord) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
|
|
81668
81696
|
const wordCloudShapeConfig = (_c = this._wordCloudShapeConfig) !== null && _c !== void 0 ? _c : {};
|
|
81669
|
-
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)
|
|
81670
81698
|
? { field: wordCloudShapeConfig.fillingFontFamilyField }
|
|
81671
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)
|
|
81672
81700
|
? { field: wordCloudShapeConfig.fillingFontStyleField }
|
|
@@ -81715,6 +81743,7 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81715
81743
|
return [this._wordMark];
|
|
81716
81744
|
}
|
|
81717
81745
|
reInit() {
|
|
81746
|
+
var _a;
|
|
81718
81747
|
super.reInit();
|
|
81719
81748
|
if (this._keyWordColorCallback) {
|
|
81720
81749
|
this._keyWordColorCallback = null;
|
|
@@ -81722,6 +81751,13 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
81722
81751
|
if (this._fillingColorCallback) {
|
|
81723
81752
|
this._fillingColorCallback = null;
|
|
81724
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;
|
|
81725
81761
|
}
|
|
81726
81762
|
}
|
|
81727
81763
|
BaseWordCloudSeries.mark = wordCloudSeriesMark;
|
|
@@ -85500,6 +85536,30 @@ var WORDCLOUD_SHAPE_HOOK_EVENT;
|
|
|
85500
85536
|
!function (WORDCLOUD_SHAPE_HOOK_EVENT) {
|
|
85501
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";
|
|
85502
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
|
+
}
|
|
85503
85563
|
const colorListEqual = (arr0, arr1) => {
|
|
85504
85564
|
if (1 === arr1.length && "#537EF5" === arr1[0]) return !0;
|
|
85505
85565
|
if (!Array.isArray(arr0) || !Array.isArray(arr1) || arr0.length !== arr1.length) return !1;
|
|
@@ -85587,7 +85647,7 @@ function layout(words, layoutConfig, segmentationOutput) {
|
|
|
85587
85647
|
ratio: ratio
|
|
85588
85648
|
} = region;
|
|
85589
85649
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85590
|
-
measureSprite(canvas, ctx, words, i);
|
|
85650
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85591
85651
|
const word = regionWords[i];
|
|
85592
85652
|
word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85593
85653
|
}
|
|
@@ -85597,7 +85657,7 @@ function layout(words, layoutConfig, segmentationOutput) {
|
|
|
85597
85657
|
if (0 === failedWords.length) break;
|
|
85598
85658
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85599
85659
|
const word = failedWords[i];
|
|
85600
|
-
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);
|
|
85601
85661
|
}
|
|
85602
85662
|
}
|
|
85603
85663
|
layoutConfig.board = board;
|
|
@@ -85643,7 +85703,7 @@ function layoutGlobalShrink(words, layoutConfig, segmentationOutput) {
|
|
|
85643
85703
|
} = region;
|
|
85644
85704
|
let restartTag = !1;
|
|
85645
85705
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85646
|
-
measureSprite(canvas, ctx, words, i);
|
|
85706
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85647
85707
|
const word = regionWords[i];
|
|
85648
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 {
|
|
85649
85709
|
if (!word.skip && word.weight > weightStd && globalShinkFactor > globalShinkLimit) {
|
|
@@ -85668,7 +85728,7 @@ function layoutGlobalShrink(words, layoutConfig, segmentationOutput) {
|
|
|
85668
85728
|
if (0 === failedWords.length) break;
|
|
85669
85729
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85670
85730
|
const word = failedWords[i];
|
|
85671
|
-
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);
|
|
85672
85732
|
}
|
|
85673
85733
|
}
|
|
85674
85734
|
layoutConfig.board = board;
|
|
@@ -85713,7 +85773,7 @@ function layoutSelfEnlarge(words, layoutConfig, segmentationOutput) {
|
|
|
85713
85773
|
} = region;
|
|
85714
85774
|
let restartTag = !1;
|
|
85715
85775
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85716
|
-
measureSprite(canvas, ctx, words, i);
|
|
85776
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85717
85777
|
const word = regionWords[i];
|
|
85718
85778
|
if (word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor)) {
|
|
85719
85779
|
if (word.hasPlaced = !0, word.weight >= weightStd && importantWordSuccessedNum++, importantWordSuccessedNum >= importantCount && !layoutFinish) {
|
|
@@ -85739,7 +85799,7 @@ function layoutSelfEnlarge(words, layoutConfig, segmentationOutput) {
|
|
|
85739
85799
|
if (0 === failedWords.length) break;
|
|
85740
85800
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85741
85801
|
const word = failedWords[i];
|
|
85742
|
-
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);
|
|
85743
85803
|
}
|
|
85744
85804
|
}
|
|
85745
85805
|
layoutConfig.board = board;
|
|
@@ -85818,8 +85878,13 @@ function archimedeanSpiral(ratio) {
|
|
|
85818
85878
|
return [ratio * (t *= .1) * Math.cos(t), t * Math.sin(t)];
|
|
85819
85879
|
};
|
|
85820
85880
|
}
|
|
85821
|
-
function measureSprite(canvas, ctx, words, wi) {
|
|
85822
|
-
|
|
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
|
+
}
|
|
85823
85888
|
const cw = 2048,
|
|
85824
85889
|
radians = Math.PI / 180,
|
|
85825
85890
|
n = words.length;
|
|
@@ -85882,14 +85947,25 @@ function measureSprite(canvas, ctx, words, wi) {
|
|
|
85882
85947
|
}
|
|
85883
85948
|
seen && (j < dTop && (dTop = j), j > dBottom && (dBottom = j));
|
|
85884
85949
|
}
|
|
85885
|
-
word.bounds = {
|
|
85950
|
+
if (word.bounds = {
|
|
85886
85951
|
dTop: (wordSize[1] >> 1) - dTop,
|
|
85887
85952
|
dBottom: dBottom - (wordSize[1] >> 1),
|
|
85888
85953
|
dLeft: (wordSize[0] >> 1) - dLeft,
|
|
85889
85954
|
dRight: dRight - (wordSize[0] >> 1)
|
|
85890
|
-
}, 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;
|
|
85891
85964
|
}
|
|
85892
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
|
+
}
|
|
85893
85969
|
function initBoardWithShape(segmentationOutput) {
|
|
85894
85970
|
const {
|
|
85895
85971
|
segmentation: {
|
|
@@ -85986,7 +86062,7 @@ function filling(words, layoutConfig, segmentationOutput) {
|
|
|
85986
86062
|
} = shapeBounds,
|
|
85987
86063
|
[startX, startY] = [x1 + ~~(randomGenerator() * fillingXStep * 2), y1 + ~~(randomGenerator() * fillingYStep * 2)];
|
|
85988
86064
|
for (let y = startY; y <= y2; y += fillingYStep) for (let x = startX; x <= x2; x += fillingXStep) {
|
|
85989
|
-
measureSprite(canvas, ctx, fillingWords, wi);
|
|
86065
|
+
measureSprite(canvas, ctx, fillingWords, wi, layoutConfig.measureCache);
|
|
85990
86066
|
const word = fillingWords[wi];
|
|
85991
86067
|
word.x = x, word.y = y;
|
|
85992
86068
|
const {
|
|
@@ -86125,7 +86201,7 @@ let Layout$1 = class Layout {
|
|
|
86125
86201
|
return this.progressiveResult;
|
|
86126
86202
|
}
|
|
86127
86203
|
doLayout() {
|
|
86128
|
-
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;
|
|
86129
86205
|
const segmentationInput = this.segmentationInput,
|
|
86130
86206
|
segmentationOutput = segmentation(segmentationInput);
|
|
86131
86207
|
if (!segmentationOutput.segmentation.regions.length) return;
|
|
@@ -86152,35 +86228,36 @@ let Layout$1 = class Layout {
|
|
|
86152
86228
|
const layoutConfig = {
|
|
86153
86229
|
size: options.size,
|
|
86154
86230
|
ratio: options.ratio || .8,
|
|
86231
|
+
measureCache: null !== (_a = options.measureCache) && void 0 !== _a ? _a : new MapWordMeasureCache(),
|
|
86155
86232
|
shapeUrl: options.shape,
|
|
86156
86233
|
random: void 0 === options.random || options.random,
|
|
86157
|
-
textLayoutTimes: null !== (
|
|
86234
|
+
textLayoutTimes: null !== (_b = options.textLayoutTimes) && void 0 !== _b ? _b : 3,
|
|
86158
86235
|
removeWhiteBorder: options.removeWhiteBorder,
|
|
86159
|
-
layoutMode: null !== (
|
|
86160
|
-
fontSizeShrinkFactor: null !== (
|
|
86161
|
-
stepFactor: null !== (
|
|
86162
|
-
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,
|
|
86163
86240
|
globalShinkLimit: options.globalShinkLimit || .2,
|
|
86164
|
-
fontSizeEnlargeFactor: null !== (
|
|
86165
|
-
fillingRatio: null !== (
|
|
86166
|
-
fillingTimes: null !== (
|
|
86167
|
-
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (
|
|
86168
|
-
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,
|
|
86169
86246
|
fillingInitialFontSize: options.fillingInitialFontSize,
|
|
86170
86247
|
fillingDeltaFontSize: options.fillingDeltaFontSize,
|
|
86171
|
-
fillingInitialOpacity: null !== (
|
|
86172
|
-
fillingDeltaOpacity: null !== (
|
|
86248
|
+
fillingInitialOpacity: null !== (_m = options.fillingInitialOpacity) && void 0 !== _m ? _m : .8,
|
|
86249
|
+
fillingDeltaOpacity: null !== (_o = options.fillingDeltaOpacity) && void 0 !== _o ? _o : .05,
|
|
86173
86250
|
getFillingFontFamily: simpleField(options.fillingFontFamily || "sans-serif"),
|
|
86174
86251
|
getFillingFontStyle: simpleField(options.fillingFontStyle || "normal"),
|
|
86175
86252
|
getFillingFontWeight: simpleField(options.fillingFontWeight || "normal"),
|
|
86176
|
-
getFillingPadding: simpleField(null !== (
|
|
86177
|
-
fillingRotateList: null !== (
|
|
86178
|
-
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,
|
|
86179
86256
|
fillingColorList: options.fillingColorList || ["#537EF5"],
|
|
86180
86257
|
sameColorList: !1,
|
|
86181
|
-
minInitFontSize: null !== (
|
|
86182
|
-
minFontSize: null !== (
|
|
86183
|
-
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
|
|
86184
86261
|
},
|
|
86185
86262
|
sameColorList = colorListEqual(wordsConfig.colorList, layoutConfig.fillingColorList);
|
|
86186
86263
|
layoutConfig.sameColorList = sameColorList, initColorScale(data, wordsConfig, layoutConfig, options), initFillingWordsFontSize(data, wordsConfig, layoutConfig, segmentationOutput);
|
|
@@ -86227,8 +86304,8 @@ let Layout$1 = class Layout {
|
|
|
86227
86304
|
successedWords: successedWords,
|
|
86228
86305
|
failedWords: failedWords
|
|
86229
86306
|
} = cloud(words, layoutConfig, segmentationOutput),
|
|
86230
|
-
textKey = null !== (
|
|
86231
|
-
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",
|
|
86232
86309
|
as = options.as ? Object.assign(Object.assign({}, OUTPUT), options.as) : OUTPUT;
|
|
86233
86310
|
let w, t;
|
|
86234
86311
|
const modKeywords = [];
|
|
@@ -102889,9 +102966,9 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
102889
102966
|
return 'cartesian';
|
|
102890
102967
|
}
|
|
102891
102968
|
_createMarkerComponent() {
|
|
102892
|
-
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;
|
|
102893
102970
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
102894
|
-
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"]);
|
|
102895
102972
|
let itemContentState = null;
|
|
102896
102973
|
let itemContentStyle = null;
|
|
102897
102974
|
let defaultStyle = {};
|
|
@@ -102901,61 +102978,61 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
102901
102978
|
dx: 0,
|
|
102902
102979
|
dy: 0
|
|
102903
102980
|
};
|
|
102904
|
-
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);
|
|
102905
102982
|
}
|
|
102906
102983
|
else if (type === 'richText') {
|
|
102907
|
-
itemContentState = (
|
|
102984
|
+
itemContentState = (_e = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _e !== void 0 ? _e : state;
|
|
102908
102985
|
defaultStyle = {
|
|
102909
102986
|
width: 100,
|
|
102910
102987
|
height: 100
|
|
102911
102988
|
};
|
|
102912
|
-
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);
|
|
102913
102990
|
}
|
|
102914
102991
|
else if (type === 'symbol') {
|
|
102915
|
-
itemContentState = (
|
|
102992
|
+
itemContentState = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _h !== void 0 ? _h : state;
|
|
102916
102993
|
defaultStyle = {
|
|
102917
102994
|
symbolType: 'star',
|
|
102918
102995
|
fill: 'rgb(48, 115, 242)',
|
|
102919
102996
|
fillOpacity: 0.8,
|
|
102920
102997
|
size: 20
|
|
102921
102998
|
};
|
|
102922
|
-
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));
|
|
102923
103000
|
}
|
|
102924
103001
|
else if (type === 'image') {
|
|
102925
|
-
itemContentState = (
|
|
103002
|
+
itemContentState = (_l = image === null || image === void 0 ? void 0 : image.state) !== null && _l !== void 0 ? _l : state;
|
|
102926
103003
|
defaultStyle = {
|
|
102927
103004
|
width: 80,
|
|
102928
103005
|
height: 80
|
|
102929
103006
|
};
|
|
102930
|
-
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);
|
|
102931
103008
|
}
|
|
102932
103009
|
else if (type === 'custom') {
|
|
102933
|
-
itemContentState = (
|
|
102934
|
-
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);
|
|
102935
103012
|
}
|
|
102936
103013
|
const markPointAttrs = {
|
|
102937
103014
|
zIndex: this.layoutZIndex,
|
|
102938
|
-
interactive: (
|
|
102939
|
-
hover: (
|
|
102940
|
-
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,
|
|
102941
103018
|
position: { x: 0, y: 0 },
|
|
102942
|
-
clipInRange: (
|
|
103019
|
+
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
102943
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) }),
|
|
102944
103021
|
targetSymbol: {
|
|
102945
|
-
offset: (
|
|
102946
|
-
visible: (
|
|
102947
|
-
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,
|
|
102948
103025
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
102949
103026
|
},
|
|
102950
103027
|
state: {
|
|
102951
|
-
line: transformState((
|
|
102952
|
-
lineStartSymbol: transformState((
|
|
102953
|
-
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),
|
|
102954
103031
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
102955
|
-
textBackground: transformState((
|
|
102956
|
-
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)
|
|
102957
103034
|
},
|
|
102958
|
-
animation: (
|
|
103035
|
+
animation: (_9 = this._spec.animation) !== null && _9 !== void 0 ? _9 : false,
|
|
102959
103036
|
animationEnter: this._spec.animationEnter,
|
|
102960
103037
|
animationExit: this._spec.animationExit,
|
|
102961
103038
|
animationUpdate: this._spec.animationUpdate
|