kd-lane-chart-v3 0.1.21 → 0.1.22

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/esm/index.js CHANGED
@@ -3776,6 +3776,15 @@ const _sfc_main$8 = /* @__PURE__ */ Object.assign({
3776
3776
  emits: ["updateLine"],
3777
3777
  setup(__props, { emit: __emit }) {
3778
3778
  const { formatParamLabel: formatParamLabel2, currentLocale } = useKdI18n();
3779
+ function headerScale(setValue, fallback) {
3780
+ if (setValue !== void 0 && setValue !== null && setValue !== "" && Number.isFinite(Number(setValue))) {
3781
+ return Number(setValue);
3782
+ }
3783
+ if (fallback !== void 0 && fallback !== null && fallback !== "" && Number.isFinite(Number(fallback))) {
3784
+ return Number(fallback);
3785
+ }
3786
+ return 0;
3787
+ }
3779
3788
  const props = __props;
3780
3789
  const emit = __emit;
3781
3790
  function getFontSize(type) {
@@ -3921,7 +3930,7 @@ const _sfc_main$8 = /* @__PURE__ */ Object.assign({
3921
3930
  onClick: toggleIsUsed
3922
3931
  }, [
3923
3932
  createElementVNode("div", _hoisted_1$8, [
3924
- createElementVNode("span", _hoisted_2$7, toDisplayString(__props.line.min || __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].min || 0), 1),
3933
+ createElementVNode("span", _hoisted_2$7, toDisplayString(headerScale(__props.line.min, __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].min)), 1),
3925
3934
  createElementVNode("div", _hoisted_3$6, [
3926
3935
  createElementVNode("div", {
3927
3936
  class: "paramsTitle",
@@ -3933,7 +3942,7 @@ const _sfc_main$8 = /* @__PURE__ */ Object.assign({
3933
3942
  style: normalizeStyle(getFontSize("data"))
3934
3943
  }, toDisplayString(getCurrentData()), 5)) : createCommentVNode("", true)
3935
3944
  ]),
3936
- createElementVNode("span", _hoisted_4$6, toDisplayString(__props.line.max || __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].max || 0), 1),
3945
+ createElementVNode("span", _hoisted_4$6, toDisplayString(headerScale(__props.line.max, __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].max)), 1),
3937
3946
  createElementVNode("div", {
3938
3947
  class: "gradient-display",
3939
3948
  style: normalizeStyle(gradientDisplay.value)
@@ -3943,7 +3952,7 @@ const _sfc_main$8 = /* @__PURE__ */ Object.assign({
3943
3952
  };
3944
3953
  }
3945
3954
  });
3946
- const HeaderItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-bea65042"]]);
3955
+ const HeaderItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-9b99d168"]]);
3947
3956
  const _hoisted_1$7 = { class: "legend-label" };
3948
3957
  const _hoisted_2$6 = { class: "legend-content" };
3949
3958
  const _hoisted_3$5 = { class: "scale-left" };
@@ -4014,6 +4023,15 @@ const _sfc_main$7 = /* @__PURE__ */ Object.assign({
4014
4023
  emits: ["updateLine"],
4015
4024
  setup(__props, { emit: __emit }) {
4016
4025
  const { formatParamLabel: formatParamLabel2, $kdInnerTrans, currentLocale } = useKdI18n();
4026
+ function headerScale(setValue, fallback) {
4027
+ if (setValue !== void 0 && setValue !== null && setValue !== "" && Number.isFinite(Number(setValue))) {
4028
+ return Number(setValue);
4029
+ }
4030
+ if (fallback !== void 0 && fallback !== null && fallback !== "" && Number.isFinite(Number(fallback))) {
4031
+ return Number(fallback);
4032
+ }
4033
+ return 0;
4034
+ }
4017
4035
  const props = __props;
4018
4036
  const emit = __emit;
4019
4037
  function getParamName() {
@@ -4092,7 +4110,7 @@ const _sfc_main$7 = /* @__PURE__ */ Object.assign({
4092
4110
  }, [
4093
4111
  createElementVNode("div", _hoisted_1$7, toDisplayString(getParamName()), 1),
4094
4112
  createElementVNode("div", _hoisted_2$6, [
4095
- createElementVNode("div", _hoisted_3$5, toDisplayString(__props.line.min || 0), 1),
4113
+ createElementVNode("div", _hoisted_3$5, toDisplayString(headerScale(__props.line.min, __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].min)), 1),
4096
4114
  createElementVNode("div", {
4097
4115
  class: "legend-lines",
4098
4116
  style: normalizeStyle({ flexDirection: __props.formCache.displayType == "header" ? "column" : "row" })
@@ -4115,13 +4133,13 @@ const _sfc_main$7 = /* @__PURE__ */ Object.assign({
4115
4133
  ], 12, _hoisted_4$5);
4116
4134
  }), 128))
4117
4135
  ], 4),
4118
- createElementVNode("div", _hoisted_8$2, toDisplayString(__props.line.max || 20), 1)
4136
+ createElementVNode("div", _hoisted_8$2, toDisplayString(headerScale(__props.line.max, __props.lineRange[__props.line.lineId] && __props.lineRange[__props.line.lineId].max)), 1)
4119
4137
  ])
4120
4138
  ], 4);
4121
4139
  };
4122
4140
  }
4123
4141
  });
