tvcharts 0.7.78 → 0.7.80

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/dist/echarts.js CHANGED
@@ -291,109 +291,6 @@ function setPlatformAPI(newPlatformApis) {
291
291
  }
292
292
  }
293
293
 
294
- // node_modules/tvrender/src/core/LRU.ts
295
- var Entry = class {
296
- constructor(val) {
297
- this.value = val;
298
- }
299
- };
300
- var LinkedList = class {
301
- constructor() {
302
- this._len = 0;
303
- }
304
- insert(val) {
305
- const entry = new Entry(val);
306
- this.insertEntry(entry);
307
- return entry;
308
- }
309
- insertEntry(entry) {
310
- if (!this.head) {
311
- this.head = this.tail = entry;
312
- } else {
313
- this.tail.next = entry;
314
- entry.prev = this.tail;
315
- entry.next = null;
316
- this.tail = entry;
317
- }
318
- this._len++;
319
- }
320
- remove(entry) {
321
- const prev = entry.prev;
322
- const next = entry.next;
323
- if (prev) {
324
- prev.next = next;
325
- } else {
326
- this.head = next;
327
- }
328
- if (next) {
329
- next.prev = prev;
330
- } else {
331
- this.tail = prev;
332
- }
333
- entry.next = entry.prev = null;
334
- this._len--;
335
- }
336
- len() {
337
- return this._len;
338
- }
339
- clear() {
340
- this.head = this.tail = null;
341
- this._len = 0;
342
- }
343
- };
344
- var LRU = class {
345
- constructor(maxSize) {
346
- this._list = new LinkedList();
347
- this._maxSize = 10;
348
- this._map = {};
349
- this._maxSize = maxSize;
350
- }
351
- put(key, value) {
352
- const list = this._list;
353
- const map7 = this._map;
354
- let removed = null;
355
- if (map7[key] == null) {
356
- const len2 = list.len();
357
- let entry = this._lastRemovedEntry;
358
- if (len2 >= this._maxSize && len2 > 0) {
359
- const leastUsedEntry = list.head;
360
- list.remove(leastUsedEntry);
361
- delete map7[leastUsedEntry.key];
362
- removed = leastUsedEntry.value;
363
- this._lastRemovedEntry = leastUsedEntry;
364
- }
365
- if (entry) {
366
- entry.value = value;
367
- } else {
368
- entry = new Entry(value);
369
- }
370
- entry.key = key;
371
- list.insertEntry(entry);
372
- map7[key] = entry;
373
- }
374
- return removed;
375
- }
376
- get(key) {
377
- const entry = this._map[key];
378
- const list = this._list;
379
- if (entry != null) {
380
- if (entry !== list.tail) {
381
- list.remove(entry);
382
- list.insertEntry(entry);
383
- }
384
- return entry.value;
385
- }
386
- }
387
- clear() {
388
- this._list.clear();
389
- this._map = {};
390
- }
391
- len() {
392
- return this._list.len();
393
- }
394
- };
395
- var LRU_default = LRU;
396
-
397
294
  // node_modules/tvrender/src/core/util.ts
