@visactor/vchart 1.2.2-beta.2 → 1.2.3-beta.0

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.
Files changed (51) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +19 -10
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js +4 -0
  6. package/cjs/chart/base-chart.js.map +1 -1
  7. package/cjs/component/crosshair/base.js +3 -2
  8. package/cjs/component/crosshair/base.js.map +1 -1
  9. package/cjs/core/index.d.ts +1 -1
  10. package/cjs/core/index.js +1 -1
  11. package/cjs/core/index.js.map +1 -1
  12. package/cjs/mark/arc-3d.js +1 -1
  13. package/cjs/mark/arc.js +1 -1
  14. package/cjs/mark/area.js +1 -1
  15. package/cjs/mark/box-plot.js +1 -1
  16. package/cjs/mark/cell.js +1 -1
  17. package/cjs/model/base-model.js +1 -1
  18. package/cjs/model/interface.js +1 -1
  19. package/cjs/model/layout-item.js +1 -1
  20. package/cjs/model/model-state-manager.js +1 -1
  21. package/cjs/model/tooltip-helper.js +1 -1
  22. package/cjs/series/word-cloud/base.js +1 -1
  23. package/cjs/series/word-cloud/base.js.map +1 -1
  24. package/cjs/series/word-cloud/interface.d.ts +3 -3
  25. package/cjs/series/word-cloud/interface.js.map +1 -1
  26. package/cjs/series/word-cloud/word-cloud-3d.js +1 -1
  27. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  28. package/esm/chart/base-chart.js +5 -1
  29. package/esm/chart/base-chart.js.map +1 -1
  30. package/esm/component/crosshair/base.js +3 -2
  31. package/esm/component/crosshair/base.js.map +1 -1
  32. package/esm/core/index.d.ts +1 -1
  33. package/esm/core/index.js +1 -1
  34. package/esm/core/index.js.map +1 -1
  35. package/esm/mark/arc-3d.js +1 -1
  36. package/esm/mark/arc.js +1 -1
  37. package/esm/mark/area.js +1 -1
  38. package/esm/mark/box-plot.js +1 -1
  39. package/esm/mark/cell.js +1 -1
  40. package/esm/model/base-model.js +1 -1
  41. package/esm/model/interface.js +1 -1
  42. package/esm/model/layout-item.js +1 -1
  43. package/esm/model/model-state-manager.js +1 -1
  44. package/esm/model/tooltip-helper.js +1 -1
  45. package/esm/series/word-cloud/base.js +1 -1
  46. package/esm/series/word-cloud/base.js.map +1 -1
  47. package/esm/series/word-cloud/interface.d.ts +3 -3
  48. package/esm/series/word-cloud/interface.js.map +1 -1
  49. package/esm/series/word-cloud/word-cloud-3d.js +1 -1
  50. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  51. package/package.json +5 -4
package/build/index.js CHANGED
@@ -26008,6 +26008,7 @@
26008
26008
  if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
26009
26009
  if (maxLineWidth > 0) for (let i = 0; i < lines.length; i++) {
26010
26010
  const str = lines[i];
26011
+ let needCut = !0;
26011
26012
  if (i === lineCountLimit - 1) {
26012
26013
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
26013
26014
  linesLayout.push({
@@ -26017,14 +26018,17 @@
26017
26018
  break;
26018
26019
  }
26019
26020
  const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth);
26020
- if ("" !== str && "" === clip.str) if (ellipsis) {
26021
- const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
26022
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
26023
- } else clip.str = "", clip.width = 0;
26021
+ if ("" !== str && "" === clip.str) {
26022
+ if (ellipsis) {
26023
+ const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
26024
+ clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
26025
+ } else clip.str = "", clip.width = 0;
26026
+ needCut = !1;
26027
+ }
26024
26028
  if (linesLayout.push({
26025
26029
  str: clip.str,
26026
26030
  width: clip.width
26027
- }), clip.str.length === str.length) ;else {
26031
+ }), clip.str.length === str.length) ;else if (needCut) {
26028
26032
  const newStr = str.substring(clip.str.length);
26029
26033
  lines.splice(i + 1, 0, newStr);
26030
26034
  }
@@ -58418,7 +58422,7 @@
58418
58422
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58419
58423
  Factory.registerRegion('region', Region);
58420
58424
  Factory.registerLayout('base', Layout);
58421
- const version = "1.2.2-beta.2";
58425
+ const version = "1.2.3-beta.0";
58422
58426
  Logger.getInstance(LoggerLevel.Error);
58423
58427
 
58424
58428
  var SeriesMarkNameEnum;
@@ -59401,6 +59405,11 @@
59401
59405
  width = containerWidth;
59402
59406
  height = containerHeight;
59403
59407
  }
59408
+ else if (isMiniAppLikeMode(this._option.mode) && this._option.modeParams?.domref) {
59409
+ const domRef = this._option.modeParams.domref;
59410
+ width = domRef.width;
59411
+ height = domRef.height;
59412
+ }
59404
59413
  width = userWidth ?? width;
59405
59414
  height = userHeight ?? height;
59406
59415
  this._canvasRect = {
@@ -71224,7 +71233,7 @@
71224
71233
  const fontWeightField = this._fontWeightField;
71225
71234
  const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
71226
71235
  if (valueField) {
71227
- const [minValue, maxValue] = extent$2(this.getViewData()?.latestData.map((datum) => datum[valueField]));
71236
+ const [minValue, maxValue] = extent$2(this.getViewData()?.latestData.map((datum) => +datum[valueField]));
71228
71237
  valueScale.domain([minValue, maxValue], true).range(fontWeightRange);
71229
71238
  wordCloudTransforms.push({
71230
71239
  type: 'map',
@@ -71397,7 +71406,7 @@
71397
71406
  const fontWeightField = this._fontWeightField;
71398
71407
  const fillingRotateAngles = this._wordCloudShapeConfig.fillingRotateAngles;
71399
71408
  if (valueField) {
71400
- const [minValue, maxValue] = extent$2(this.getViewData()?.latestData.map((datum) => datum[valueField]));
71409
+ const [minValue, maxValue] = extent$2(this.getViewData()?.latestData.map((datum) => +datum[valueField]));
71401
71410
  valueScale.domain([minValue, maxValue], true).range(fontWeightRange);
71402
71411
  wordCloudTransforms.push({
71403
71412
  type: 'map',
@@ -84294,8 +84303,8 @@
84294
84303
  return null;
84295
84304
  }
84296
84305
  _getAxisInfoByField(field) {
84297
- const axesComponents = this._option.getComponentsByKey('axes');
84298
- if (!axesComponents.length) {
84306
+ const axesComponents = this._option?.getComponentsByKey?.('axes');
84307
+ if (!axesComponents?.length) {
84299
84308
  return null;
84300
84309
  }
84301
84310
  let bindingAxesIndex = get$1(this._spec, `${field}Field.bindingAxesIndex`);