4124
- const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-bd30757b"]]);
4142
+ const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-a7582d60"]]);
4125
4143
  const TREND_LINE_STYLE = {
4126
4144
  stroke: "#FF9800",
4127
4145
  lineWidth: 2,
@@ -12456,7 +12474,7 @@ const _hoisted_2$2 = {
12456
12474
  key: 1,
12457
12475
  class: "kd-depth-axis-labels"
12458
12476
  };
12459
- const _hoisted_3$1 = ["onMouseenter", "onClick"];
12477
+ const _hoisted_3$1 = ["onMouseenter", "onMouseleave", "onClick"];
12460
12478
  const _hoisted_4$1 = ["onClick"];
12461
12479
  const _hoisted_5 = ["onClick"];
12462
12480
  const _sfc_main$2 = /* @__PURE__ */ Object.assign({
@@ -12687,6 +12705,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
12687
12705
  const currentContextMenuType = ref(null);
12688
12706
  const activeSubMenu = ref(null);
12689
12707
  const subMenuDirection = ref("right");
12708
+ const subMenuOffsetTop = ref(0);
12709
+ const subMenuOffsetLeft = ref(0);
12690
12710
  const params = ref([]);
12691
12711
  const contextItem = ref(void 0);
12692
12712
  const realTimeData = ref([]);
@@ -12776,6 +12796,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
12776
12796
  currentContextMenuType,
12777
12797
  activeSubMenu,
12778
12798
  subMenuDirection,
12799
+ subMenuOffsetTop,
12800
+ subMenuOffsetLeft,
12779
12801
  params,
12780
12802
  contextItem,
12781
12803
  realTimeData,
@@ -12903,6 +12925,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
12903
12925
  if (proxy._isUnmounted || !proxy._chartRedrawQueued) return;
12904
12926
  proxy._chartRedrawQueued = false;
12905
12927
  if (proxy.isUpdatingChart) {
12928
+ proxy._pendingOnlyLaneIds = void 0;
12929
+ proxy._pendingFullChart = true;
12906
12930
  proxy.pendingChartUpdate = true;
12907
12931
  return;
12908
12932
  }
@@ -13865,7 +13889,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
13865
13889
  const tipH = content[1] || 80;
13866
13890
  const viewW = view[0] || 200;
13867
13891
  const viewH = view[1] || 400;
13868
- const cy = Array.isArray(point) && Number.isFinite(point[1]) ? point[1] : 0;
13892
+ const anchored = Number(proxy._tooltipAnchorY);
13893
+ const cy = Number.isFinite(anchored) ? anchored : Array.isArray(point) && Number.isFinite(point[1]) ? point[1] : 0;
13869
13894
  let x = 4;
13870
13895
  let y = cy + 12;
13871
13896
  if (y + tipH > viewH - 4) y = Math.max(4, cy - tipH - 12);
@@ -13875,7 +13900,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
13875
13900
  function getLaneTooltipExtraCss() {
13876
13901
  return "pointer-events: none !important; max-width: 92%; box-sizing: border-box; white-space: normal; word-break: break-all;";
13877
13902
  }
13878
- function buildHelperTipRailData(helperX, groupMin, groupMax, steps = 48) {
13903
+ function buildHelperTipRailData(helperX, groupMin, groupMax, steps = 400) {
13879
13904
  const lo = Number(groupMin);
13880
13905
  const hi = Number(groupMax);
13881
13906
  const x = Number(helperX);
@@ -13982,6 +14007,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
13982
14007
  proxy._lastAxisPx.set(chart, axisKey);
13983
14008
  const canShowTip = needTip && proxy.shouldShowTooltipContent(laneId) && lane && lane.lines && lane.lines.length > 0 && proxy.laneHasAnyValidPlotPoint(chart, laneId);
13984
14009
  if (canShowTip) {
14010
+ if (Number.isFinite(y)) proxy._tooltipAnchorY = y;
13985
14011
  const tipKey = `${axisKey}:${Number(yValue).toFixed(2)}`;
13986
14012
  proxy._lastTipKey.set(chart, tipKey);
13987
14013
  const helperHit = proxy.findHelperTooltipAnchor(
@@ -14099,6 +14125,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
14099
14125
  }
14100
14126
  function applyWindowChartPan(native) {
14101
14127
  if (!proxy._isPanning || proxy._windowPanStartY == null || !native) return;
14128
+ proxy._pendingDepthWindow = null;
14102
14129
  const clientY = native.clientY;
14103
14130
  if (!Number.isFinite(clientY)) return;
14104
14131
  const h = proxy.getChartPlotHeightPx();
@@ -14148,15 +14175,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
14148
14175
  });
14149
14176
  if (!proxy._isPanning) proxy.trendLineManager.endFollowView();
14150
14177
  }
14151
- if (!proxy._isPanning && !proxy.isUpdatingChart) {
14152
- if (proxy._needFullChartAfterInteract) {
14153
- proxy._needFullChartAfterInteract = false;
14154
- proxy.updateLanesChartOption();
14155
- } else {
14156
- proxy.patchVisibleSeries();
14157
- proxy.scheduleAllDepthAxisLabelSync();
14158
- }
14159
- }
14178
+ if (!proxy._isPanning) flushInteractionPaint();
14160
14179
  proxy.flushVisibleDataChange();
14161
14180
  proxy.restorePointerAfterInteract();
14162
14181
  }
@@ -14170,24 +14189,44 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
14170
14189
  });
14171
14190
  proxy.trendLineManager.endFollowView();
14172
14191
  }
