@libs-ui/utils 0.2.283 → 0.2.285

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.
@@ -13,19 +13,22 @@ interface AxisScaleResult {
13
13
  tickAmount: number;
14
14
  }
15
15
  /**
16
- * Calculates smart axis scale for charts
16
+ * Tính toán smart axis scale cho biểu đồ
17
17
  *
18
- * @description This function can throw errors if:
19
- * - maxData < 0 and acceptNegative is false
20
- * - minNegative is undefined and acceptNegative is true
21
- * - maxData < minNegative (only when acceptNegative is true)
22
- * - minNegative > 0 (only when acceptNegative is true)
18
+ * @param maxData - Giá trị tối đa của dữ liệu
19
+ * @param options - Các tùy chọn cấu hình axis scale
20
+ * @returns Cấu hình axis scale bao gồm stepSize, max, min, tickAmount
23
21
  *
24
- * @throws {Error} Validation errors for invalid input combinations
25
- * @required Always wrap this function in try-catch and handle exceptions
26
- * @param maxData - Maximum data value
27
- * @param options - Configuration options for axis scaling
28
- * @returns Axis scale configuration
22
+ * @throws {Error} INVALID_NEGATIVE_DATA - khi maxData < 0 mà acceptNegative = false
23
+ * @throws {Error} MISSING_MIN_NEGATIVE - khi acceptNegative = true nhưng thiếu minNegative
24
+ * @throws {Error} INVALID_RANGE - khi maxData < minNegative
25
+ * @throws {Error} INVALID_MIN_NEGATIVE - khi minNegative >= 0
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const result = getSmartAxisScale(100, { minTickCount: 5, maxTickCount: 10 });
30
+ * // returns { stepSize: 20, max: 120, min: 0, tickAmount: 6 }
31
+ * ```
29
32
  */
30
- export declare const getSmartAxisScale: (maxData: number, options?: AxisScaleOptions) => AxisScaleResult;
33
+ export declare const getSmartAxisScale: (originalMaxData: number, options?: AxisScaleOptions) => AxisScaleResult;
31
34
  export {};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@libs-ui/utils",
3
- "version": "0.2.283",
3
+ "version": "0.2.285",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.0",
6
6
  "@angular/core": "^18.2.0",
7
7
  "crypto-es": "^2.1.0",
8
8
  "dayjs": "1.11.5",
9
- "@libs-ui/interfaces-types": "0.2.283",
9
+ "@libs-ui/interfaces-types": "0.2.285",
10
10
  "rxjs": "~7.8.0"
11
11
  },
12
12
  "sideEffects": false,