@visactor/vseed 0.3.13 → 0.3.14

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.
@@ -14,17 +14,19 @@ export type BaseMeasure = {
14
14
  */
15
15
  alias?: string;
16
16
  /**
17
- * @description 自动数值格式化 当配置了 format 时, 该配置项失效
18
- * 开启后, 图表的数据标签、提示信息, 会根据指标的数值, 自动根据语言环境, 选择合适的格式化方式
19
- * 格式化规则为设置为十进制数值, 开启compact notation, 最小0位小数, 最大2位小数, 自动四舍五入, 使用浏览器提供的 Intl.NumberFormatOptions 实现该逻辑.
17
+ * @description 自动数值格式化,默认开启,优先级最高
18
+ * autoFormat=true 时,会覆盖 numFormat 的所有配置
19
+ * 开启后,图表的数据标签、提示信息会根据指标数值和语言环境自动选择合适的格式化方式
20
+ * 格式化规则:十进制数值,开启 compact notation,最小0位小数,最大2位小数,自动四舍五入,使用浏览器提供的 Intl.NumberFormat 实现
20
21
  * 例如:
21
- * locale为zh-CN: 749740.264会被自动格式化为74.45万
22
- * locale为en-US: 749740.264会被自动格式化为744.5K
22
+ * - locale为zh-CN: 749740.26474.45万
23
+ * - locale为en-US: 749740.264744.5K
23
24
  * @default true
24
25
  */
25
26
  autoFormat?: boolean;
26
27
  /**
27
- * @description 指标的数值格式化, 会自动应用于label、tooltip
28
+ * @description 自定义指标的数值格式化,会自动应用于 label、tooltip
29
+ * 注意:若要使用自定义格式化,必须显式设置 autoFormat=false,否则 autoFormat 会覆盖此配置
28
30
  */
29
31
  numFormat?: NumFormat;
30
32
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vseed",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -61,19 +61,20 @@
61
61
  "build": "rslib build",
62
62
  "dev:rsdoctor": "RSDOCTOR=true rslib dev",
63
63
  "build:rsdoctor": "RSDOCTOR=true rslib build",
64
+ "build:docs": "node ./scripts/build-docs.mjs",
65
+ "build:api": "node ./scripts/build-api.mjs",
66
+ "build:test": "node ./scripts/build-tests.mjs",
67
+ "g": "pnpm run build:test && pnpm run build:docs && pnpm run build:api",
64
68
  "format": "prettier --write .",
65
69
  "lint": "eslint . --cache",
66
70
  "typecheck": "tsc --noEmit",
67
- "rstest": "rstest",
68
- "rstest:update": "rstest --update",
69
- "rstest:coverage": "rstest --update --coverage && open coverage/index.html",
70
71
  "test": "vitest run",
72
+ "test:update": "vitest run --update",
73
+ "test:coverage": "vitest run --update --coverage && node scripts/build-coverage-badge.mjs && open coverage/index.html",
71
74
  "test:unit": "vitest run tests/unit",
72
75
  "test:unit:coverage": "vitest run tests/unit --coverage && open coverage/index.html",
73
76
  "test:integration": "vitest run tests/integration",
74
77
  "test:integration:update": "vitest run tests/integration --update",
75
- "test:integration:coverage": "vitest run tests/integration --coverage && open coverage/index.html",
76
- "test:update": "vitest run --update",
77
- "test:coverage": "vitest run --update --coverage && open coverage/index.html"
78
+ "test:integration:coverage": "vitest run tests/integration --coverage && open coverage/index.html"
78
79
  }
79
80
  }