@easyv/charts 1.10.39 → 1.10.40

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.
@@ -43,13 +43,6 @@ var getHighlightData = function getHighlightData(data, extent) {
43
43
  return data;
44
44
  }
45
45
  };
46
- var formatWithComma = function formatWithComma(value) {
47
- if (value === null || value === undefined || value === "") return value;
48
- return String(value).replace(/^(-?\d+)(\.\d+)?$/, function (_, _int) {
49
- var dec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
50
- return _int.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + dec;
51
- });
52
- };
53
46
  var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref) {
54
47
  var isXRepeat = _ref.isXRepeat,
55
48
  _ref$config = _ref.config,
@@ -242,7 +235,7 @@ var Label = function Label(_ref5) {
242
235
  _ref5$dominantBaselin = _ref5.dominantBaseline,
243
236
  dominantBaseline = _ref5$dominantBaselin === void 0 ? "middle" : _ref5$dominantBaselin,
244
237
  reverse = _ref5.reverse;
245
- var displayValue = commaFormatting ? formatWithComma(value) : value;
238
+ var displayValue = commaFormatting ? (0, _utils.formatWithComma)(value) : value;
246
239
  return /*#__PURE__*/React.createElement("text", {
247
240
  x: x,
248
241
  y: y,
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.SvgBackground = void 0;
8
8
  exports.band = band;
9
- exports.sortPie = exports.seriesYOrZ = exports.reverseGradientStops = exports.resetStacks = exports.renderCanvasBackground = exports.reduceConfig = exports.mathR = exports.isValidHttpUrl = exports.identity = exports.getTranslate3d = exports.getTranslate2d = exports.getTicksOfAxis = exports.getTickCoord = exports.getStacks = exports.getSeriesInfo = exports.getMultiColorStr = exports.getMousePos = exports.getMargin = exports.getIcon = exports.getGridCoord = exports.getFontStyle = exports.getDomPath = exports.getDataWithPercent = exports.getCurrentStack = exports.getControlVisibleData = exports.getColorList = exports.getChildren = exports.getBreakWord = exports.getBandwidth = exports.getBandSeriesStepAndWidth = exports.getBandBackground = exports.formatFont = exports.filterChildren = exports.dateFormat = exports.dataYOrZ = void 0;
9
+ exports.sortPie = exports.seriesYOrZ = exports.reverseGradientStops = exports.resetStacks = exports.renderCanvasBackground = exports.reduceConfig = exports.mathR = exports.isValidHttpUrl = exports.identity = exports.getTranslate3d = exports.getTranslate2d = exports.getTicksOfAxis = exports.getTickCoord = exports.getStacks = exports.getSeriesInfo = exports.getMultiColorStr = exports.getMousePos = exports.getMargin = exports.getIcon = exports.getGridCoord = exports.getFontStyle = exports.getDomPath = exports.getDataWithPercent = exports.getCurrentStack = exports.getControlVisibleData = exports.getColorList = exports.getChildren = exports.getBreakWord = exports.getBandwidth = exports.getBandSeriesStepAndWidth = exports.getBandBackground = exports.formatWithComma = exports.formatFont = exports.filterChildren = exports.dateFormat = exports.dataYOrZ = void 0;
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -24,6 +24,13 @@ var defaultBackground = "#000000";
24
24
  var defaultIcon = {
25
25
  background: defaultBackground
26
26
  };
27
+ var formatWithComma = exports.formatWithComma = function formatWithComma(value) {
28
+ if (value === null || value === undefined || value === "") return value;
29
+ return String(value).replace(/^(-?\d+)(\.\d+)?$/, function (_, _int) {
30
+ var dec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
31
+ return _int.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + dec;
32
+ });
33
+ };
27
34
  var defaultLineIcon = {
28
35
  height: 2,
29
36
  background: defaultBackground
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.10.39",
3
+ "version": "1.10.40",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -8,6 +8,7 @@ import {
8
8
  getSeriesInfo,
9
9
  getFontStyle,
10
10
  formatFont,
11
+ formatWithComma,
11
12
  } from "../utils";
12
13
  import { chartContext } from "../context";
13
14
 
@@ -30,13 +31,6 @@ const getHighlightData = (data, extent) => {
30
31
  }
31
32
  };
32
33
 
33
- const formatWithComma = (value) => {
34
- if (value === null || value === undefined || value === "") return value;
35
- return String(value).replace(/^(-?\d+)(\.\d+)?$/, (_, int, dec = "") => {
36
- return int.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + dec;
37
- });
38
- };
39
-
40
34
  export default memo(
41
35
  ({
42
36
  isXRepeat,
@@ -112,10 +106,8 @@ export default memo(
112
106
  x == curXLabel ? selectConfig : flag ? highlightConfig : other;
113
107
  const showIcon = icon && icon.show;
114
108
  const showLabel = label && label.show;
115
- const {
116
- position: _position = "outerStart",
117
- reverse = true,
118
- } = label || {};
109
+ const { position: _position = "outerStart", reverse = true } =
110
+ label || {};
119
111
 
120
112
  if (isClipAxis) {
121
113
  if (end > +clipValue) {
@@ -14,6 +14,12 @@ const defaultBackground = "#000000";
14
14
  const defaultIcon = {
15
15
  background: defaultBackground,
16
16
  };
17
+ const formatWithComma = (value) => {
18
+ if (value === null || value === undefined || value === "") return value;
19
+ return String(value).replace(/^(-?\d+)(\.\d+)?$/, (_, int, dec = "") => {
20
+ return int.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + dec;
21
+ });
22
+ };
17
23
  const defaultLineIcon = {
18
24
  height: 2,
19
25
  background: defaultBackground,
@@ -923,6 +929,7 @@ const getControlVisibleData = (originData, axisX, controlInfo, chartWidth) => {
923
929
  };
924
930
 
925
931
  export {
932
+ formatWithComma,
926
933
  dateFormat,
927
934
  getBreakWord,
928
935
  getTicksOfAxis,