@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.
- package/esm2022/get-smart-axis-scale.mjs +123 -135
- package/fesm2022/libs-ui-utils.mjs +122 -134
- package/fesm2022/libs-ui-utils.mjs.map +1 -1
- package/get-smart-axis-scale.d.ts +15 -12
- package/package.json +2 -2
|
@@ -13,19 +13,22 @@ interface AxisScaleResult {
|
|
|
13
13
|
tickAmount: number;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Tính toán smart axis scale cho biểu đồ
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
19
|
-
* -
|
|
20
|
-
*
|
|
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}
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
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: (
|
|
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.
|
|
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.
|
|
9
|
+
"@libs-ui/interfaces-types": "0.2.285",
|
|
10
10
|
"rxjs": "~7.8.0"
|
|
11
11
|
},
|
|
12
12
|
"sideEffects": false,
|