14173
- if (!proxy.isUpdatingChart) {
14174
- if (proxy._needFullChartAfterInteract) {
14175
- proxy._needFullChartAfterInteract = false;
14176
- proxy.updateLanesChartOption();
14177
- } else {
14178
- proxy.patchVisibleSeries();
14179
- proxy.scheduleAllDepthAxisLabelSync();
14180
- }
14181
- }
14192
+ flushInteractionPaint();
14182
14193
  proxy.flushVisibleDataChange();
14183
14194
  proxy.restorePointerAfterInteract();
14184
14195
  }
14196
+ function flushInteractionPaint() {
14197
+ if (proxy._isUnmounted) return;
14198
+ if (proxy.isUpdatingChart) {
14199
+ proxy._pendingInteractionPatch = true;
14200
+ return;
14201
+ }
14202
+ proxy._pendingInteractionPatch = false;
14203
+ if (proxy._needFullChartAfterInteract) {
14204
+ proxy._needFullChartAfterInteract = false;
14205
+ proxy.updateLanesChartOption();
14206
+ return;
14207
+ }
14208
+ proxy.patchVisibleSeries();
14209
+ proxy.scheduleAllDepthAxisLabelSync();
14210
+ }
14211
+ function scheduleDeferredFullPaint() {
14212
+ proxy._needFullChartAfterInteract = true;
14213
+ if (proxy._interactFullTimer) return;
14214
+ proxy._interactFullTimer = setTimeout(() => {
14215
+ proxy._interactFullTimer = 0;
14216
+ if (proxy._isUnmounted) return;
14217
+ flushInteractionPaint();
14218
+ }, 80);
14219
+ }
14185
14220
  function scheduleInteractionPatch() {
14186
14221
  if (proxy._interactPatchRaf) return;
14187
14222
  proxy._interactPatchRaf = requestAnimationFrame(() => {
14188
14223
  proxy._interactPatchRaf = 0;
14189
14224
  if (proxy._isUnmounted) return;
14190
- if (!proxy.isUpdatingChart) proxy.patchVisibleSeries();
14225
+ if (proxy.isUpdatingChart) {
14226
+ proxy._pendingInteractionPatch = true;
14227
+ return;
14228
+ }
14229
+ proxy.patchVisibleSeries();
14191
14230
  });
14192
14231
  }
14193
14232
  function dispatchVisibleDataChange(val) {
@@ -14361,11 +14400,31 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
14361
14400
  });
14362
14401
  });
14363
14402
  }
