x-next 1.7.0 → 1.8.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.
Files changed (88) hide show
  1. package/AI_USAGE.md +129 -4
  2. package/CHANGELOG.md +47 -0
  3. package/dist/_hooks/use-chart-size.d.ts +25 -0
  4. package/dist/_utils/chart/index.d.ts +6 -0
  5. package/dist/_utils/chart/padding.d.ts +15 -0
  6. package/dist/_utils/chart/path.d.ts +34 -0
  7. package/dist/_utils/chart/scale.d.ts +55 -0
  8. package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
  9. package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
  10. package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
  11. package/dist/components/_components/chart/colors.d.ts +10 -0
  12. package/dist/components/_components/chart/interface.d.ts +38 -0
  13. package/dist/components/bar-chart/BarChart.d.ts +278 -0
  14. package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
  15. package/dist/components/bar-chart/index.d.ts +600 -0
  16. package/dist/components/bar-chart/interface.d.ts +74 -0
  17. package/dist/components/bar-chart/props.d.ts +145 -0
  18. package/dist/components/heatmap/Heatmap.d.ts +10 -1
  19. package/dist/components/heatmap/index.d.ts +30 -3
  20. package/dist/components/index.d.ts +3 -0
  21. package/dist/components/line-chart/LineChart.d.ts +295 -0
  22. package/dist/components/line-chart/helpers/layout.d.ts +74 -0
  23. package/dist/components/line-chart/index.d.ts +614 -0
  24. package/dist/components/line-chart/interface.d.ts +76 -0
  25. package/dist/components/line-chart/props.d.ts +173 -0
  26. package/dist/components/pie-chart/PieChart.d.ts +219 -0
  27. package/dist/components/pie-chart/index.d.ts +470 -0
  28. package/dist/components/pie-chart/interface.d.ts +58 -0
  29. package/dist/components/pie-chart/props.d.ts +107 -0
  30. package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
  31. package/dist/components/trend-chart/index.d.ts +33 -187
  32. package/dist/components/trend-chart/props.d.ts +9 -78
  33. package/dist/components/trend-chart/themes.d.ts +0 -1
  34. package/dist/es/_hooks/use-chart-size.js +25 -0
  35. package/dist/es/_styles/palette-aliases.js +5 -0
  36. package/dist/es/_utils/chart/padding.js +22 -0
  37. package/dist/es/_utils/chart/path.js +69 -0
  38. package/dist/es/_utils/chart/scale.js +77 -0
  39. package/dist/es/components/_components/chart/ChartAxis.js +79 -0
  40. package/dist/es/components/_components/chart/ChartLegend.js +53 -0
  41. package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
  42. package/dist/es/components/_components/chart/colors.js +12 -0
  43. package/dist/es/components/bar-chart/BarChart.js +470 -0
  44. package/dist/es/components/bar-chart/helpers/layout.js +53 -0
  45. package/dist/es/components/bar-chart/index.js +8 -0
  46. package/dist/es/components/bar-chart/props.js +148 -0
  47. package/dist/es/components/heatmap/Heatmap.js +249 -172
  48. package/dist/es/components/index.js +132 -126
  49. package/dist/es/components/line-chart/LineChart.js +532 -0
  50. package/dist/es/components/line-chart/helpers/layout.js +80 -0
  51. package/dist/es/components/line-chart/index.js +8 -0
  52. package/dist/es/components/line-chart/props.js +178 -0
  53. package/dist/es/components/pie-chart/PieChart.js +397 -0
  54. package/dist/es/components/pie-chart/index.js +8 -0
  55. package/dist/es/components/pie-chart/props.js +104 -0
  56. package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
  57. package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
  58. package/dist/es/components/trend-chart/props.js +28 -74
  59. package/dist/es/components/trend-chart/themes.js +30 -31
  60. package/dist/es/index.js +193 -187
  61. package/dist/es/locale/en-US.js +8 -1
  62. package/dist/es/locale/zh-CN.js +8 -1
  63. package/dist/es/style.css +1 -1
  64. package/dist/index.cjs +4 -4
  65. package/dist/index.umd.js +4 -4
  66. package/dist/locale/interface.d.ts +13 -0
  67. package/dist/style/bar-chart.css +1 -0
  68. package/dist/style/bar-chart.js +2 -0
  69. package/dist/style/base.css +1 -1
  70. package/dist/style/heatmap.css +1 -1
  71. package/dist/style/line-chart.css +1 -0
  72. package/dist/style/line-chart.js +2 -0
  73. package/dist/style/pie-chart.css +1 -0
  74. package/dist/style/pie-chart.js +2 -0
  75. package/dist/style.css +1 -1
  76. package/dist/types.d.ts +3 -0
  77. package/package.json +1 -1
  78. package/volar.d.ts +3 -0
  79. package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
  80. package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
  81. package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
  82. package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
  83. package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
  84. package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
  85. package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
  86. package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
  87. package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
  88. package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
