@visactor/react-vchart 2.0.22 → 2.0.23-alpha.1

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/index.js CHANGED
@@ -54927,8 +54927,10 @@
54927
54927
  const record = data[i];
54928
54928
  if (record) {
54929
54929
  const startValue = record[startField],
54930
- endValue = record[endField || startField];
54931
- if (startValue <= value && endValue >= value) return record;
54930
+ endValue = record[endField || startField],
54931
+ min = Math.min(startValue, endValue),
54932
+ max = Math.max(startValue, endValue);
54933
+ if (min <= value && max >= value) return record;
54932
54934
  }
54933
54935
  }
54934
54936
  return null;
@@ -59000,8 +59002,11 @@
59000
59002
  field2 = "xField" === field ? series.fieldX2 : series.fieldY2,
59001
59003
  datum = getDatumByValue(series.getViewData().latestData, +value, field1, field2);
59002
59004
  if (datum) {
59003
- const startX = "xField" === field ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
59004
- field2 ? (bandSize = Math.abs(startX - ("xField" === field ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum))), value = `${datum[field1]} ~ ${datum[field2]}`) : bandSize = 1, coord = startX;
59005
+ const posStart = "xField" === field ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
59006
+ if (field2) {
59007
+ const posEnd = "xField" === field ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum);
59008
+ bandSize = Math.abs(posStart - posEnd), coord = Math.min(posStart, posEnd), value = `${datum[field1]} ~ ${datum[field2]}`;
59009
+ } else bandSize = 1, coord = posStart;
59005
59010
  }
59006
59011
  niceLabelFormatter = axis.niceLabelFormatter;
59007
59012
  }