14403
+ function templateLayoutKey(template) {
14404
+ const lanes = template && template.lanes || [];
14405
+ let key = "";
14406
+ for (let i = 0; i < lanes.length; i++) {
14407
+ const lane = lanes[i];
14408
+ if (i) key += "|";
14409
+ key += lane && lane.laneId != null ? lane.laneId : "";
14410
+ key += ":";
14411
+ const lines = lane && lane.lines || [];
14412
+ for (let j = 0; j < lines.length; j++) {
14413
+ if (j) key += ",";
14414
+ const line = lines[j];
14415
+ key += line && line.lineId != null ? line.lineId : "";
14416
+ }
14417
+ }
14418
+ return key;
14419
+ }
14364
14420
  async function templateChange(template) {
14365
- if (template && template === proxy.currentTemplate) {
14421
+ const sameRef = !!(template && template === proxy.currentTemplate);
14422
+ const layoutKey = templateLayoutKey(template || proxy.currentTemplate);
14423
+ if (sameRef && layoutKey === proxy._templateLayoutKey) {
14366
14424
  return;
14367
14425
  }
14368
- proxy.currentTemplate = template;
14426
+ if (!sameRef) proxy.currentTemplate = template;
14427
+ proxy._templateLayoutKey = layoutKey;
14369
14428
  proxy.getLatestLineDataByParamCode();
14370
14429
  let migratedLanes = null;
14371
14430
  if (proxy.trendLineManager) {
@@ -14808,7 +14867,66 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
14808
14867
  const next = proxy.resolveAllowedScale(metersPerCm, metersPerCm);
14809
14868
  proxy.syncScaleSelection(next);
14810
14869
  }
14870
+ function axisBoundIsSet(v) {
14871
+ return v !== void 0 && v !== null && v !== "" && Number.isFinite(Number(v));
14872
+ }
14873
+ function collectRelatedAxisValues(lineInfo, rows, axisKey) {
14874
+ const values = [];
14875
+ if (!lineInfo || !rows || !rows.length) return values;
14876
+ const ids = [];
14877
+ if (lineInfo.paramId) ids.push(lineInfo.paramId);
14878
+ if (lineInfo.recommendParamId && (lineInfo.recommendIsUsed === "1" || lineInfo.recommendIsUsed == 1)) {
14879
+ ids.push(lineInfo.recommendParamId);
14880
+ }
14881
+ if (lineInfo.upperParamId) ids.push(lineInfo.upperParamId);
14882
+ if (lineInfo.lowerParamId) ids.push(lineInfo.lowerParamId);
14883
+ const seen = /* @__PURE__ */ new Set();
14884
+ for (let i = 0; i < ids.length; i++) {
14885
+ const id = ids[i];
14886
+ const key = String(id);
14887
+ if (seen.has(key)) continue;
14888
+ seen.add(key);
14889
+ const series = proxy.generateSeriesData(rows, { paramId: id }, axisKey);
14890
+ for (let j = 0; j < series.length; j++) {
14891
+ const raw = series[j] && series[j][0];
14892
+ if (isMissingCurveValue(raw)) continue;
14893
+ const n = Number(raw);
14894
+ if (Number.isFinite(n)) values.push(n);
14895
+ }
14896
+ }
14897
+ return values;
14898
+ }
14899
+ function axisSamplesForLine(lineInfo, rows, axisKey, mainSeries) {
14900
+ if (!lineInfo) return mainSeries || [];
14901
+ if (axisBoundIsSet(lineInfo.min) && axisBoundIsSet(lineInfo.max)) {
14902
+ return mainSeries || [];
14903
+ }
14904
+ const full = proxy.realTimeData;
14905
+ const sampleRows = Array.isArray(full) && full.length ? full : rows;
14906
+ const related = collectRelatedAxisValues(lineInfo, sampleRows, axisKey);
14907
+ return related.length ? related : mainSeries || [];
14908
+ }
14909
+ function laneOptionHasCurve(option) {
14910
+ const series = option && option.series;
14911
+ if (!series || !series.length) return false;
14912
+ for (let i = 0; i < series.length; i++) {
14913
+ const item = series[i];
14914
+ if (!item || !item.data || !item.data.length) continue;
14915
+ const name = item.name;
14916
+ if (name === "helper" || name === "log-grid" || name === "trend") continue;
14917
+ return true;
14918
+ }
14919
+ return false;
14920
+ }
14811
14921
  function getXAxisRangeByHeader(lineInfo, validData = []) {
14922
+ const lineIdEarly = lineInfo && lineInfo.lineId;
14923
+ if (proxy._freezeAxisRange && lineIdEarly != null) {
14924
+ const store = proxy._lineRangeDraft || proxy.lineRange || {};
14925
+ const prev = store[lineIdEarly];
14926
+ if (prev && Number.isFinite(Number(prev.min)) && Number.isFinite(Number(prev.max))) {
14927
+ return { min: Number(prev.min), max: Number(prev.max) };
14928
+ }
14929
+ }
14812
14930
  let headerMin = 0;
14813
14931
  let headerMax = 1;
14814
14932
  const numericValues = (validData || []).reduce((acc, item) => {
@@ -15747,7 +15865,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
15747
15865
  const gridCount = proxy.readGridCount(chart);
15748
15866
  if (!gridCount || gridCount !== groups.length) {
15749
15867
  if (proxy._isZooming || proxy._isPanning || proxy._isWheelAnimating) {
15750
- proxy._needFullChartAfterInteract = true;
15868
+ scheduleDeferredFullPaint();
15751
15869
  return;
15752
15870
  }
15753
15871
  if (!proxy.isUpdatingChart) proxy.updateLanesChartOption();
@@ -15895,7 +16013,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
15895
16013
  }))
15896
16014
  };
15897
16015
  try {
15898
- chart.setOption(patch, { lazyUpdate: true, silent: true });
16016
+ const liveInteract = !!(proxy._isPanning || proxy._isZooming || proxy._isWheelAnimating);
16017
+ chart.setOption(patch, { lazyUpdate: liveInteract, silent: true });
15899
16018
  } catch (e) {
15900
16019
  }
15901
16020
  });
@@ -16236,6 +16355,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16236
16355
  await nextTick();
16237
16356
  if (proxy._isUnmounted) return;
16238
16357
  if (proxy.isUpdatingChart) {
16358
+ proxy._pendingOnlyLaneIds = void 0;
16359
+ proxy._pendingFullChart = true;
16239
16360
  proxy.pendingChartUpdate = true;
16240
16361
  return;
16241
16362
  }