@@ -1,6 +1,6 @@
1
1
  import { definePropType as t } from "../../_utils/vue-eco.js";
2
- import r from "./helpers/validatePadding.js";
3
- const o = {
2
+ import { validatePadding as r } from "../../_utils/chart/padding.js";
3
+ const u = {
4
4
  // 数据集
5
5
  dataset: {
6
6
  required: !0,
@@ -21,16 +21,6 @@ const o = {
21
21
  type: [Number, String],
22
22
  default: "100%"
23
23
  },
24
- // 网格属性
25
- grid: {
26
- default: null,
27
- type: t(Object)
28
- },
29
- // 标签属性
30
- labels: {
31
- default: null,
32
- type: t(Object)
33
- },
34
24
  // 最大值,传入后锁定数据域上界,超出部分被裁剪
35
25
  max: {
36
26
  type: Number
@@ -39,9 +29,15 @@ const o = {
39
29
  min: {
40
30
  type: Number
41
31
  },
42
- // 绘制边距,支持 1-4 个非负数字字符串或单个非负数字
32
+ /*
33
+ * 绘制边距,支持 1-4 个非负数字字符串或单个非负数字。
34
+ *
35
+ * 默认 3 是最小的安全值:激活态数据点半径为 3px,圆心落在边界上时
36
+ * 圆的顶端恰好与画布边缘相切;再小就会被画布裁掉。默认值取这个下界,
37
+ * 让曲线尽可能贴近画布顶部(迷你图重在形态,不需要多余的留白)。
38
+ */
43
39
  padding: {
44
- default: "5",
40
+ default: "3",
45
41
  type: [String, Number],
46
42
  validator(e) {
47
43
  return typeof e == "number" ? Number.isFinite(e) && e >= 0 : r(e);
@@ -89,6 +85,23 @@ const o = {
89
85
  ariaLabel: {
90
86
  type: String
91
87
  },
88
+ /*
89
+ * 已废弃:网格与坐标轴标签。
90
+ *
91
+ * 这两个能力在 1.7.0 发布过,但从定位上就不属于迷你图——带网格和坐标文字的
92
+ * 图是「读数的图」,应该用 LineChart。1.8.0 起不再渲染任何内容,
93
+ * 保留声明只为避免既有代码在升级时编译或运行报错。
94
+ *
95
+ * 保留一个次要版本后(2.0.0)彻底移除。
96
+ */
97
+ grid: {
98
+ default: null,
99
+ type: t(Object)
100
+ },
101
+ labels: {
102
+ default: null,
103
+ type: t(Object)
104
+ },
92
105
  // 主题
93
106
  theme: {
94
107
  type: t(Object),
@@ -162,67 +175,8 @@ const o = {
162
175
  theme: {
163
176
  type: t(Object)
164
177
  }
165
- }, i = {
166
- boundary: {
167
- required: !0,
168
- type: t(Object),
169
- default: () => {
170
- }
171
- },
172
- verticalLines: {
173
- default: !1,
174
- type: Boolean
175
- },
176
- verticalLinesNumber: {
177
- default: 0,
178
- type: Number
179
- },
180
- horizontalLines: {
181
- default: !1,
182
- type: Boolean
183
- },
184
- horizontalLinesNumber: {
185
- default: 0,
186
- type: Number
187
- }
188
- }, n = {
189
- boundary: {
190
- required: !0,
191
- type: t(Object),
192
- default: () => {
193
- }
194
- },
195
- minValue: {
196
- type: Number,
197
- required: !0
198
- },
199
- maxValue: {
200
- type: Number,
201
- required: !0
202
- },
203
- xLabels: {
204
- type: Array
205
- },
206
- yLabels: {
207
- type: Number,
208
- required: !0
209
- },
210
- yLabelsTextFormatter: {
211
- default: (e) => e,
212
- type: Function
213
- },
214
- // 标签字号,默认按绘图区高度自适应
215
- fontSize: {
216
- type: Number
217
- },
218
- // 标签颜色
219
- color: {
220
- type: String
221
- }
222
178
  };
223
179
  export {
224
180
  l as trendChartCurveProps,
225
- i as trendChartGridProps,
226
- n as trendChartLabelsProps,
227
- o as trendChartProps
181
+ u as trendChartProps
228
182
  };
@@ -1,15 +1,15 @@
1
- const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i = "var(--x-color-warning-solid)", c = "var(--x-color-text-secondary)", t = "var(--x-color-success-solid)", l = "var(--x-color-primary-solid)", a = "var(--x-color-border-subtle)", s = {
1
+ const o = "var(--x-color-danger-solid)", i = "var(--x-color-strong-solid)", r = "var(--x-color-warning-solid)", c = "var(--x-color-text-secondary)", t = "var(--x-color-success-solid)", l = "var(--x-color-primary-solid)", a = {
2
2
  DANGER: {
3
3
  // 主题色
4
4
  color: o,
5
5
  // 点
6
6
  point: {
7
- width: 3,
7
+ width: 2,
8
8
  color: o
9
9
  },
10
10
  // 描边
11
11
  stroke: {
12
- width: 2,
12
+ width: 1.5,
13
13
  color: o,
14
14
  opacity: 1
15
15
  },
@@ -20,53 +20,53 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
20
20
  },
21
21
  axisLine: {
22
22
  color: o,
23
- width: 2,
23
+ width: 1,
24
24
  opacity: 0.9
25
25
  }
26
26
  },
27
27
  STRONG: {
28
28
  // 主题色
29
- color: r,
29
+ color: i,
30
30
  // 点
31
31
  point: {
32
- width: 3,
33
- color: r
32
+ width: 2,
33
+ color: i
34
34
  },
35
35
  stroke: {
36
- width: 2,
37
- color: r,
36
+ width: 1.5,
37
+ color: i,
38
38
  opacity: 1
39
39
  },
40
40
  fill: {
41
- color: r,
41
+ color: i,
42
42
  opacity: 0.1
43
43
  },
44
44
  axisLine: {
45
- color: r,
46
- width: 2,
45
+ color: i,
46
+ width: 1,
47
47
  opacity: 0.9
48
48
  }
49
49
  },
50
50
  WARNING: {
51
51
  // 主题色
52
- color: i,
52
+ color: r,
53
53
  // 点
54
54
  point: {
55
- width: 3,
56
- color: i
55
+ width: 2,
56
+ color: r
57
57
  },
58
58
  stroke: {
59
- width: 2,
60
- color: i,
59
+ width: 1.5,
60
+ color: r,
61
61
  opacity: 1
62
62
  },
63
63
  fill: {
64
- color: i,
64
+ color: r,
65
65
  opacity: 0.1
66
66
  },
67
67
  axisLine: {
68
- color: i,
69
- width: 2,
68
+ color: r,
69
+ width: 1,
70
70
  opacity: 0.9
71
71
  }
72
72
  },
@@ -75,11 +75,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
75
75
  color: t,
76
76
  // 点
77
77
  point: {
78
- width: 3,
78
+ width: 2,
79
79
  color: t
80
80
  },
81
81
  stroke: {
82
- width: 2,
82
+ width: 1.5,
83
83
  color: t,
84
84
  opacity: 1
85
85
  },
@@ -89,7 +89,7 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
89
89
  },
90
90
  axisLine: {
91
91
  color: t,
92
- width: 2,
92
+ width: 1,
93
93
  opacity: 0.9
94
94
  }
95
95
  },
@@ -98,11 +98,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
98
98
  color: c,
99
99
  // 点
100
100
  point: {
101
- width: 3,
101
+ width: 2,
102
102
  color: c
103
103
  },
104
104
  stroke: {
105
- width: 2,
105
+ width: 1.5,
106
106
  color: c,
107
107
  opacity: 1
108
108
  },
@@ -112,7 +112,7 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
112
112
  },
113
113
  axisLine: {
114
114
  color: c,
115
- width: 2,
115
+ width: 1,
116
116
  opacity: 0.9
117
117
  }
118
118
  },
@@ -121,11 +121,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
121
121
  color: l,
122
122
  // 点
123
123
  point: {
124
- width: 3,
124
+ width: 2,
125
125
  color: l
126
126
  },
127
127
  stroke: {
128
- width: 2,
128
+ width: 1.5,
129
129
  color: l,
130
130
  opacity: 1
131
131
  },
@@ -135,12 +135,11 @@ const o = "var(--x-color-danger-solid)", r = "var(--x-color-strong-solid)", i =
135
135
  },
136
136
  axisLine: {
137
137
  color: l,
138
- width: 2,
138
+ width: 1,
139
139
  opacity: 0.9
140
140
  }
141
141
  }
142
142
  };
143
143
  export {
144
- a as TrendChartAxisColor,
145
- s as TrendChartTheme
144
+ a as TrendChartTheme
146
145
  };