398
295
  var BUILTIN_OBJECT = reduce([
399
296
  "Function",
@@ -879,76 +776,60 @@ function hasOwn(own, prop) {
879
776
  function noop() {
880
777
  }
881
778
  var RADIAN_TO_DEGREE = 180 / Math.PI;
882
- var colorCache = new LRU_default(1e4);
779
+ var TypedArray = typeof Float32Array !== "undefined" ? Float32Array : Array;
883
780
  function hexToRgba(hex) {
884
781
  hex = hex.replace(/^#/, "");
885
782
  if (hex.length === 3) {
886
783
  hex = hex.split("").map((x) => x.repeat(2)).join("");
887
784
  }
888
785
  const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) : 255;
889
- return {
890
- r: parseInt(hex.slice(0, 2), 16),
891
- g: parseInt(hex.slice(2, 4), 16),
892
- b: parseInt(hex.slice(4, 6), 16),
893
- a: a / 255
894
- };
786
+ return [
787
+ parseInt(hex.slice(0, 2), 16),
788
+ parseInt(hex.slice(2, 4), 16),
789
+ parseInt(hex.slice(4, 6), 16),
790
+ a / 255
791
+ ];
895
792
  }
896
- var defaultRGB = {r: 0, g: 0, b: 0, a: 0};
793
+ var defaultRGB = [0, 0, 0, 0];
897
794
  function parseRgbaStringFast(str) {
898
- if (str.charCodeAt(0) !== 114 || str.charCodeAt(1) !== 103 || str.charCodeAt(2) !== 98)
899
- return defaultRGB;
900
795
  const isRGBA = str.charCodeAt(3) === 97;
901
796
  const openParenIdx = isRGBA ? 4 : 3;
902
- if (str.charCodeAt(openParenIdx) !== 40 || str.charCodeAt(str.length - 1) !== 41)
903
- return defaultRGB;
904
- const nums = [];
905
- let num = 0, fracDiv = 0;
797
+ const nums = new TypedArray(4);
798
+ let num = 0, fracDiv = 0, index = 0;
906
799
  for (let i = openParenIdx + 1; i < str.length - 1; i++) {
907
800
  const c = str.charCodeAt(i);
908
801
  if (c >= 48 && c <= 57) {
909
- if (fracDiv > 0) {
802
+ if (fracDiv) {
910
803
  num = num * 10 + (c - 48);
911
804
  fracDiv *= 10;
912
805
  } else {
913
806
  num = num * 10 + (c - 48);
914
807
  }
915
808
  } else if (c === 46) {
916
- if (fracDiv === 0)
809
+ if (!fracDiv)
917
810
  fracDiv = 1;
918
811
  } else if (c === 44) {
919
- nums.push(fracDiv > 0 ? num / fracDiv : num);
812
+ if (index < 4) {
813
+ nums[index++] = fracDiv ? num / fracDiv : num;
814
+ }
920
815
  num = 0;
921
816
  fracDiv = 0;
922
- if (nums.length === 4)
923
- break;
924
- } else {
925
817
  }
926
818
  }
927
- if (nums.length < 4) {
928
- nums.push(fracDiv > 0 ? num / fracDiv : num);
819
+ if (index < 4 && (num > 0 || fracDiv > 0)) {
820
+ nums[index++] = fracDiv ? num / fracDiv : num;
929
821
  }
930
- if (nums.length < 3)
931
- return defaultRGB;
932
- return {
933
- r: nums[0],
934
- g: nums[1],
935
- b: nums[2],
936
- a: nums[3] !== void 0 ? nums[3] : 1
937
- };
822
+ if (index === 3) {
823
+ nums[3] = 1;
824
+ }
825
+ return nums;
938
826
  }
939
827
  function colorToRgba(color2 = "") {
940
- let rgbaColor;
828
+ let rgbaColor = defaultRGB;
941
829
  if (color2.startsWith("rgb")) {
942
830
  rgbaColor = parseRgbaStringFast(color2);
943
831
  } else if (color2.startsWith("#")) {
944
832
  rgbaColor = hexToRgba(color2);
945
- } else {
946
- rgbaColor = {
947
- r: 0,
948
- g: 0,
949
- b: 0,
950
- a: 0
951
- };
952
833
  }
953
834
  return rgbaColor;
954
835
  }
@@ -3651,6 +3532,111 @@ __export(color_exports, {
3651
3532
  stringify: () => stringify,
3652
3533
  toHex: () => toHex
3653
3534
  });
3535
+
3536
+ // node_modules/tvrender/src/core/LRU.ts
3537
+ var Entry = class {
3538
+ constructor(val) {
3539
+ this.value = val;
3540
+ }
3541
+ };
3542
+ var LinkedList = class {
3543
+ constructor() {
3544
+ this._len = 0;
3545
+ }
3546
+ insert(val) {
3547
+ const entry = new Entry(val);
3548
+ this.insertEntry(entry);
3549
+ return entry;
3550
+ }
3551
+ insertEntry(entry) {
3552
+ if (!this.head) {
3553
+ this.head = this.tail = entry;
3554
+ } else {
3555
+ this.tail.next = entry;
3556
+ entry.prev = this.tail;
3557
+ entry.next = null;
3558
+ this.tail = entry;
3559
+ }
3560
+ this._len++;
3561
+ }
3562
+ remove(entry) {
3563
+ const prev = entry.prev;
3564
+ const next = entry.next;
3565
+ if (prev) {
3566
+ prev.next = next;
3567
+ } else {
3568
+ this.head = next;
3569
+ }
3570
+ if (next) {
3571
+ next.prev = prev;
3572
+ } else {
3573
+ this.tail = prev;
3574
+ }
3575
+ entry.next = entry.prev = null;
3576
+ this._len--;
3577
+ }
3578
+ len() {
3579
+ return this._len;
3580
+ }
3581
+ clear() {
3582
+ this.head = this.tail = null;
3583
+ this._len = 0;
3584
+ }
3585
+ };
3586
+ var LRU = class {
3587
+ constructor(maxSize) {
3588
+ this._list = new LinkedList();
3589
+ this._maxSize = 10;
3590
+ this._map = {};
3591
+ this._maxSize = maxSize;
3592
+ }
3593
+ put(key, value) {
3594
+ const list = this._list;
3595
+ const map7 = this._map;
3596
+ let removed = null;
3597
+ if (map7[key] == null) {
3598
+ const len2 = list.len();
3599
+ let entry = this._lastRemovedEntry;
3600
+ if (len2 >= this._maxSize && len2 > 0) {
3601
+ const leastUsedEntry = list.head;
3602
+ list.remove(leastUsedEntry);
3603
+ delete map7[leastUsedEntry.key];
3604
+ removed = leastUsedEntry.value;
3605
+ this._lastRemovedEntry = leastUsedEntry;
3606
+ }
3607
+ if (entry) {
3608
+ entry.value = value;
3609
+ } else {
3610
+ entry = new Entry(value);
3611
+ }
3612
+ entry.key = key;
3613
+ list.insertEntry(entry);
3614
+ map7[key] = entry;
3615
+ }
3616
+ return removed;
3617
+ }
3618
+ get(key) {
3619
+ const entry = this._map[key];
3620
+ const list = this._list;
3621
+ if (entry != null) {
3622
+ if (entry !== list.tail) {
3623
+ list.remove(entry);
3624
+ list.insertEntry(entry);
3625
+ }
3626
+ return entry.value;
3627
+ }
3628
+ }
3629
+ clear() {
3630
+ this._list.clear();
3631
+ this._map = {};
3632
+ }
3633
+ len() {
3634
+ return this._list.len();
3635
+ }
3636
+ };
3637
+ var LRU_default = LRU;
3638
+
3639
+ // node_modules/tvrender/src/tool/color.ts
3654
3640
  var kCSSColorTable = {
3655
3641
  transparent: [0, 0, 0, 0],
3656
3642
  aliceblue: [240, 248, 255, 1],
@@ -3860,20 +3846,20 @@ function copyRgba(out2, a) {
3860
3846
  out2[3] = a[3];
3861
3847
  return out2;
3862
3848
  }
3863
- var colorCache2 = new LRU_default(20);
3849
+ var colorCache = new LRU_default(20);
3864
3850
  var lastRemovedArr = null;
3865
3851
  function putToCache(colorStr, rgbaArr) {
3866
3852
  if (lastRemovedArr) {
3867
3853
  copyRgba(lastRemovedArr, rgbaArr);
3868
3854
  }
3869
- lastRemovedArr = colorCache2.put(colorStr, lastRemovedArr || rgbaArr.slice());
3855
+ lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());
3870
3856
  }
3871
3857
  function parse(colorStr, rgbaArr) {
3872
3858
  if (!colorStr) {
3873
3859
  return;
3874
3860
  }
3875
3861
  rgbaArr = rgbaArr || [];
3876
- let cached = colorCache2.get(colorStr);
3862
+ let cached = colorCache.get(colorStr);
3877
3863
  if (cached) {
3878
3864
  return copyRgba(rgbaArr, cached);
3879
3865
  }
@@ -7259,7 +7245,7 @@ function getElementSSRData(el) {
7259
7245
  function registerSSRDataGetter(getter) {
7260
7246
  ssrDataGetter = getter;
7261
7247
  }
7262
- var version = "5.6.84";
7248
+ var version = "5.6.87";
7263
7249
 
7264
7250
  // src/util/number.ts
7265
7251
  var RADIAN_EPSILON = 1e-4;
@@ -9301,8 +9287,8 @@ var PathProxy2 = class {
9301
9287
  return this;
9302
9288
  }
9303
9289
  fillStyle(color2) {
9304
- const {r, g, b, a} = colorToRgba(color2);
9305
- this.addData(CMD.F, r, g, b, a);
9290
+ const rgbas = colorToRgba(color2);
9291
+ this.addData(CMD.F, rgbas[0], rgbas[1], rgbas[2], rgbas[3]);
9306
9292
  if (this._ctx) {
9307
9293
  this._ctx.fillStyle = color2;
9308
9294
  this._ctx.fill();
@@ -9310,8 +9296,8 @@ var PathProxy2 = class {
9310
9296
  return this;
9311
9297
  }
9312
9298
  strokeStyle(color2) {
9313
- const {r, g, b, a} = colorToRgba(color2);
9314
- this.addData(CMD.S, r, g, b, a);
9299
+ const rgbas = colorToRgba(color2);
9300
+ this.addData(CMD.S, rgbas[0], rgbas[1], rgbas[2], rgbas[3]);
9315
9301
  if (this._ctx) {
9316
9302
  this._ctx.strokeStyle = color2;
9317
9303
  this._ctx.stroke();
@@ -22582,7 +22568,7 @@ var ArrowUp = Path_default.extend({
22582
22568
  ctx2.lineTo(cx - width + rectWidth, cy + height);
22583
22569
  ctx2.lineTo(cx - width + rectWidth, triangleY);
22584
22570
  ctx2.lineTo(cx - width, triangleY);
22585
- ctx2.closePath();
22571
+ ctx2.lineTo(cx, cy - height);
22586
22572
  }
22587
22573
  });
22588
22574
  var ArrowUpClose = Path_default.extend({
@@ -22608,7 +22594,7 @@ var ArrowUpClose = Path_default.extend({
22608
22594
  ctx2.lineTo(cx - width + rectWidth, cy + height);
22609
22595
  ctx2.lineTo(cx - width + rectWidth, triangleY);
22610
22596
  ctx2.lineTo(cx - width, triangleY);
22611
- ctx2.closePath();
22597
+ ctx2.lineTo(cx, cy - height);
22612
22598
  ctx2.rect(cx - width + 0.5, cy - height - 0.5 - rectHeight, shape.width - 0.5, rectHeight);
22613
22599
  }
22614
22600
  });
@@ -22634,7 +22620,7 @@ var ArrowDown = Path_default.extend({
22634
22620
  ctx2.lineTo(cx - width + rectWidth, cy - height);
22635
22621
  ctx2.lineTo(cx - width + rectWidth, triangleY);
22636
22622
  ctx2.lineTo(cx - width, triangleY);
22637
- ctx2.closePath();
22623
+ ctx2.lineTo(cx, cy + height);
22638
22624
  }
22639
22625
  });
22640
22626
  var ArrowDownClose = Path_default.extend({
@@ -22660,7 +22646,7 @@ var ArrowDownClose = Path_default.extend({
22660
22646
  ctx2.lineTo(cx - width + rectWidth, cy - height);
22661
22647
  ctx2.lineTo(cx - width + rectWidth, triangleY);
22662
22648
  ctx2.lineTo(cx - width, triangleY);
22663
- ctx2.closePath();
22649
+ ctx2.lineTo(cx, cy + height);
22664
22650
  ctx2.rect(cx - width + 0.5, cy + height + 0.5, shape.width - 0.5, rectHeight);
22665
22651
  }
22666
22652
  });
@@ -39345,7 +39331,7 @@ var Cartesian2D = class extends Cartesian_default {
39345
39331
  }
39346
39332
  const xAxis = this.getAxis("x");
39347
39333
  const yAxis = this.getAxis("y");
39348
- const baseValue = this.getBaseValue();
39334
+ const baseValue = yAxis.scale.type === "percent" ? this.getBaseValue() : void 0;
39349
39335
  out2[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp2));
39350
39336
  out2[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp2, baseValue));
39351
39337
  return out2;
@@ -55915,11 +55901,10 @@ var GradientBarPath = class extends Path_default {
55915
55901
  const offset = width / 2;
55916
55902
  const gap = offset >= 1 ? 1 : 0;
55917
55903
  for (let index = 0; index < points4.length; index++) {
55918
- const {point, color: color2} = points4[index];
55919
- if (isPointNull7(point)) {
55904
+ if (isPointNull7(points4[index].point)) {
55920
55905
  continue;
55921
55906
  }
55922
- const [x, y] = point;
55907
+ const [x, y] = points4[index].point;
55923
55908
  const left = Math.floor(x - offset);
55924
55909
  const leftX = left + gap;
55925
55910
  const rightX = Math.floor(left + width);
@@ -55930,7 +55915,7 @@ var GradientBarPath = class extends Path_default {
55930
55915
  ctx2.lineTo(rightX, baseY);
55931
55916
  ctx2.lineTo(leftX, baseY);
55932
55917
  ctx2.lineTo(leftX, dataY);
55933
- ctx2.fillStyle(color2);
55918
+ ctx2.fillStyle(points4[index].color);
55934
55919
  }
55935
55920
  }
55936
55921
  };
@@ -55966,15 +55951,13 @@ var GradientHistogramPlotPath = class extends Path_default {
55966
55951
  buildPath(ctx2, shape) {
55967
55952
  const {points: points4, baseY} = shape;
55968
55953
  for (let index = 0; index < points4.length; index++) {
55969
- const {point, color: color2} = points4[index];
55970
- if (isPointNull8(point)) {
55954
+ if (isPointNull8(points4[index].point)) {
55971
55955
  continue;
55972
55956
  }
55973
55957
  ctx2.beginPathFill();
55974
- const [x, y] = point;
55975
- ctx2.moveTo(x, y);
55976
- ctx2.lineTo(x, baseY);
55977
- ctx2.strokeStyle(color2);
55958
+ ctx2.moveTo(points4[index].point[0], points4[index].point[1]);
55959
+ ctx2.lineTo(points4[index].point[0], baseY);
55960
+ ctx2.strokeStyle(points4[index].color);
55978
55961
  }
55979
55962
  }
55980
55963
  };
@@ -55995,6 +55978,7 @@ var SymbolPath = class extends Path_default {
55995
55978
  const isShadow = shape.isShadow;
55996
55979
  const symbolProxy = this.symbolProxy;
55997
55980
  const symbolProxyShape = symbolProxy.shape;
55981
+ let lastColor = "";
55998
55982
  for (let i = 0; i < points4.length; i++) {
55999
55983
  const {point, color: color2} = points4[i];
56000
55984
  const size = isShadow ? points4[i].size * 3 : points4[i].size;
@@ -56002,14 +55986,22 @@ var SymbolPath = class extends Path_default {
56002
55986
  if (isNaN(x) || isNaN(y)) {
56003
55987
  continue;
56004
55988
  }
56005
- path.beginPathFill();
55989
+ const colorChanged = lastColor && lastColor !== color2;
55990
+ if (colorChanged) {
55991
+ path.fillStyle(lastColor);
55992
+ path.beginPathFill();
55993
+ }
56006
55994
  symbolProxyShape.x = x - size / 2;
56007
55995
  symbolProxyShape.y = y - size / 2;
56008
55996
  symbolProxyShape.width = size;
56009
55997
  symbolProxyShape.height = size;
56010
55998
  symbolProxy.buildPath(path, symbolProxyShape, true);
56011
- path.closePath();
56012
- path.fillStyle(color2);
55999
+ if (lastColor !== color2) {
56000
+ lastColor = color2;
56001
+ }
56002
+ }
56003
+ if (lastColor) {
56004
+ path.fillStyle(lastColor);
56013
56005
  }
56014
56006
  }
56015
56007
  };
@@ -56596,8 +56588,8 @@ var linesPlotLayout = {
56596
56588
  if (showLast && lastIndex - data.getRawIndex(i) >= showLast) {
56597
56589
  continue;
56598
56590
  }
56599
- const isRawLast = i + 1 === params.end ? data.getRawIndex(i) === lastIndex : false;
56600
- const isRawFirst = i === 0 ? data.getRawIndex(i) === 0 : false;
56591
+ const isRawLast = i + 1 === params.end ? data.getRawIndex(i) === lastIndex : void 0;
56592
+ const isRawFirst = i === 0 ? data.getRawIndex(i) === 0 : void 0;
56601
56593
  const x = store.get(dimIdx0, i);
56602
56594
  const y = store.get(dimIdx1, i);
56603
56595
  if (connectNulls && isNaN(y)) {
@@ -56609,7 +56601,7 @@ var linesPlotLayout = {
56609
56601
  color: color2,
56610
56602
  type = "solid",
56611
56603
  width = "1"
56612
- } = itemModal.lineStyle;
56604
+ } = itemModal.lineStyle || {};
56613
56605
  pointInfos.push({
56614
56606
  point,
56615
56607
  width,
@@ -56646,12 +56638,12 @@ var linesPlotLayout = {
56646
56638
  const nextPointInfo = pointInfos[i + 1];
56647
56639
  let stylePointInfo = isSingle ? pointInfo : nextPointInfo;
56648
56640
  if (!stylePointInfo) {
56649
- const itemModal = lineData.getRawDataItem(params.end);
56641
+ const itemModel = lineData.getItemModel(params.end);
56650
56642
  const {
56651
56643
  color: color3,
56652
56644
  type: type2 = "solid",
56653
56645
  width: width2 = "1"
56654
- } = itemModal.lineStyle;
56646
+ } = itemModel.get("lineStyle");
56655
56647
  stylePointInfo = {
56656
56648
  color: color3,
56657
56649
  type: type2,
@@ -56943,10 +56935,10 @@ var StrategyView2 = class extends Chart_default {
56943
56935
  fill: textColor ?? "#fff",
56944
56936
  fontSize: 12,
56945
56937
  stroke: textBorder,
56946
- lineWidth: textBorderWidth
56947
- },
56948
- x: point[0],
56949
- y: point[1]
56938
+ lineWidth: textBorderWidth,
56939
+ x: point[0],
56940
+ y: point[1]
56941
+ }
56950
56942
  });
56951
56943
  el.states.emphasis = emphasisState;
56952
56944
  symbolGroup.add(el);
@@ -59559,6 +59551,7 @@ var SymbolPath3 = class extends Path_default {
59559
59551
  const symbolProxyShape = symbolProxy.shape;
59560
59552
  const needCenter = shape.needCenter ?? true;
59561
59553
  const isLine = shape.isLine;
59554
+ let lastColor = "";
59562
59555
  for (let i = 0; i < points4.length; i++) {
59563
59556
  const {point, color: color2, size, offset = [0, 0]} = points4[i];
59564
59557
  const [width, height] = size;
@@ -59566,14 +59559,23 @@ var SymbolPath3 = class extends Path_default {
59566
59559
  if (isNaN(x) || isNaN(y)) {
59567
59560
  continue;
59568
59561
  }
59562
+ const colorChanged = lastColor && lastColor !== color2;
59569
59563
  const [xOffset, yOffset] = offset;
59570
- path.beginPathFill();
59564
+ if (colorChanged) {
59565
+ isLine ? path.strokeStyle(lastColor) : path.fillStyle(lastColor);
59566
+ path.beginPathFill();
59567
+ }
59571
59568
  symbolProxyShape.x = x - (needCenter ? width / 2 : 0) + xOffset;
59572
59569
  symbolProxyShape.y = y - (needCenter ? height / 2 : 0) + yOffset;
59573
59570
  symbolProxyShape.width = width;
59574
59571
  symbolProxyShape.height = height;
59575
59572
  symbolProxy.buildPath(path, {...symbolProxyShape, ...points4[i].shape}, true);
59576
- isLine ? path.strokeStyle(color2) : path.fillStyle(color2);
59573
+ if (lastColor !== color2) {
59574
+ lastColor = color2;
59575
+ }
59576
+ }
59577
+ if (lastColor) {
59578
+ isLine ? path.strokeStyle(lastColor) : path.fillStyle(lastColor);
59577
59579
  }
59578
59580
  }
59579
59581
  };
@@ -59641,10 +59643,10 @@ var LabelsView2 = class extends Chart_default {
59641
59643
  fontFamily,
59642
59644
  fontSize,
59643
59645
  stroke: textBorderColor,
59644
- lineWidth: textBorderWidth
59645
- },
59646
- x: point[0] + offset[0],
59647
- y: point[1] + offset[1]
59646
+ lineWidth: textBorderWidth,
59647
+ x: point[0] + offset[0],
59648
+ y: point[1] + offset[1]
59649
+ }
59648
59650
  });
59649
59651
  el.states.emphasis = emphasisState;
59650
59652
  textGroup.add(el);
@@ -59969,10 +59971,24 @@ function changeLabelOffsetBySymbol(symbol, symbolRect, shape, oldOffset) {
59969
59971
  }
59970
59972
  return oldOffset;
59971
59973
  }
59974
+ var getTextRect2 = (text, font) => {
59975
+ let width = 0;
59976
+ let height = 0;
59977
+ text.split("\n").forEach((item) => {
59978
+ height = height + getLineHeight(font);
59979
+ width = Math.max(width, getWidth(item, font));
59980
+ });
59981
+ return {
59982
+ width,
59983
+ height
59984
+ };
59985
+ };
59986
+ var defaultOffset = [0, 0];
59987
+ var defaultLabel = {};
59972
59988
  var labelsLayout = {
59973
59989
  seriesType: "labels",
59974
59990
  plan: createRenderPlanner(),
59975
- reset: function(seriesModel) {
59991
+ reset: function(seriesModel, ecModel) {
59976
59992
  const data = seriesModel.getData();
59977
59993
  const coordSys = seriesModel.coordinateSystem;
59978
59994
  if (!coordSys) {
@@ -59990,6 +60006,9 @@ var labelsLayout = {
59990
60006
  const xOffset = seriesModel.get("offset") || 0;
59991
60007
  const price = getYByLocation2(seriesModel);
59992
60008
  const showLast = seriesModel.get("showLast");
60009
+ const gTextStyleModel = ecModel.getModel("textStyle");
60010
+ const gfontSize = gTextStyleModel && (gTextStyleModel.getShallow("fontSize") || 12) + "px";
60011
+ const gfontFamily = gTextStyleModel && gTextStyleModel.getShallow("fontFamily") || "sans-serif";
59993
60012
  return {
59994
60013
  progress(params, labelsData) {
59995
60014
  const symbolStyleMap = {};
@@ -60008,20 +60027,19 @@ var labelsLayout = {
60008
60027
  }
60009
60028
  const itemModel = data.getItemModel(i);
60010
60029
  const yloc = itemModel.get("yloc");
60011
- const symbol = itemModel.getShallow("symbol");
60012
- let symbolSize = itemModel.getShallow("symbolSize");
60013
- const symbolOffset = itemModel.getShallow("symbolOffset") || [0, 0];
60030
+ const symbol = itemModel.get("symbol");
60031
+ let symbolSize = itemModel.get("symbolSize");
60032
+ const symbolOffset = itemModel.get("symbolOffset") || defaultOffset;
60014
60033
  let symbolShape = {};
60015
- const style = itemModel.getModel("itemStyle").getItemStyle();
60016
- const labelModel = itemModel.getModel("label");
60017
- let oldOffset = labelModel.get("offset") || [0, 0];
60018
- const align = labelModel.get("align");
60034
+ const labelModel = itemModel.option.label || defaultLabel;
60035
+ let oldOffset = labelModel.offset || defaultOffset;
60036
+ const align = labelModel.align;
60019
60037
  const size = itemModel.get("size") ?? "normal";
60020
- const text = labelModel.get("formatter");
60038
+ const text = labelModel.formatter;
60021
60039
  const isLabel = labelSymbolByType[symbol];
60022
- const textShow = labelModel.get("show");
60023
- let fontSize = labelModel.getShallow("fontSize");
60024
- let position2 = labelModel.get("position") || "top";
60040
+ const textShow = labelModel.show;
60041
+ let fontSize = labelModel.fontSize;
60042
+ let position2 = labelModel.position || "top";
60025
60043
  if (location === "top" || location === "belowbar") {
60026
60044
  position2 = "bottom";
60027
60045
  }
@@ -60029,15 +60047,18 @@ var labelsLayout = {
60029
60047
  position2 = "inside";
60030
60048
  }
60031
60049
  if (textShow) {
60032
- labelModel.option.fontSize = fontSize = getSymbolLabelFontSize(size, bandWidth);
60050
+ labelModel.fontSize = fontSize = getSymbolLabelFontSize(size, bandWidth);
60033
60051
  }
60034
60052
  let textRect = void 0;
60035
60053
  if (textShow) {
60036
- textRect = labelModel.getTextRect(text);
60054
+ textRect = getTextRect2(text, `
60055
+ ${fontSize || gfontSize}
60056
+ ${labelModel.fontFamily || gfontFamily}
60057
+ `);
60037
60058
  if (isLabel) {
60038
60059
  symbolSize = [textRect.width + HPadding, textRect.height + VPadding];
60039
60060
  }
60040
- const align2 = labelModel.get("align");
60061
+ const align2 = labelModel.align;
60041
60062
  if (align2 === "left") {
60042
60063
  oldOffset = [-textRect.width / 2, 0];
60043
60064
  } else if (align2 === "right") {
@@ -60066,19 +60087,19 @@ var labelsLayout = {
60066
60087
  if (symbol === "labelCenter") {
60067
60088
  symbolPoint[1] = symbolPoint[1] + symbolRect[1] / 2;
60068
60089
  }
60069
- if (symbol !== "none" && style.fill) {
60090
+ if (symbol !== "none" && itemModel.option.itemStyle.color) {
60070
60091
  const symbolStyles = symbolStyleMap[symbol] || [];
60071
60092
  symbolStyles.push({
60072
60093
  point: symbolPoint,
60073
60094
  size: symbolRect,
60074
60095
  offset: symbolOffset,
60075
- color: style.fill,
60096
+ color: itemModel.option.itemStyle.color,
60076
60097
  shape: symbolShape
60077
60098
  });
60078
60099
  symbolStyleMap[symbol] = symbolStyles;
60079
60100
  }
60080
60101
  if (textShow) {
60081
- const labelPoint = [...symbolPoint];
60102
+ const labelPoint = symbolPoint.slice();
60082
60103
  if (position2 === "inside") {
60083
60104
  labelPoint[1] = labelPoint[1] - textRect.height / 2 - symbolRect[1] / 2;
60084
60105
  } else if (position2 === "top") {
@@ -60091,11 +60112,11 @@ var labelsLayout = {
60091
60112
  align: align || "center",
60092
60113
  point: labelPoint,
60093
60114
  fontSize,
60094
- textColor: labelModel.get("color") || "#fff",
60095
- fontFamily: labelModel.get("fontFamily"),
60115
+ textColor: labelModel.color || "#2962FF",
60116
+ fontFamily: labelModel.fontFamily,
60096
60117
  offset: [oldOffset[0] + symbolOffset[0], oldOffset[1] + symbolOffset[1]],
60097
- textBorderColor: labelModel.get("textBorderColor"),
60098
- textBorderWidth: labelModel.get("textBorderWidth")
60118
+ textBorderColor: labelModel.textBorderColor,
60119
+ textBorderWidth: labelModel.textBorderWidth
60099
60120
  });
60100
60121
  }
60101
60122
  }
@@ -60429,8 +60450,8 @@ var FillsView_default = FillsView;
60429
60450
  // src/chart/fills/fillsLayout.ts
60430
60451
  function getKey(itemModel) {
60431
60452
  let key = itemModel.option?.color;
60432
- if (!key && itemModel.get("topValue") !== void 0) {
60433
- key = `${itemModel.get("topColor") || "rgba(255,255,255,0)"}:${itemModel.get("topValue")}:${itemModel.get("bottomColor") || "rgba(255,255,255,0)"}:${itemModel.get("bottomValue")}`;
60453
+ if (!key && itemModel.get("topValue", true) !== void 0) {
60454
+ key = `${itemModel.get("topColor", true) || "rgba(255,255,255,0)"}:${itemModel.get("topValue", true)}:${itemModel.get("bottomColor", true) || "rgba(255,255,255,0)"}:${itemModel.get("bottomValue", true)}`;
60434
60455
  }
60435
60456
  return key || "transparent";
60436
60457
  }
@@ -75813,7 +75834,7 @@ var MarkLabelView2 = class extends Component_default2 {
75813
75834
  markerGroupMap.set(item.name, el);
75814
75835
  this.group.add(el);
75815
75836
  }
75816
- if (item.countDown && item.countDown.show && item.countDown.value) {
75837
+ if (item.countDown && item.countDown.show && item.countDown.value > 0) {
75817
75838
  const key = seriesName + item.name;
75818
75839
  if (!timerMap.get(key)) {
75819
75840
  const countDownTextEl = el.childAt(3);