@wil-works/evoke-charts 0.5.0 → 0.7.0

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/dist/ai.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as SPEC_RULES, c as inferColumns, d as parseNumeric, f as chartOptionsSchema, i as formatExamples, l as looksLikeTime, n as buildChartPrompt, o as detectIntent, p as validateOptions, r as SPEC_EXAMPLES, s as generateChartSpec, t as lintChartSpec, u as parseDataTable } from "./ai-BmXDig6M.js";
2
- export { SPEC_EXAMPLES, SPEC_RULES, buildChartPrompt, chartOptionsSchema, detectIntent, formatExamples, generateChartSpec, inferColumns, lintChartSpec, looksLikeTime, parseDataTable, parseNumeric, validateOptions };
1
+ import { _ as chartOptionsSchema, a as formatExamples, c as detectIntent, d as planThreed, f as wantsThreed, g as parseNumeric, h as parseDataTable, i as SPEC_EXAMPLES_3D, l as generateChartSpec, m as looksLikeTime, n as buildChartPrompt, o as formatExamples3d, p as inferColumns, r as SPEC_EXAMPLES, s as SPEC_RULES, t as lintChartSpec, u as SPEC_RULES_3D, v as validateOptions } from "./ai-cRi95pS2.js";
2
+ export { SPEC_EXAMPLES, SPEC_EXAMPLES_3D, SPEC_RULES, SPEC_RULES_3D, buildChartPrompt, chartOptionsSchema, detectIntent, formatExamples, formatExamples3d, generateChartSpec, inferColumns, lintChartSpec, looksLikeTime, parseDataTable, parseNumeric, planThreed, validateOptions, wantsThreed };
@@ -1,5 +1,165 @@
1
1
 
