zzz-pc-view 0.0.102 → 0.0.104

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "@types/crypto-js": "^4.2.2",
21
21
  "qs": "^6.13.0",
22
22
  "@types/qs": "^6.9.17",
23
- "echarts": "^5.5.1",
23
+ "echarts": "^5.6.0",
24
24
  "color-hash": "^2.0.2",
25
25
  "@types/sortablejs": "^1.15.8",
26
26
  "sortablejs": "^1.15.6",
package/src/index.es.js CHANGED
@@ -1853,7 +1853,7 @@ const useInterval = (callback, ms) => {
1853
1853
  };
1854
1854
  const clearTimer = () => {
1855
1855
  if (timer !== void 0) {
1856
- clearInterval(timer);
1856
+ clearTimeout(timer);
1857
1857
  timer = void 0;
1858
1858
  }
1859
1859
  };
@@ -1882,6 +1882,7 @@ const useHttpRequestInterval = (request, ms) => {
1882
1882
  httpRequestPromise.catch((error) => {
1883
1883
  if (error.code === ABORTED_CODE) {
1884
1884
  isAbort = true;
1885
+ return;
1885
1886
  }
1886
1887
  return Promise.reject(error);
1887
1888
  }).finally(() => {
@@ -2919,7 +2920,7 @@ const canvasUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
2919
2920
  const DATA_ZOOM_SIZE = 37;
2920
2921
  const NUMBER_FONT_FAMILY = "Times New Roman";
2921
2922
  const CN_TEXT_FONT_FAMILY = "宋体,SimSun,simsun";
2922
- const EN_TEXT_FONT_FAMILY = "sans-serif";
2923
+ const EN_TEXT_FONT_FAMILY = "Times New Roman";
2923
2924
  const useChartStyleConfig = (param) => {
2924
2925
  const axisGap = param.axisGap ?? 6;
2925
2926
  return {
@@ -3192,7 +3193,7 @@ const setLegend = (chartOption, dimensions, chartStyleConfig, legendSelected, to
3192
3193
  (legendSize2, dimension) => {
3193
3194
  const width = legendPaddings[1] + legendItemWidth + legendItemGap + measureText(dimension.name, legendFontSize, legendFontFamily).width;
3194
3195
  legendSize2[0] += width;
3195
- if (legendSize2[0] > legendWidth) {
3196
+ if (legendSize2[0] - legendPaddings[1] > legendWidth) {
3196
3197
  legendSize2[1]++;
3197
3198
  legendSize2[0] = width;
3198
3199
  }
@@ -3242,77 +3243,74 @@ const setYAxis$1 = (chartOption, param) => {
3242
3243
  const axisNameIndexMap = {};
3243
3244
  const { yAxisNameLocation, chartStyleConfig, dataset } = param;
3244
3245
  const { axisNameFontSize, axisFontSize } = chartStyleConfig;
3245
- param.dimensions.forEach((dimension, index2) => {
3246
+ param.dimensions.forEach((dimension) => {
3246
3247
  var _a2, _b2;
3247
- let yAxisIndex = index2;
3248
3248
  const axisName = dimension.axisName ?? "";
3249
3249
  if (!Object.prototype.hasOwnProperty.call(axisNameIndexMap, axisName)) {
3250
- axisNameIndexMap[axisName] = index2;
3250
+ axisNameIndexMap[axisName] = yAxis.length;
3251
3251
  yAxis.push({
3252
- // Y 轴的名称
3252
+ // Y 轴名称
3253
3253
  name: axisName,
3254
- // Y 轴名称的位置,根据传入的配置设置
3254
+ // Y 轴名称的位置
3255
3255
  nameLocation: yAxisNameLocation,
3256
3256
  // Y 轴名称的文本样式
3257
3257
  nameTextStyle: {
3258
- // 字体大小,从图表样式配置中获取
3258
+ // 轴名称字体大小
3259
3259
  fontSize: axisNameFontSize,
3260
- // 字体族,使用预设的英文字体族
3260
+ // 轴名称字体族
3261
3261
  fontFamily: EN_TEXT_FONT_FAMILY
3262
3262
  },
3263
- // Y 轴的类型为数值轴,用于处理数值数据
3263
+ // Y 轴类型为数值轴
3264
3264
  type: "value",
3265
3265
  // 显示 Y 轴
3266
3266
  show: true,
3267
- // 是否启用缩放,根据维度配置设置
3267
+ // 是否启用缩放,继承自维度配置
3268
3268
  scale: dimension.scale,
3269
- // 轴刻度配置
3269
+ // Y 轴刻度配置
3270
3270
  axisTick: {
3271
- // 显示轴刻度
3271
+ // 显示刻度
3272
3272
  show: true,
3273
- // 轴刻度与标签对齐
3273
+ // 刻度与标签对齐
3274
3274
  alignWithLabel: true
3275
3275
  },
3276
- // 轴线条配置
3276
+ // Y 轴轴线配置
3277
3277
  axisLine: {
3278
- // 显示轴线条
3278
+ // 显示轴线
3279
3279
  show: true
3280
3280
  },
3281
- // 轴标签配置
3281
+ // Y 轴标签配置
3282
3282
  axisLabel: {
3283
- // 字体大小,从图表样式配置中获取
3283
+ // 标签字体大小
3284
3284
  fontSize: axisFontSize,
3285
- // 字体族,如果未提供则使用默认的数字字体族
3285
+ // 标签字体族,若未提供则使用默认字体族
3286
3286
  fontFamily: dimension.labelFontFamily || NUMBER_FONT_FAMILY,
3287
- // 标签格式化函数,如果未提供则使用默认的数字格式化函数
3287
+ // 标签格式化函数,若未提供则使用默认数字格式化函数
3288
3288
  formatter: dimension.labelFormatter || numberFormatter
3289
3289
  },
3290
- // 分割线配置
3290
+ // Y 轴分割线配置
3291
3291
  splitLine: {
3292
3292
  // 不显示分割线
3293
3293
  show: false
3294
3294
  }
3295
3295
  });
3296
3296
  }
3297
- yAxisIndex = axisNameIndexMap[axisName];
3297
+ const yAxisIndex = axisNameIndexMap[axisName];
3298
3298
  const dimensionId = dimension.id;
3299
3299
  const seriesItem = dimension.series;
3300
3300
  const datasetIndex = seriesItem.datasetIndex ?? 0;
3301
3301
  series.push({
3302
- // 系列的名称,使用维度的唯一标识符
3302
+ // 系列名称为维度的唯一标识符
3303
3303
  name: dimensionId,
3304
- // 数据编码配置,指定 X 轴和 Y 轴的数据来源
3304
+ // 数据编码配置,指定 X 轴和 Y 轴对应的数据维度
3305
3305
  encode: {
3306
- // X 轴数据来源,使用对应数据集的维度 ID
3307
3306
  x: (_b2 = (_a2 = dataset[datasetIndex]) == null ? void 0 : _a2.dimension) == null ? void 0 : _b2.id,
3308
- // Y 轴数据来源,使用当前维度的唯一标识符
3309
3307
  y: dimensionId
3310
3308
  },
3311
- // 系列对应的 Y 轴索引,确保系列数据在正确的 Y 轴上显示
3309
+ // 关联的 Y 轴索引
3312
3310
  yAxisIndex,
3313
- // 展开系列原有的配置,保留用户自定义的系列样式和属性
3311
+ // 展开原系列配置
3314
3312
  ...seriesItem,
3315
- // 数据集索引,如果未提供则使用默认值 0
3313
+ // 数据集索引
3316
3314
  datasetIndex
3317
3315
  });
3318
3316
  });