@@ -16443,6 +16564,26 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16443
16564
  }
16444
16565
  return null;
16445
16566
  }
16567
+ function buildSyncedAxisPointer(show) {
16568
+ return {
16569
+ show: !!show,
16570
+ snap: false,
16571
+ type: "line",
16572
+ triggerTooltip: false,
16573
+ z: 999,
16574
+ animation: false,
16575
+ label: {
16576
+ show: !!show,
16577
+ backgroundColor: `${getCssVariable("--kd-lane-container-border-color")}99`,
16578
+ color: `${getCssVariable("--default-text-color")}`,
16579
+ formatter: () => proxy._lastTooltipAxisLabel || ""
16580
+ },
16581
+ lineStyle: {
16582
+ type: "dashed",
16583
+ width: 1
16584
+ }
16585
+ };
16586
+ }
16446
16587
  function getDefaultLaneChartOption() {
16447
16588
  const option = {
16448
16589
  backgroundColor: getCssVariable("--kd-lane-container-item-bg"),
@@ -16506,9 +16647,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16506
16647
  axisTick: {
16507
16648
  show: false
16508
16649
  },
16509
- axisPointer: {
16510
- show: true
16511
- }
16650
+ axisPointer: buildSyncedAxisPointer(true)
16512
16651
  }
16513
16652
  ],
16514
16653
  dataZoom: [proxy.buildInsideDataZoom()],
@@ -16516,7 +16655,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16516
16655
  tooltip: {
16517
16656
  show: true,
16518
16657
  showContent: proxy.showTooltip,
16519
- trigger: "axis",
16658
+ trigger: "item",
16520
16659
  triggerOn: "none",
16521
16660
  triggerEmphasis: false,
16522
16661
  enterable: false,
@@ -16544,7 +16683,9 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16544
16683
  backgroundColor: getCssVariable("--tooltip-bg-color"),
16545
16684
  borderWidth: 0,
16546
16685
  textStyle: {
16547
- color: getCssVariable("--default-text-color")
16686
+ color: getCssVariable("--default-text-color"),
16687
+ fontSize: 12,
16688
+ fontFamily: "Arial, sans-serif"
16548
16689
  },
16549
16690
  formatter: () => proxy.renderLaneTooltipHtml(proxy._tooltipLaneId)
16550
16691
  }
@@ -16605,6 +16746,12 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16605
16746
  async function updateLanesChartOption(transferData, onlyLaneIds) {
16606
16747
  if (proxy._isUnmounted) return;
16607
16748
  if (proxy.isUpdatingChart) {
16749
+ if (onlyLaneIds == null || onlyLaneIds === "" || onlyLaneIds === "series") {
16750
+ proxy._pendingOnlyLaneIds = void 0;
16751
+ proxy._pendingFullChart = true;
16752
+ } else if (!proxy._pendingFullChart) {
16753
+ proxy._pendingOnlyLaneIds = onlyLaneIds;
16754
+ }
16608
16755
  proxy.pendingChartUpdate = true;
16609
16756
  return;
16610
16757
  }
@@ -16625,6 +16772,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16625
16772
  proxy.isUpdatingChart = false;
16626
16773
  return;
16627
16774
  }
16775
+ proxy._freezeAxisRange = !!(laneFilter && laneFilter.size);
16628
16776
  const axisKey = proxy.currentToolBarConfig.axisTypeList && proxy.currentToolBarConfig.axisTypeList[proxy.formCache.axisType] || (proxy.formCache.axisType === "time" ? "time" : "depth");
16629
16777
  const paramNameMap = {};
16630
16778
  const paramCodeMap = /* @__PURE__ */ new Map();
@@ -16748,7 +16896,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16748
16896
  fontSize: 12,
16749
16897
  color: getCssVariable("--default-text-color")
16750
16898
  },
16751
- axisPointer: { show: hasValidLineData }
16899
+ axisPointer: buildSyncedAxisPointer(hasValidLineData)
16752
16900
  });
16753
16901
  if (proxy.formCache.axisType === "depth") {
16754
16902
  applyDepthYAxisInterval(
@@ -16849,7 +16997,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
16849
16997
  const allValidData = seriesDataCache2[lineInfo.lineId].full;
16850
16998
  const { min, max } = proxy.getXAxisRangeByHeader(
16851
16999
  lineInfo,
16852
- allValidData
17000
+ axisSamplesForLine(lineInfo, realTimeData2, axisKey, allValidData)
16853
17001
  );
16854
17002
  const xAxisIndex = option.xAxis.length;
16855
17003
  if (tipAnchorXAxisIndex < 0) {
@@ -17068,8 +17216,12 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
17068
17216
  groupMax
17069
17217
  ),
17070
17218
  lineStyle: { opacity: 0, width: 0 },
17071
- symbol: "none",
17072
- // silent/large 都会让 showTip(seriesIndex) 失效
17219
+ // 要有图形元素,trigger=item 的 showTip 才能出框;点本身不画出来
17220
+ showSymbol: true,
17221
+ symbol: "circle",
17222
+ symbolSize: 1,
17223
+ itemStyle: { opacity: 0 },
17224
+ emphasis: { disabled: true, scale: false },
17073
17225
  silent: false,
17074
17226
  large: false,
17075
17227
  tooltip: { show: true },
@@ -17100,11 +17252,15 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
17100
17252
  option.tooltip.formatter = () => proxy.renderLaneTooltipHtml(laneId);
17101
17253
  }
17102
17254
  if (proxy.trendLineManager) proxy.trendLineManager.appendSeriesToOption(option, lane);
17255
+ if (proxy._freezeAxisRange && lane.lines && lane.lines.length && !laneOptionHasCurve(option) && laneOptionHasCurve(proxy.getOptionsByLineId(lane.laneId))) {
17256
+ continue;
17257
+ }
17103
17258
  proxy.updateOptionsByLineId(lane.laneId, option);
17104
17259
  }