2
- .ev-chart[data-v-df8a90cc] {
2
+ .ev-chart3d[data-v-36ccea38] {
3
+ --ev-chart3d-surface: var(--ev-bg-color-overlay, #ffffff);
4
+ --ev-chart3d-text: var(--ev-text-color-primary, #1f2937);
5
+ --ev-chart3d-text-secondary: var(--ev-text-color-secondary, #6b7280);
6
+ --ev-chart3d-border: var(--ev-border-color, rgba(31, 41, 55, 0.16));
7
+ --ev-chart3d-fill: var(--ev-fill-color-light, rgba(31, 41, 55, 0.05));
8
+ position: relative;
9
+ overflow: hidden;
10
+ font-family: var(--ev-font-family, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif);
11
+ }
12
+ .ev-chart3d__canvas[data-v-36ccea38] {
13
+ display: block;
14
+ width: 100%;
15
+ height: 100%;
16
+ touch-action: none;
17
+ cursor: grab;
18
+ }
19
+ .ev-chart3d__canvas[data-v-36ccea38]:active {
20
+ cursor: grabbing;
21
+ }
22
+ .ev-chart3d__overlay[data-v-36ccea38] {
23
+ position: absolute;
24
+ inset: 0;
25
+ pointer-events: none;
26
+ }
27
+ .ev-chart3d__empty[data-v-36ccea38],
28
+ .ev-chart3d__loading[data-v-36ccea38],
29
+ .ev-chart3d__error[data-v-36ccea38] {
30
+ position: absolute;
31
+ inset: 0;
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ justify-content: center;
36
+ gap: 8px;
37
+ }
38
+ .ev-chart3d__empty-icon-wrap[data-v-36ccea38] {
39
+ width: 52px;
40
+ height: 52px;
41
+ border-radius: 50%;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ background: var(--ev-chart3d-fill);
46
+ color: var(--ev-chart3d-text-secondary);
47
+ }
48
+ .ev-chart3d__empty-img[data-v-36ccea38] {
49
+ width: 26px;
50
+ height: 26px;
51
+ }
52
+ .ev-chart3d__empty-text[data-v-36ccea38] {
53
+ font-size: 12px;
54
+ color: var(--ev-chart3d-text-secondary);
55
+ }
56
+ .ev-chart3d__loading-bars[data-v-36ccea38] {
57
+ display: flex;
58
+ align-items: flex-end;
59
+ gap: 5px;
60
+ height: 34px;
61
+ }
62
+ .ev-chart3d__loading-bar[data-v-36ccea38] {
63
+ width: 6px;
64
+ border-radius: 3px;
65
+ background: var(--ev-chart3d-border);
66
+ animation: ev-chart3d-shimmer-36ccea38 1.1s ease-in-out infinite;
67
+ }
68
+ .ev-chart3d__error[data-v-36ccea38] {
69
+ color: var(--ev-color-danger, #dc2626);
70
+ font-size: 12px;
71
+ }
72
+ .ev-chart3d__error-icon[data-v-36ccea38] {
73
+ font-size: 22px;
74
+ display: inline-flex;
75
+ }
76
+ .ev-chart3d__tooltip[data-v-36ccea38] {
77
+ position: absolute;
78
+ z-index: 20;
79
+ max-width: 260px;
80
+ padding: 8px 10px;
81
+ border-radius: 8px;
82
+ background: var(--ev-chart3d-surface);
83
+ border: 1px solid var(--ev-chart3d-border);
84
+ box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
85
+ pointer-events: none;
86
+ font-size: 12px;
87
+ line-height: 1.5;
88
+ color: var(--ev-chart3d-text);
89
+ }
90
+ .ev-chart3d__tooltip-title[data-v-36ccea38] {
91
+ font-weight: 600;
92
+ margin-bottom: 4px;
93
+ }
94
+ .ev-chart3d__tooltip-item[data-v-36ccea38] {
95
+ display: flex;
96
+ align-items: center;
97
+ gap: 6px;
98
+ }
99
+ .ev-chart3d__tooltip-dot[data-v-36ccea38] {
100
+ width: 8px;
101
+ height: 8px;
102
+ border-radius: 50%;
103
+ flex: none;
104
+ }
105
+ .ev-chart3d__tooltip-name[data-v-36ccea38] {
106
+ color: var(--ev-chart3d-text-secondary);
107
+ margin-right: auto;
108
+ }
109
+ .ev-chart3d__tooltip-value[data-v-36ccea38] {
110
+ font-variant-numeric: tabular-nums;
111
+ font-weight: 500;
112
+ }
113
+ .ev-chart3d__sr-only[data-v-36ccea38] {
114
+ position: absolute;
115
+ width: 1px;
116
+ height: 1px;
117
+ padding: 0;
118
+ margin: -1px;
119
+ overflow: hidden;
120
+ clip: rect(0, 0, 0, 0);
121
+ white-space: nowrap;
122
+ border: 0;
123
+ }
124
+ .ev-chart3d-fade-enter-active[data-v-36ccea38],
125
+ .ev-chart3d-fade-leave-active[data-v-36ccea38] {
126
+ transition: opacity 0.24s ease;
127
+ }
128
+ .ev-chart3d-fade-enter-from[data-v-36ccea38],
129
+ .ev-chart3d-fade-leave-to[data-v-36ccea38] {
130
+ opacity: 0;
131
+ }
132
+ .ev-chart3d-tooltip-enter-active[data-v-36ccea38],
133
+ .ev-chart3d-tooltip-leave-active[data-v-36ccea38] {
134
+ transition: opacity 0.16s ease;
135
+ }
136
+ .ev-chart3d-tooltip-enter-from[data-v-36ccea38],
137
+ .ev-chart3d-tooltip-leave-to[data-v-36ccea38] {
138
+ opacity: 0;
139
+ }
140
+ @keyframes ev-chart3d-shimmer-36ccea38 {
141
+ 0%, 100% { height: 10px; opacity: 0.55;
142
+ }
143
+ 50% { height: 30px; opacity: 1;
144
+ }
145
+ }
146
+
147
+ /* 暗色覆盖(与生态一致:html.dark 为准) */
148
+ html.dark .ev-chart3d__tooltip {
149
+ background: var(--ev-bg-color-overlay, #1f2937);
150
+ border-color: var(--ev-border-color, rgba(229, 231, 235, 0.2));
151
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
152
+ color: var(--ev-text-color-primary, #e5e7eb);
153
+ }
154
+ html.dark .ev-chart3d {
155
+ --ev-chart3d-surface: var(--ev-bg-color-overlay, #1f2937);
156
+ --ev-chart3d-text: var(--ev-text-color-primary, #e5e7eb);
157
+ --ev-chart3d-text-secondary: var(--ev-text-color-secondary, #9ca3af);
158
+ --ev-chart3d-border: var(--ev-border-color, rgba(229, 231, 235, 0.2));
159
+ --ev-chart3d-fill: var(--ev-fill-color-dark, rgba(229, 231, 235, 0.08));
160
+ }
161
+
162
+ .ev-chart[data-v-af1c6d5e] {
3
163
  position: relative;
4
164
  /* 容器不带边框:是否加框、加多粗由宿主决定,图表只负责内容;
5
165
  圆角裁剪下沉到 canvas 与浮层自身(border-radius: inherit) */
@@ -8,8 +168,14 @@
8
168
  background: var(--ev-bg-color, #ffffff);
9
169
  }
10
170
 
171
+ /* 键盘可达(DESIGN §13.7 期 1):容器可聚焦,焦点环贴内缘不裁切 */
172
+ .ev-chart[data-v-af1c6d5e]:focus-visible {
173
+ outline: 2px solid var(--ev-color-primary, #175dff);
174
+ outline-offset: -2px;
175
+ }
176
+
11
177
  /* 关键:canvas 必须能接收鼠标事件 */
12
- .ev-chart__canvas[data-v-df8a90cc] {
178
+ .ev-chart__canvas[data-v-af1c6d5e] {
13
179
  position: absolute;
14
180
  top: 0;
15
181
  left: 0;
@@ -23,14 +189,14 @@
23
189
 
24
190
  /* HTML 覆盖层:只在内容层,不与 canvas 抢交互(子元素可自行 pointer-events:auto),
25
191
  也不压过 tooltip(z-index 100) */
26
- .ev-chart__overlay[data-v-df8a90cc] {
192
+ .ev-chart__overlay[data-v-af1c6d5e] {
27
193
  position: absolute;
28
194
  inset: 0;
29
195
  z-index: 1;
30
196
  pointer-events: none;
31
197
  border-radius: inherit;
32
198
  }
33
- .ev-chart__tooltip[data-v-df8a90cc] {
199
+ .ev-chart__tooltip[data-v-af1c6d5e] {
34
200
  position: absolute;
35
201
  pointer-events: none;
36
202
  z-index: 100;
@@ -50,47 +216,47 @@
50
216
  }
51
217
 
52
218
  /* tooltip 淡入淡出(仅 opacity,位置由 left/top transition 负责) */
53
- .ev-chart-tooltip-enter-active[data-v-df8a90cc],
54
- .ev-chart-tooltip-leave-active[data-v-df8a90cc] {
219
+ .ev-chart-tooltip-enter-active[data-v-af1c6d5e],
220
+ .ev-chart-tooltip-leave-active[data-v-af1c6d5e] {
55
221
  transition: var(--ev-tooltip-fade-transition);
56
222
  }
57
223
 
58
224
  /* 进入期间禁用位置 transition,避免首次出现时从旧位置滑入 */
59
- .ev-chart-tooltip-enter-active[data-v-df8a90cc] {
225
+ .ev-chart-tooltip-enter-active[data-v-af1c6d5e] {
60
226
  transition:
61
227
  var(--ev-tooltip-fade-transition),
62
228
  left 0s,
63
229
  top 0s;
64
230
  }
65
- .ev-chart-tooltip-enter-from[data-v-df8a90cc],
66
- .ev-chart-tooltip-leave-to[data-v-df8a90cc] {
231
+ .ev-chart-tooltip-enter-from[data-v-af1c6d5e],
232
+ .ev-chart-tooltip-leave-to[data-v-af1c6d5e] {
67
233
  opacity: 0;
68
234
  }
69
235
 
70
236
  /* v-html 注入的内容不带 scoped 属性,需用 :deep() 穿透 */
71
- [data-v-df8a90cc] .ev-chart__tooltip-title {
237
+ [data-v-af1c6d5e] .ev-chart__tooltip-title {
72
238
  color: var(--ev-text-color-secondary, #6b7280);
73
239
  font-size: 12px;
74
240
  margin-bottom: 6px;
75
241
  font-weight: 500;
76
242
  }
77
- [data-v-df8a90cc] .ev-chart__tooltip-item {
243
+ [data-v-af1c6d5e] .ev-chart__tooltip-item {
78
244
  display: flex;
79
245
  align-items: center;
80
246
  gap: 8px;
81
247
  padding: 2px 0;
82
248
  }
83
- [data-v-df8a90cc] .ev-chart__tooltip-dot {
249
+ [data-v-af1c6d5e] .ev-chart__tooltip-dot {
84
250
  width: 8px;
85
251
  height: 8px;
86
252
  border-radius: 50%;
87
253
  flex-shrink: 0;
88
254
  display: inline-block;
89
255
  }
90
- [data-v-df8a90cc] .ev-chart__tooltip-name {
256
+ [data-v-af1c6d5e] .ev-chart__tooltip-name {
91
257
  color: var(--ev-text-color-primary, #111827);
92
258
  }
93
- [data-v-df8a90cc] .ev-chart__tooltip-value {
259
+ [data-v-af1c6d5e] .ev-chart__tooltip-value {
94
260
  color: var(--ev-text-color-primary, #111827);
95
261
  font-weight: 600;
96
262
  margin-left: auto;
@@ -99,7 +265,7 @@
99
265
  }
100
266
 
101
267
  /* ══════ 空数据占位 ══════ */
102
- .ev-chart__empty[data-v-df8a90cc] {
268
+ .ev-chart__empty[data-v-af1c6d5e] {
103
269
  position: absolute;
104
270
  inset: 0;
105
271
  border-radius: inherit;
@@ -112,7 +278,7 @@
112
278
  gap: 14px;
113
279
  user-select: none;
114
280
  }
115
- .ev-chart__empty-icon-wrap[data-v-df8a90cc] {
281
+ .ev-chart__empty-icon-wrap[data-v-af1c6d5e] {
116
282
  display: flex;
117
283
  align-items: center;
118
284
  justify-content: center;
@@ -121,19 +287,19 @@
121
287
  border-radius: 16px;
122
288
  background: var(--ev-fill-color-light, #f5f7fa);
123
289
  }
124
- .ev-chart__empty-img[data-v-df8a90cc] {
290
+ .ev-chart__empty-img[data-v-af1c6d5e] {
125
291
  width: 32px;
126
292
  height: 32px;
127
293
  opacity: 0.4;
128
294
  }
129
- .ev-chart__empty-text[data-v-df8a90cc] {
295
+ .ev-chart__empty-text[data-v-af1c6d5e] {
130
296
  letter-spacing: 0.04em;
131
297
  font-weight: 500;
132
298
  font-size: 13px;
133
299
  }
134
300
 
135
301
  /* ══════ 加载中骨架 ══════ */
136
- .ev-chart__loading[data-v-df8a90cc] {
302
+ .ev-chart__loading[data-v-af1c6d5e] {
137
303
  position: absolute;
138
304
  inset: 0;
139
305
  border-radius: inherit;
@@ -142,20 +308,20 @@
142
308
  justify-content: center;
143
309
  background: var(--ev-bg-color, #ffffff);
144
310
  }
145
- .ev-chart__loading-bars[data-v-df8a90cc] {
311
+ .ev-chart__loading-bars[data-v-af1c6d5e] {
146
312
  display: flex;
147
313
  align-items: flex-end;
148
314
  gap: 6px;
149
315
  height: 60px;
150
316
  }
151
- .ev-chart__loading-bar[data-v-df8a90cc] {
317
+ .ev-chart__loading-bar[data-v-af1c6d5e] {
152
318
  width: 10px;
153
319
  height: 40px;
154
320
  border-radius: 4px;
155
321
  background: var(--ev-border-color, #e2e8f0);
156
- animation: ev-chart-shimmer-df8a90cc 1.2s ease-in-out infinite;
322
+ animation: ev-chart-shimmer-af1c6d5e 1.2s ease-in-out infinite;
157
323
  }
158
- @keyframes ev-chart-shimmer-df8a90cc {
324
+ @keyframes ev-chart-shimmer-af1c6d5e {
159
325
  0%,
160
326
  100% {
161
327
  transform: scaleY(0.4);
@@ -168,7 +334,7 @@
168
334
  }
169
335
 
170
336
  /* ══════ 错误边界 ══════ */
171
- .ev-chart__error[data-v-df8a90cc] {
337
+ .ev-chart__error[data-v-af1c6d5e] {
172
338
  position: absolute;
173
339
  inset: 0;
174
340
  border-radius: inherit;
@@ -182,13 +348,13 @@
182
348
  padding: 20px;
183
349
  text-align: center;
184
350
  }
185
- .ev-chart__error-icon[data-v-df8a90cc] {
351
+ .ev-chart__error-icon[data-v-af1c6d5e] {
186
352
  display: flex;
187
353
  align-items: center;
188
354
  justify-content: center;
189
355
  font-size: 30px;
190
356
  }
191
- .ev-chart__error-text[data-v-df8a90cc] {
357
+ .ev-chart__error-text[data-v-af1c6d5e] {
192
358
  font-size: 12px;
193
359
  line-height: 1.5;
194
360
  max-width: 80%;
@@ -196,17 +362,17 @@
196
362
  }
197
363
 
198
364
  /* ══════ 进入/离开淡入淡出 ══════ */
199
- .ev-chart-fade-enter-active[data-v-df8a90cc],
200
- .ev-chart-fade-leave-active[data-v-df8a90cc] {
365
+ .ev-chart-fade-enter-active[data-v-af1c6d5e],
366
+ .ev-chart-fade-leave-active[data-v-af1c6d5e] {
201
367
  transition: opacity 0.2s ease;
202
368
  }
203
- .ev-chart-fade-enter-from[data-v-df8a90cc],
204
- .ev-chart-fade-leave-to[data-v-df8a90cc] {
369
+ .ev-chart-fade-enter-from[data-v-af1c6d5e],
370
+ .ev-chart-fade-leave-to[data-v-af1c6d5e] {
205
371
  opacity: 0;
206
372
  }
207
373
 
208
374
  /* ══════ 无障碍:sr-only ══════ */
209
- .ev-chart__sr-only[data-v-df8a90cc] {
375
+ .ev-chart__sr-only[data-v-af1c6d5e] {
210
376
  position: absolute;
211
377
  width: 1px;
212
378
  height: 1px;