@visactor/vchart 2.0.16-alpha.0 → 2.0.17
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 +156 -73
- package/build/index.js +156 -72
- 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 +2 -1
- package/cjs/component/axis/base-axis.js +3 -3
- package/cjs/component/axis/base-axis.js.map +1 -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/component/util.js +1 -2
- 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/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/cjs/util/spec/transform.d.ts +1 -0
- package/cjs/util/spec/transform.js +7 -2
- package/cjs/util/spec/transform.js.map +1 -1
- package/esm/animation/callback-disappear.js +1 -2
- package/esm/animation/index.js +2 -1
- package/esm/compile/util.js +2 -1
- package/esm/component/axis/base-axis.js +4 -2
- package/esm/component/axis/base-axis.js.map +1 -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/component/util.js +1 -2
- 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/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/esm/util/spec/transform.d.ts +1 -0
- package/esm/util/spec/transform.js +5 -1
- package/esm/util/spec/transform.js.map +1 -1
- package/package.json +11 -11
package/build/index.js
CHANGED
|
@@ -28862,18 +28862,6 @@
|
|
|
28862
28862
|
getStaticCanvasCount() {
|
|
28863
28863
|
return 9999;
|
|
28864
28864
|
}
|
|
28865
|
-
createDom(params) {
|
|
28866
|
-
const {
|
|
28867
|
-
tagName = "div",
|
|
28868
|
-
parent: parent
|
|
28869
|
-
} = params,
|
|
28870
|
-
element = document.createElement(tagName);
|
|
28871
|
-
if (this.updateDom(element, params), parent) {
|
|
28872
|
-
const pd = isString$1(parent) ? lynx.getElementById(parent) : parent;
|
|
28873
|
-
pd && pd.appendChild && pd.appendChild(element);
|
|
28874
|
-
}
|
|
28875
|
-
return element;
|
|
28876
|
-
}
|
|
28877
28865
|
loadImage(url) {
|
|
28878
28866
|
return createImageElement(url, !1).then(img => ({
|
|
28879
28867
|
data: img,
|
|
@@ -53353,6 +53341,12 @@
|
|
|
53353
53341
|
}
|
|
53354
53342
|
return spec;
|
|
53355
53343
|
}
|
|
53344
|
+
function transformFunctionAttribute(att, ...args) {
|
|
53345
|
+
if (isFunction$1(att)) {
|
|
53346
|
+
return att(...args);
|
|
53347
|
+
}
|
|
53348
|
+
return att;
|
|
53349
|
+
}
|
|
53356
53350
|
|
|
53357
53351
|
const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
|
|
53358
53352
|
return initTextMeasure$1(textSpec, option, useNaiveCanvas, {
|
|
@@ -61818,7 +61812,7 @@
|
|
|
61818
61812
|
});
|
|
61819
61813
|
};
|
|
61820
61814
|
|
|
61821
|
-
const version = "2.0.
|
|
61815
|
+
const version = "2.0.17";
|
|
61822
61816
|
|
|
61823
61817
|
const addVChartProperty = (data, op) => {
|
|
61824
61818
|
const context = op.beforeCall();
|
|
@@ -66498,7 +66492,7 @@
|
|
|
66498
66492
|
_getGridAttributes() {
|
|
66499
66493
|
const spec = this._spec;
|
|
66500
66494
|
return {
|
|
66501
|
-
alternateColor: spec.grid.alternateColor,
|
|
66495
|
+
alternateColor: transformFunctionAttribute(spec.grid.alternateColor),
|
|
66502
66496
|
alignWithLabel: spec.grid.alignWithLabel,
|
|
66503
66497
|
style: isFunction$1(spec.grid.style)
|
|
66504
66498
|
? (datum, index) => {
|
|
@@ -66512,7 +66506,7 @@
|
|
|
66512
66506
|
: {
|
|
66513
66507
|
type: 'line',
|
|
66514
66508
|
visible: spec.subGrid.visible,
|
|
66515
|
-
alternateColor: spec.subGrid.alternateColor,
|
|
66509
|
+
alternateColor: transformFunctionAttribute(spec.subGrid.alternateColor),
|
|
66516
66510
|
style: transformToGraphic(spec.subGrid.style)
|
|
66517
66511
|
}
|
|
66518
66512
|
};
|
|
@@ -81386,6 +81380,41 @@
|
|
|
81386
81380
|
'rect'
|
|
81387
81381
|
];
|
|
81388
81382
|
|
|
81383
|
+
class WordMeasureCache {
|
|
81384
|
+
constructor(maxSize = 1000) {
|
|
81385
|
+
this._map = new Map();
|
|
81386
|
+
this._maxSize = maxSize;
|
|
81387
|
+
}
|
|
81388
|
+
get(key) {
|
|
81389
|
+
const v = this._map.get(key);
|
|
81390
|
+
if (!v) {
|
|
81391
|
+
return undefined;
|
|
81392
|
+
}
|
|
81393
|
+
this._map.delete(key);
|
|
81394
|
+
this._map.set(key, v);
|
|
81395
|
+
return v;
|
|
81396
|
+
}
|
|
81397
|
+
set(key, value) {
|
|
81398
|
+
if (this._map.has(key)) {
|
|
81399
|
+
this._map.set(key, value);
|
|
81400
|
+
return;
|
|
81401
|
+
}
|
|
81402
|
+
if (this._map.size >= this._maxSize) {
|
|
81403
|
+
const oldest = this._map.keys().next().value;
|
|
81404
|
+
if (oldest !== undefined) {
|
|
81405
|
+
this._map.delete(oldest);
|
|
81406
|
+
}
|
|
81407
|
+
}
|
|
81408
|
+
this._map.set(key, value);
|
|
81409
|
+
}
|
|
81410
|
+
clear() {
|
|
81411
|
+
this._map.clear();
|
|
81412
|
+
}
|
|
81413
|
+
size() {
|
|
81414
|
+
return this._map.size;
|
|
81415
|
+
}
|
|
81416
|
+
}
|
|
81417
|
+
|
|
81389
81418
|
const WORD_CLOUD_TEXT = `${PREFIX}_WORD_CLOUD_TEXT`;
|
|
81390
81419
|
|
|
81391
81420
|
const wordCloudSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["word"]: { name: "word", type: "text" }, ["fillingWord"]: { name: "fillingWord", type: "text" }, ["wordMask"]: { name: "wordMask", type: "rect" } });
|
|
@@ -81477,11 +81506,16 @@
|
|
|
81477
81506
|
!SHAPE_TYPE.includes(this._maskShape) &&
|
|
81478
81507
|
!['fast', 'grid', 'cloud'].includes(this._wordCloudConfig.layoutMode);
|
|
81479
81508
|
this._defaultFontFamily = this._option.getTheme('fontFamily');
|
|
81509
|
+
if (!this._wordMeasureCache) {
|
|
81510
|
+
this._wordMeasureCache = new WordMeasureCache(1000);
|
|
81511
|
+
}
|
|
81480
81512
|
}
|
|
81481
81513
|
initData() {
|
|
81482
81514
|
var _a, _b;
|
|
81483
81515
|
super.initData();
|
|
81484
81516
|
(_b = (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.addListener('change', () => {
|
|
81517
|
+
var _a;
|
|
81518
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81485
81519
|
this._dataChange = true;
|
|
81486
81520
|
this.compile();
|
|
81487
81521
|
});
|
|
@@ -81672,7 +81706,7 @@
|
|
|
81672
81706
|
var _a, _b, _c, _d, _e, _f;
|
|
81673
81707
|
const fillingWordStyleSpec = (_b = (_a = this._spec.fillingWord) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
|
|
81674
81708
|
const wordCloudShapeConfig = (_c = this._wordCloudShapeConfig) !== null && _c !== void 0 ? _c : {};
|
|
81675
|
-
return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { createImage, rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: isValid$1(wordCloudShapeConfig.fillingFontFamilyField)
|
|
81709
|
+
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)
|
|
81676
81710
|
? { field: wordCloudShapeConfig.fillingFontFamilyField }
|
|
81677
81711
|
: (_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)
|
|
81678
81712
|
? { field: wordCloudShapeConfig.fillingFontStyleField }
|
|
@@ -81721,6 +81755,7 @@
|
|
|
81721
81755
|
return [this._wordMark];
|
|
81722
81756
|
}
|
|
81723
81757
|
reInit() {
|
|
81758
|
+
var _a;
|
|
81724
81759
|
super.reInit();
|
|
81725
81760
|
if (this._keyWordColorCallback) {
|
|
81726
81761
|
this._keyWordColorCallback = null;
|
|
@@ -81728,6 +81763,13 @@
|
|
|
81728
81763
|
if (this._fillingColorCallback) {
|
|
81729
81764
|
this._fillingColorCallback = null;
|
|
81730
81765
|
}
|
|
81766
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81767
|
+
}
|
|
81768
|
+
release() {
|
|
81769
|
+
var _a;
|
|
81770
|
+
super.release();
|
|
81771
|
+
(_a = this._wordMeasureCache) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81772
|
+
this._wordMeasureCache = undefined;
|
|
81731
81773
|
}
|
|
81732
81774
|
}
|
|
81733
81775
|
BaseWordCloudSeries.mark = wordCloudSeriesMark;
|
|
@@ -85506,6 +85548,30 @@
|
|
|
85506
85548
|
!function (WORDCLOUD_SHAPE_HOOK_EVENT) {
|
|
85507
85549
|
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";
|
|
85508
85550
|
}(exports.WORDCLOUD_SHAPE_HOOK_EVENT || (exports.WORDCLOUD_SHAPE_HOOK_EVENT = {}));
|
|
85551
|
+
class MapWordMeasureCache {
|
|
85552
|
+
constructor(maxSize = 1e3) {
|
|
85553
|
+
this._map = new Map(), this._maxSize = maxSize;
|
|
85554
|
+
}
|
|
85555
|
+
get(key) {
|
|
85556
|
+
const value = this._map.get(key);
|
|
85557
|
+
if (void 0 !== value) return this._map.delete(key), this._map.set(key, value), value;
|
|
85558
|
+
}
|
|
85559
|
+
set(key, value) {
|
|
85560
|
+
if (this._map.has(key)) this._map.set(key, value);else {
|
|
85561
|
+
if (this._map.size >= this._maxSize) {
|
|
85562
|
+
const firstKey = this._map.keys().next().value;
|
|
85563
|
+
void 0 !== firstKey && this._map.delete(firstKey);
|
|
85564
|
+
}
|
|
85565
|
+
this._map.set(key, value);
|
|
85566
|
+
}
|
|
85567
|
+
}
|
|
85568
|
+
clear() {
|
|
85569
|
+
this._map.clear();
|
|
85570
|
+
}
|
|
85571
|
+
size() {
|
|
85572
|
+
return this._map.size;
|
|
85573
|
+
}
|
|
85574
|
+
}
|
|
85509
85575
|
const colorListEqual = (arr0, arr1) => {
|
|
85510
85576
|
if (1 === arr1.length && "#537EF5" === arr1[0]) return !0;
|
|
85511
85577
|
if (!Array.isArray(arr0) || !Array.isArray(arr1) || arr0.length !== arr1.length) return !1;
|
|
@@ -85593,7 +85659,7 @@
|
|
|
85593
85659
|
ratio: ratio
|
|
85594
85660
|
} = region;
|
|
85595
85661
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85596
|
-
measureSprite(canvas, ctx, words, i);
|
|
85662
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85597
85663
|
const word = regionWords[i];
|
|
85598
85664
|
word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor) && (word.hasPlaced = !0);
|
|
85599
85665
|
}
|
|
@@ -85603,7 +85669,7 @@
|
|
|
85603
85669
|
if (0 === failedWords.length) break;
|
|
85604
85670
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85605
85671
|
const word = failedWords[i];
|
|
85606
|
-
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);
|
|
85672
|
+
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);
|
|
85607
85673
|
}
|
|
85608
85674
|
}
|
|
85609
85675
|
layoutConfig.board = board;
|
|
@@ -85649,7 +85715,7 @@
|
|
|
85649
85715
|
} = region;
|
|
85650
85716
|
let restartTag = !1;
|
|
85651
85717
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85652
|
-
measureSprite(canvas, ctx, words, i);
|
|
85718
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85653
85719
|
const word = regionWords[i];
|
|
85654
85720
|
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 {
|
|
85655
85721
|
if (!word.skip && word.weight > weightStd && globalShinkFactor > globalShinkLimit) {
|
|
@@ -85674,7 +85740,7 @@
|
|
|
85674
85740
|
if (0 === failedWords.length) break;
|
|
85675
85741
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85676
85742
|
const word = failedWords[i];
|
|
85677
|
-
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);
|
|
85743
|
+
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);
|
|
85678
85744
|
}
|
|
85679
85745
|
}
|
|
85680
85746
|
layoutConfig.board = board;
|
|
@@ -85719,7 +85785,7 @@
|
|
|
85719
85785
|
} = region;
|
|
85720
85786
|
let restartTag = !1;
|
|
85721
85787
|
for (let i = 0; i < regionWords.length; i++) {
|
|
85722
|
-
measureSprite(canvas, ctx, words, i);
|
|
85788
|
+
measureSprite(canvas, ctx, words, i, layoutConfig.measureCache);
|
|
85723
85789
|
const word = regionWords[i];
|
|
85724
85790
|
if (word.x = center[0], word.y = center[1], word.hasText && word.sprite && place(board, word, maxR, ratio, size, boardSize, stepFactor)) {
|
|
85725
85791
|
if (word.hasPlaced = !0, word.weight >= weightStd && importantWordSuccessedNum++, importantWordSuccessedNum >= importantCount && !layoutFinish) {
|
|
@@ -85745,7 +85811,7 @@
|
|
|
85745
85811
|
if (0 === failedWords.length) break;
|
|
85746
85812
|
for (let i = 0; i < failedWords.length; i++) {
|
|
85747
85813
|
const word = failedWords[i];
|
|
85748
|
-
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);
|
|
85814
|
+
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);
|
|
85749
85815
|
}
|
|
85750
85816
|
}
|
|
85751
85817
|
layoutConfig.board = board;
|
|
@@ -85824,8 +85890,13 @@
|
|
|
85824
85890
|
return [ratio * (t *= .1) * Math.cos(t), t * Math.sin(t)];
|
|
85825
85891
|
};
|
|
85826
85892
|
}
|
|
85827
|
-
function measureSprite(canvas, ctx, words, wi) {
|
|
85828
|
-
|
|
85893
|
+
function measureSprite(canvas, ctx, words, wi, cache) {
|
|
85894
|
+
const targetWord = words[wi];
|
|
85895
|
+
if (targetWord.sprite || 0 === targetWord.fontSize) return;
|
|
85896
|
+
if (cache) {
|
|
85897
|
+
const cached = cache.get(getWordMeasureKey(targetWord));
|
|
85898
|
+
if (cached) return targetWord.sprite = cached.sprite, targetWord.bounds = cached.bounds, targetWord.wordSize = cached.wordSize, void (targetWord.hasText = !0);
|
|
85899
|
+
}
|
|
85829
85900
|
const cw = 2048,
|
|
85830
85901
|
radians = Math.PI / 180,
|
|
85831
85902
|
n = words.length;
|
|
@@ -85888,14 +85959,25 @@
|
|
|
85888
85959
|
}
|
|
85889
85960
|
seen && (j < dTop && (dTop = j), j > dBottom && (dBottom = j));
|
|
85890
85961
|
}
|
|
85891
|
-
word.bounds = {
|
|
85962
|
+
if (word.bounds = {
|
|
85892
85963
|
dTop: (wordSize[1] >> 1) - dTop,
|
|
85893
85964
|
dBottom: dBottom - (wordSize[1] >> 1),
|
|
85894
85965
|
dLeft: (wordSize[0] >> 1) - dLeft,
|
|
85895
85966
|
dRight: dRight - (wordSize[0] >> 1)
|
|
85896
|
-
}, word.sprite = sprite,
|
|
85967
|
+
}, word.sprite = sprite, cache) {
|
|
85968
|
+
const key = getWordMeasureKey(word);
|
|
85969
|
+
cache.set(key, {
|
|
85970
|
+
sprite: sprite,
|
|
85971
|
+
bounds: word.bounds,
|
|
85972
|
+
wordSize: wordSize
|
|
85973
|
+
});
|
|
85974
|
+
}
|
|
85975
|
+
delete word.LT;
|
|
85897
85976
|
}
|
|
85898
85977
|
}
|
|
85978
|
+
function getWordMeasureKey(word) {
|
|
85979
|
+
return String(word.text) + "|" + String(word.fontFamily) + "|" + String(word.fontStyle) + "|" + String(word.fontWeight) + "|" + String(word.fontSize) + "|" + String(word.rotate) + "|" + String(word.padding);
|
|
85980
|
+
}
|
|
85899
85981
|
function initBoardWithShape(segmentationOutput) {
|
|
85900
85982
|
const {
|
|
85901
85983
|
segmentation: {
|
|
@@ -85992,7 +86074,7 @@
|
|
|
85992
86074
|
} = shapeBounds,
|
|
85993
86075
|
[startX, startY] = [x1 + ~~(randomGenerator() * fillingXStep * 2), y1 + ~~(randomGenerator() * fillingYStep * 2)];
|
|
85994
86076
|
for (let y = startY; y <= y2; y += fillingYStep) for (let x = startX; x <= x2; x += fillingXStep) {
|
|
85995
|
-
measureSprite(canvas, ctx, fillingWords, wi);
|
|
86077
|
+
measureSprite(canvas, ctx, fillingWords, wi, layoutConfig.measureCache);
|
|
85996
86078
|
const word = fillingWords[wi];
|
|
85997
86079
|
word.x = x, word.y = y;
|
|
85998
86080
|
const {
|
|
@@ -86131,7 +86213,7 @@
|
|
|
86131
86213
|
return this.progressiveResult;
|
|
86132
86214
|
}
|
|
86133
86215
|
doLayout() {
|
|
86134
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
86216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
86135
86217
|
const segmentationInput = this.segmentationInput,
|
|
86136
86218
|
segmentationOutput = segmentation(segmentationInput);
|
|
86137
86219
|
if (!segmentationOutput.segmentation.regions.length) return;
|
|
@@ -86158,35 +86240,36 @@
|
|
|
86158
86240
|
const layoutConfig = {
|
|
86159
86241
|
size: options.size,
|
|
86160
86242
|
ratio: options.ratio || .8,
|
|
86243
|
+
measureCache: null !== (_a = options.measureCache) && void 0 !== _a ? _a : new MapWordMeasureCache(),
|
|
86161
86244
|
shapeUrl: options.shape,
|
|
86162
86245
|
random: void 0 === options.random || options.random,
|
|
86163
|
-
textLayoutTimes: null !== (
|
|
86246
|
+
textLayoutTimes: null !== (_b = options.textLayoutTimes) && void 0 !== _b ? _b : 3,
|
|
86164
86247
|
removeWhiteBorder: options.removeWhiteBorder,
|
|
86165
|
-
layoutMode: null !== (
|
|
86166
|
-
fontSizeShrinkFactor: null !== (
|
|
86167
|
-
stepFactor: null !== (
|
|
86168
|
-
importantWordCount: null !== (
|
|
86248
|
+
layoutMode: null !== (_c = options.layoutMode) && void 0 !== _c ? _c : "default",
|
|
86249
|
+
fontSizeShrinkFactor: null !== (_d = options.fontSizeShrinkFactor) && void 0 !== _d ? _d : .8,
|
|
86250
|
+
stepFactor: null !== (_e = options.stepFactor) && void 0 !== _e ? _e : 1,
|
|
86251
|
+
importantWordCount: null !== (_f = options.importantWordCount) && void 0 !== _f ? _f : 10,
|
|
86169
86252
|
globalShinkLimit: options.globalShinkLimit || .2,
|
|
86170
|
-
fontSizeEnlargeFactor: null !== (
|
|
86171
|
-
fillingRatio: null !== (
|
|
86172
|
-
fillingTimes: null !== (
|
|
86173
|
-
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (
|
|
86174
|
-
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (
|
|
86253
|
+
fontSizeEnlargeFactor: null !== (_g = options.fontSizeEnlargeFactor) && void 0 !== _g ? _g : 1.5,
|
|
86254
|
+
fillingRatio: null !== (_h = options.fillingRatio) && void 0 !== _h ? _h : .7,
|
|
86255
|
+
fillingTimes: null !== (_j = options.fillingTimes) && void 0 !== _j ? _j : 4,
|
|
86256
|
+
fillingXStep: options.fillingXRatioStep ? Math.max(Math.floor(options.size[0] * options.fillingXRatioStep), 1) : null !== (_k = options.fillingXStep) && void 0 !== _k ? _k : 4,
|
|
86257
|
+
fillingYStep: options.fillingYRatioStep ? Math.max(Math.floor(options.size[1] * options.fillingYRatioStep), 1) : null !== (_l = options.fillingYStep) && void 0 !== _l ? _l : 4,
|
|
86175
86258
|
fillingInitialFontSize: options.fillingInitialFontSize,
|
|
86176
86259
|
fillingDeltaFontSize: options.fillingDeltaFontSize,
|
|
86177
|
-
fillingInitialOpacity: null !== (
|
|
86178
|
-
fillingDeltaOpacity: null !== (
|
|
86260
|
+
fillingInitialOpacity: null !== (_m = options.fillingInitialOpacity) && void 0 !== _m ? _m : .8,
|
|
86261
|
+
fillingDeltaOpacity: null !== (_o = options.fillingDeltaOpacity) && void 0 !== _o ? _o : .05,
|
|
86179
86262
|
getFillingFontFamily: simpleField(options.fillingFontFamily || "sans-serif"),
|
|
86180
86263
|
getFillingFontStyle: simpleField(options.fillingFontStyle || "normal"),
|
|
86181
86264
|
getFillingFontWeight: simpleField(options.fillingFontWeight || "normal"),
|
|
86182
|
-
getFillingPadding: simpleField(null !== (
|
|
86183
|
-
fillingRotateList: null !== (
|
|
86184
|
-
fillingDeltaFontSizeFactor: null !== (
|
|
86265
|
+
getFillingPadding: simpleField(null !== (_p = options.fillingPadding) && void 0 !== _p ? _p : .4),
|
|
86266
|
+
fillingRotateList: null !== (_q = options.fillingRotateList) && void 0 !== _q ? _q : [0, 90],
|
|
86267
|
+
fillingDeltaFontSizeFactor: null !== (_r = options.fillingDeltaFontSizeFactor) && void 0 !== _r ? _r : .2,
|
|
86185
86268
|
fillingColorList: options.fillingColorList || ["#537EF5"],
|
|
86186
86269
|
sameColorList: !1,
|
|
86187
|
-
minInitFontSize: null !== (
|
|
86188
|
-
minFontSize: null !== (
|
|
86189
|
-
minFillFontSize: null !== (
|
|
86270
|
+
minInitFontSize: null !== (_s = options.minInitFontSize) && void 0 !== _s ? _s : 10,
|
|
86271
|
+
minFontSize: null !== (_t = options.minFontSize) && void 0 !== _t ? _t : 4,
|
|
86272
|
+
minFillFontSize: null !== (_u = options.minFillFontSize) && void 0 !== _u ? _u : 2
|
|
86190
86273
|
},
|
|
86191
86274
|
sameColorList = colorListEqual(wordsConfig.colorList, layoutConfig.fillingColorList);
|
|
86192
86275
|
layoutConfig.sameColorList = sameColorList, initColorScale(data, wordsConfig, layoutConfig, options), initFillingWordsFontSize(data, wordsConfig, layoutConfig, segmentationOutput);
|
|
@@ -86233,8 +86316,8 @@
|
|
|
86233
86316
|
successedWords: successedWords,
|
|
86234
86317
|
failedWords: failedWords
|
|
86235
86318
|
} = cloud(words, layoutConfig, segmentationOutput),
|
|
86236
|
-
textKey = null !== (
|
|
86237
|
-
dataIndexKey = null !== (
|
|
86319
|
+
textKey = null !== (_w = null === (_v = options.text) || void 0 === _v ? void 0 : _v.field) && void 0 !== _w ? _w : "textKey",
|
|
86320
|
+
dataIndexKey = null !== (_x = options.dataIndexKey) && void 0 !== _x ? _x : "defaultDataIndexKey",
|
|
86238
86321
|
as = options.as ? Object.assign(Object.assign({}, OUTPUT), options.as) : OUTPUT;
|
|
86239
86322
|
let w, t;
|
|
86240
86323
|
const modKeywords = [];
|
|
@@ -102895,9 +102978,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102895
102978
|
return 'cartesian';
|
|
102896
102979
|
}
|
|
102897
102980
|
_createMarkerComponent() {
|
|
102898
|
-
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;
|
|
102981
|
+
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;
|
|
102899
102982
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
102900
|
-
const
|
|
102983
|
+
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"]);
|
|
102901
102984
|
let itemContentState = null;
|
|
102902
102985
|
let itemContentStyle = null;
|
|
102903
102986
|
let defaultStyle = {};
|
|
@@ -102907,61 +102990,61 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102907
102990
|
dx: 0,
|
|
102908
102991
|
dy: 0
|
|
102909
102992
|
};
|
|
102910
|
-
itemContentStyle = transformLabelAttributes(Object.assign(Object.assign({}, label), { style: merge$1(defaultStyle, (_c = (_b = label === null || label === void 0 ? void 0 : label.
|
|
102993
|
+
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);
|
|
102911
102994
|
}
|
|
102912
102995
|
else if (type === 'richText') {
|
|
102913
|
-
itemContentState = (
|
|
102996
|
+
itemContentState = (_e = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _e !== void 0 ? _e : state;
|
|
102914
102997
|
defaultStyle = {
|
|
102915
102998
|
width: 100,
|
|
102916
102999
|
height: 100
|
|
102917
103000
|
};
|
|
102918
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
103001
|
+
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);
|
|
102919
103002
|
}
|
|
102920
103003
|
else if (type === 'symbol') {
|
|
102921
|
-
itemContentState = (
|
|
103004
|
+
itemContentState = (_h = symbol === null || symbol === void 0 ? void 0 : symbol.state) !== null && _h !== void 0 ? _h : state;
|
|
102922
103005
|
defaultStyle = {
|
|
102923
103006
|
symbolType: 'star',
|
|
102924
103007
|
fill: 'rgb(48, 115, 242)',
|
|
102925
103008
|
fillOpacity: 0.8,
|
|
102926
103009
|
size: 20
|
|
102927
103010
|
};
|
|
102928
|
-
itemContentStyle = transformToGraphic(transformStyle(merge$1(defaultStyle, (
|
|
103011
|
+
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));
|
|
102929
103012
|
}
|
|
102930
103013
|
else if (type === 'image') {
|
|
102931
|
-
itemContentState = (
|
|
103014
|
+
itemContentState = (_l = image === null || image === void 0 ? void 0 : image.state) !== null && _l !== void 0 ? _l : state;
|
|
102932
103015
|
defaultStyle = {
|
|
102933
103016
|
width: 80,
|
|
102934
103017
|
height: 80
|
|
102935
103018
|
};
|
|
102936
|
-
itemContentStyle = transformStyle(merge$1(defaultStyle, (
|
|
103019
|
+
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);
|
|
102937
103020
|
}
|
|
102938
103021
|
else if (type === 'custom') {
|
|
102939
|
-
itemContentState = (
|
|
102940
|
-
itemContentStyle = transformStyle((
|
|
103022
|
+
itemContentState = (_p = customMark === null || customMark === void 0 ? void 0 : customMark.state) !== null && _p !== void 0 ? _p : state;
|
|
103023
|
+
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);
|
|
102941
103024
|
}
|
|
102942
103025
|
const markPointAttrs = {
|
|
102943
103026
|
zIndex: this.layoutZIndex,
|
|
102944
|
-
interactive: (
|
|
102945
|
-
hover: (
|
|
102946
|
-
select: (
|
|
103027
|
+
interactive: (_s = this._spec.interactive) !== null && _s !== void 0 ? _s : true,
|
|
103028
|
+
hover: (_t = this._spec.interactive) !== null && _t !== void 0 ? _t : true,
|
|
103029
|
+
select: (_u = this._spec.interactive) !== null && _u !== void 0 ? _u : true,
|
|
102947
103030
|
position: { x: 0, y: 0 },
|
|
102948
|
-
clipInRange: (
|
|
103031
|
+
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
102949
103032
|
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) }),
|
|
102950
103033
|
targetSymbol: {
|
|
102951
|
-
offset: (
|
|
102952
|
-
visible: (
|
|
102953
|
-
size: (
|
|
103034
|
+
offset: (_w = targetSymbol.offset) !== null && _w !== void 0 ? _w : 0,
|
|
103035
|
+
visible: (_x = targetSymbol.visible) !== null && _x !== void 0 ? _x : false,
|
|
103036
|
+
size: (_y = targetSymbol.size) !== null && _y !== void 0 ? _y : 20,
|
|
102954
103037
|
style: transformStyle(targetSymbol.style, this._markerData, this._markAttributeContext)
|
|
102955
103038
|
},
|
|
102956
103039
|
state: {
|
|
102957
|
-
line: transformState((
|
|
102958
|
-
lineStartSymbol: transformState((
|
|
102959
|
-
lineEndSymbol: transformState((
|
|
103040
|
+
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),
|
|
103041
|
+
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),
|
|
103042
|
+
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),
|
|
102960
103043
|
itemContent: transformState(itemContentState, this._markerData, this._markAttributeContext),
|
|
102961
|
-
textBackground: transformState((
|
|
102962
|
-
targetItem: transformState((
|
|
103044
|
+
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),
|
|
103045
|
+
targetItem: transformState((_8 = (_7 = this._spec.targetSymbol) === null || _7 === void 0 ? void 0 : _7.state) !== null && _8 !== void 0 ? _8 : {}, this._markerData, this._markAttributeContext)
|
|
102963
103046
|
},
|
|
102964
|
-
animation: (
|
|
103047
|
+
animation: (_9 = this._spec.animation) !== null && _9 !== void 0 ? _9 : false,
|
|
102965
103048
|
animationEnter: this._spec.animationEnter,
|
|
102966
103049
|
animationExit: this._spec.animationExit,
|
|
102967
103050
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -107971,6 +108054,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
107971
108054
|
exports.transformBounds = transformBounds;
|
|
107972
108055
|
exports.transformBoundsWithMatrix = transformBoundsWithMatrix;
|
|
107973
108056
|
exports.transformColorSchemeToStandardStruct = transformColorSchemeToStandardStruct;
|
|
108057
|
+
exports.transformFunctionAttribute = transformFunctionAttribute;
|
|
107974
108058
|
exports.transformToGraphic = transformToGraphic;
|
|
107975
108059
|
exports.treeTransform = transform$5;
|
|
107976
108060
|
exports.treemapTransform = transform$4;
|