17105
17260
  } catch (error) {
17106
17261
  console.error("updateLanesChartOption error:", error);
17107
17262
  } finally {
17263
+ proxy._freezeAxisRange = false;
17108
17264
  proxy.commitLineRangeBatch();
17109
17265
  proxy.isUpdatingChart = false;
17110
17266
  if (proxy._isUnmounted) {
@@ -17145,10 +17301,23 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
17145
17301
  });
17146
17302
  }
17147
17303
  if (proxy.pendingChartUpdate) {
17304
+ const pendingOnly = proxy._pendingFullChart ? void 0 : proxy._pendingOnlyLaneIds;
17148
17305
  proxy.pendingChartUpdate = false;
17306
+ proxy._pendingFullChart = false;
17307
+ proxy._pendingOnlyLaneIds = void 0;
17308
+ proxy._pendingInteractionPatch = false;
17309
+ proxy._needFullChartAfterInteract = false;
17149
17310
  nextTick(() => {
17150
17311
  if (proxy._isUnmounted) return;
17151
- proxy.updateLanesChartOption(transferData);
17312
+ proxy.updateLanesChartOption(
17313
+ pendingOnly == null ? transferData : void 0,
17314
+ pendingOnly
17315
+ );
17316
+ });
17317
+ } else if (proxy._pendingInteractionPatch) {
17318
+ nextTick(() => {
17319
+ if (proxy._isUnmounted) return;
17320
+ flushInteractionPaint();
17152
17321
  });
17153
17322
  }
17154
17323
  }
@@ -17287,18 +17456,25 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
17287
17456
  const lane = proxy.findLaneById(laneId);
17288
17457
  const row = yValue != null ? proxy.findRowByAxisValue(yValue) || {} : {};
17289
17458
  const displaySeries = proxy.buildLaneTooltipSeries(lane, row, yValue);
17459
+ const mouse = proxy.buildTooltipMousePositionData(row);
17460
+ const textColor = getCssVariable("--default-text-color") || "";
17290
17461
  if (proxy.tooltipFormatter && typeof proxy.tooltipFormatter === "function") {
17291
17462
  return proxy.tooltipFormatter({
17292
17463
  series: displaySeries,
17293
- mousePositionData: proxy.buildTooltipMousePositionData(row)
17464
+ mousePositionData: mouse
17294
17465
  });
17295
17466
  }
17296
- let html = "<div>";
17467
+ let html = `<div style="padding:4px;font-family:Arial,sans-serif;color:${textColor}">`;
17297
17468
  for (let i = 0; i < displaySeries.length; i++) {
17298
17469
  const params2 = displaySeries[i];
17299
17470
  const { seriesName, value, color } = params2;
17300
17471
  const xValue = Array.isArray(value) ? value[0] : value;
17301
- html += `<div style="display:flex;align-items:center"><div style="height:10px;width:10px;font-size:10px;border-radius:8px;background-color:${color}"></div><span style="margin-left:8px;font-size:12px">${seriesName}:${xValue}</span></div>`;
17472
+ const marker = color || "transparent";
17473
+ html += `<div style="display:flex;align-items:center;margin-bottom:4px"><div style="width:12px;height:12px;min-width:12px;min-height:12px;flex:0 0 12px;border-radius:50%;background-color:${marker};margin-right:8px"></div><span style="flex:1;min-width:0;font-size:12px;color:${textColor}">${seriesName}: ${xValue}</span></div>`;
17474
+ }
17475
+ const time = mouse && mouse.time ? mouse.time : "";
17476
+ if (time) {
17477
+ html += `<div style="margin-top:8px;font-size:11px;color:${textColor}">${$kdInnerTrans("kdLaneChart.tooltip.timestamp")}: ${time}</div>`;
17302
17478
  }
17303
17479
  html += "</div>";
17304
17480
  return html;
@@ -18081,11 +18257,30 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
18081
18257
  proxy.currentContextMenuItems = [];
18082
18258
  proxy.activeSubMenu = null;
18083
18259
  proxy.subMenuDirection = "right";
18260
+ proxy.subMenuOffsetTop = 0;
18261
+ proxy.subMenuOffsetLeft = 0;
18084
18262
  proxy.menuWidth = null;
18085
18263
  proxy.menuHeight = null;
18086
18264
  }
18265
+ function hideSubMenu(item) {
18266
+ if (item && proxy.activeSubMenu !== item) return;
18267
+ proxy.activeSubMenu = null;
18268
+ }
18269
+ function subMenuLayoutStyle(left, top) {
18270
+ return {
18271
+ left: `${left || 0}px`,
18272
+ right: "auto",
18273
+ top: `${top || 0}px`,
18274
+ marginLeft: "0",
18275
+ marginRight: "0"
18276
+ };
18277
+ }
18087
18278
  function showSubMenu(item, event) {
18088
18279
  event.stopPropagation();
18280
+ if (!item || !item.children || !item.children.length) {
18281
+ proxy.activeSubMenu = null;
18282
+ return;
18283
+ }
18089
18284
  proxy.activeSubMenu = item;
18090
18285
  const parentMenuItem = event.currentTarget;
18091
18286
  nextTick(() => {
@@ -18093,22 +18288,44 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
18093
18288
  const subMenu = parentMenuItem == null ? void 0 : parentMenuItem.querySelector(".sub-menu");
18094
18289
  if (!container || !parentMenuItem || !subMenu) return;
18095
18290
  subMenu.style.visibility = "hidden";
18096
- const containerRect = container.getBoundingClientRect();
18291
+ subMenu.style.maxHeight = "";
18292
+ subMenu.style.overflowY = "";
18293
+ const bounds = container.getBoundingClientRect();
18294
+ const view = {
18295
+ left: Math.max(bounds.left, 0),
18296
+ top: Math.max(bounds.top, 0),
18297
+ right: Math.min(bounds.right, window.innerWidth),
18298
+ bottom: Math.min(bounds.bottom, window.innerHeight)
18299
+ };
18300
+ const gap = 8;
18097
18301
  const parentRect = parentMenuItem.getBoundingClientRect();
18098
- const subMenuWidth = subMenu.offsetWidth;
18099
- const rightAvailable = containerRect.right - parentRect.right;
18100
- proxy.subMenuDirection = rightAvailable >= subMenuWidth ? "right" : "left";
18101
- subMenu.style.visibility = "";
18302
+ const maxH = Math.max(40, view.bottom - view.top - 8);
18303
+ if (subMenu.offsetHeight > maxH) {
18304
+ subMenu.style.maxHeight = `${maxH}px`;
18305
+ subMenu.style.overflowY = "auto";
18306
+ }
18307
+ const subW = subMenu.offsetWidth;
18308
+ const subH = subMenu.offsetHeight;
18309
+ const spaceRight = view.right - parentRect.right - gap;
18310
+ const spaceLeft = parentRect.left - view.left - gap;
18311
+ const openRight = spaceRight >= subW || spaceRight >= spaceLeft;
18312
+ let leftEdge = openRight ? parentRect.right + gap : parentRect.left - gap - subW;
18313
+ if (leftEdge + subW > view.right) leftEdge = view.right - subW;
18314
+ if (leftEdge < view.left) leftEdge = view.left;
18315
+ let top = 0;
18316
+ const bottomOverflow = parentRect.top + subH - view.bottom;
18317
+ if (bottomOverflow > 0) top -= bottomOverflow;
18318
+ const topEdge = parentRect.top + top;
18319
+ if (topEdge < view.top) top += view.top - topEdge;
18320
+ const direction = leftEdge + subW / 2 >= parentRect.left + parentRect.width / 2 ? "right" : "left";
18321
+ proxy.subMenuDirection = direction;
18322
+ proxy.subMenuOffsetTop = top;
18323
+ proxy.subMenuOffsetLeft = leftEdge - parentRect.left;
18324
+ Object.assign(subMenu.style, subMenuLayoutStyle(proxy.subMenuOffsetLeft, top), { visibility: "visible" });
18102
18325
  });
18103
18326
  }
18104
18327
  function getSubMenuStyle() {
18105
- return {
18106
- left: proxy.subMenuDirection === "right" ? "100%" : "auto",
18107
- right: proxy.subMenuDirection === "right" ? "auto" : "100%",
18108
- top: 0,
18109
- marginLeft: proxy.subMenuDirection === "right" ? "4px" : "auto",
18110
- marginRight: proxy.subMenuDirection === "right" ? "auto" : "4px"
18111
- };
18328
+ return subMenuLayoutStyle(proxy.subMenuOffsetLeft, proxy.subMenuOffsetTop);
18112
18329
  }
18113
18330
  function handleContextMenuItemClick(item) {
18114
18331
  if (item.action === "deleteTrendKnot") {
@@ -18844,7 +19061,8 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
18844
19061
  ...proxy.getPaperGridAxisStyle(
18845
19062
  !isDepthLane,
18846
19063
  ySplitCount
18847
- )
19064
+ ),
19065
+ axisPointer: isDepthLane ? { show: false } : buildSyncedAxisPointer(true)
18848
19066
  };
18849
19067
  if (proxy.formCache.axisType === "depth") {
18850
19068
  applyDepthYAxisInterval(yAxisItem, groupMin, groupMax);
@@ -18902,7 +19120,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
18902
19120
  );
18903
19121
  const { min, max } = proxy.getXAxisRangeByHeader(
18904
19122
  lineInfo,
18905
- allSeriesData
19123
+ axisSamplesForLine(lineInfo, realTimeData2, axisKey, allSeriesData)
18906
19124
  );
18907
19125
  const isLogScale = isLaneLogScale(lane);
18908
19126
  const plotRange = isLogScale ? resolveLaneLogPlotRange(lane, proxy.getLineRangeStore()) : null;
@@ -20258,7 +20476,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
20258
20476
  class: "kd-lane-chart-lane-container-echart",
20259
20477
  ref_key: "chartAreaWrap",
20260
20478
  ref: chartAreaWrap,
20261
- onMouseenter: _cache[0] || (_cache[0] = ($event) => pointerInChartArea.value = true),
20479
+ onMouseenter: _cache[1] || (_cache[1] = ($event) => pointerInChartArea.value = true),
20262
20480
  onMouseleave: hideAllLaneTooltips
20263
20481
  }, [
20264
20482
  createElementVNode("div", {
@@ -20432,13 +20650,14 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
20432
20650
  key: 0,
20433
20651
  class: "context-menu-item has-children",
20434
20652
  onMouseenter: ($event) => showSubMenu(item, $event),
20653
+ onMouseleave: ($event) => hideSubMenu(item),
20435
20654
  onClick: ($event) => handleContextMenuItemClick(item)
20436
20655
  }, [
20437
20656
  createElementVNode("span", null, toDisplayString(item.label), 1),
20438
- _cache[1] || (_cache[1] = createElementVNode("span", { class: "arrow" }, "›", -1)),
20657
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "arrow" }, "›", -1)),
20439
20658
  activeSubMenu.value === item ? (openBlock(), createElementBlock("div", {
20440
20659
  key: 0,
20441
- class: "context-menu sub-menu",
20660
+ class: normalizeClass(["context-menu sub-menu", subMenuDirection.value === "left" ? "is-left" : "is-right"]),
20442
20661
  style: normalizeStyle(getSubMenuStyle())
20443
20662
  }, [
20444
20663
  (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (child, childIndex) => {
@@ -20450,14 +20669,15 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
20450
20669
  createElementVNode("span", null, toDisplayString(child.label), 1)
20451
20670
  ], 8, _hoisted_4$1);
20452
20671
  }), 128))
20453
- ], 4)) : createCommentVNode("", true)
20672
+ ], 6)) : createCommentVNode("", true)
20454
20673
  ], 40, _hoisted_3$1)) : (openBlock(), createElementBlock("div", {
20455
20674
  key: 1,
20456
20675
  class: "context-menu-item",
20676
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => hideSubMenu()),
20457
20677
  onClick: withModifiers(($event) => handleContextMenuItemClick(item), ["stop"])
20458
20678
  }, [
20459
20679
  createElementVNode("span", null, toDisplayString(item.label), 1)
20460
- ], 8, _hoisted_5))
20680
+ ], 40, _hoisted_5))
20461
20681
  ], 64);
20462
20682
  }), 128))
20463
20683
  ], 4)
@@ -20468,7 +20688,7 @@ const _sfc_main$2 = /* @__PURE__ */ Object.assign({
20468
20688
  };
20469
20689
  }
20470
20690
  });
20471
- const LineChartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-fcf148a1"]]);
20691
+ const LineChartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a716c99b"]]);
20472
20692
  const _hoisted_1$1 = ["title"];
20473
20693
  const _hoisted_2$1 = ["title"];
20474
20694
  const _sfc_main$1 = /* @__PURE__ */ Object.assign({
@@ -21286,7 +21506,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign({ name: "frameLayout", component
21286
21506
  children: [
21287
21507
  { label: "方式一", canTransfer: true },
21288
21508
  { label: "方式二", canTransfer: true },
21289
- { label: "方式三", canTransfer: true }
21509
+ { label: "方式三", canTransfer: true },
21510
+ { label: "方式四", canTransfer: true },
21511
+ { label: "方式五", canTransfer: true }
21290
21512
  ]
21291
21513
  }
21292
21514
  ]
@@ -22203,7 +22425,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({ name: "frameLayout", component
22203
22425
  };
22204
22426
  }
22205
22427
  });
22206
- const FrameLayoutComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a17d7f29"]]);
22428
+ const FrameLayoutComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1326393c"]]);
22207
22429
  function installComponents(app) {
22208
22430
  installKdI18n(app);
22209
22431
  app.component(KdLaneContainerComponent.name, KdLaneContainerComponent);