@plotdb/chart 3.16.0 → 3.16.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.
- package/CHANGELOG.md +8 -0
- package/bundle.js +299 -59
- package/bundle.min.js +1 -1
- package/index.js +75 -15
- package/index.min.js +1 -1
- package/package.json +1 -1
- package/utils/config.js +224 -44
- package/utils/config.min.js +1 -1
package/utils/config.js
CHANGED
|
@@ -49,51 +49,91 @@
|
|
|
49
49
|
preset: {
|
|
50
50
|
'default': {
|
|
51
51
|
margin: {
|
|
52
|
-
type: 'number'
|
|
52
|
+
type: 'number',
|
|
53
|
+
desc: {
|
|
54
|
+
en: "space around the chart, in px",
|
|
55
|
+
"zh-TW": "圖表四周的留白 ( px )"
|
|
56
|
+
}
|
|
53
57
|
},
|
|
54
58
|
font: font,
|
|
55
59
|
color: {
|
|
56
60
|
type: 'color',
|
|
57
|
-
'default': 'currentColor'
|
|
61
|
+
'default': 'currentColor',
|
|
62
|
+
desc: {
|
|
63
|
+
en: "default color of text and lines",
|
|
64
|
+
"zh-TW": "文字與線條的預設顏色"
|
|
65
|
+
}
|
|
58
66
|
},
|
|
59
67
|
palette: {
|
|
60
|
-
type: 'palette'
|
|
68
|
+
type: 'palette',
|
|
69
|
+
desc: {
|
|
70
|
+
en: "colors for the data series or categories",
|
|
71
|
+
"zh-TW": "資料系列或類別的配色"
|
|
72
|
+
}
|
|
61
73
|
},
|
|
62
74
|
background: {
|
|
63
75
|
type: 'color',
|
|
64
|
-
'default': 'transparent'
|
|
76
|
+
'default': 'transparent',
|
|
77
|
+
desc: {
|
|
78
|
+
en: "chart background; unselected parts also fade toward this color",
|
|
79
|
+
"zh-TW": "圖表的背景色,未選取的部分也會往這個顏色淡化"
|
|
80
|
+
}
|
|
65
81
|
}
|
|
66
82
|
},
|
|
67
83
|
font: font,
|
|
68
84
|
tip: {
|
|
69
85
|
enabled: {
|
|
70
86
|
type: 'boolean',
|
|
71
|
-
'default': true
|
|
87
|
+
'default': true,
|
|
88
|
+
desc: {
|
|
89
|
+
en: "show a tooltip when hovering over data",
|
|
90
|
+
"zh-TW": "滑鼠移到資料上時顯示提示框"
|
|
91
|
+
}
|
|
72
92
|
},
|
|
73
93
|
format: {
|
|
74
94
|
type: 'format',
|
|
75
|
-
'default': '.3s'
|
|
95
|
+
'default': '.3s',
|
|
96
|
+
desc: {
|
|
97
|
+
en: "number format in the tooltip, e.g. .3s ( d3-format )",
|
|
98
|
+
"zh-TW": "提示框裡數值的格式,例如 .3s ( d3-format )"
|
|
99
|
+
}
|
|
76
100
|
}
|
|
77
101
|
},
|
|
78
102
|
label: {
|
|
79
103
|
format: {
|
|
80
104
|
type: 'format',
|
|
81
|
-
'default': '.3s'
|
|
105
|
+
'default': '.3s',
|
|
106
|
+
desc: {
|
|
107
|
+
en: "number format of data labels",
|
|
108
|
+
"zh-TW": "資料標籤的數值格式"
|
|
109
|
+
}
|
|
82
110
|
}
|
|
83
111
|
},
|
|
84
112
|
legend: {
|
|
85
113
|
mode: {
|
|
86
114
|
type: 'choice',
|
|
87
115
|
values: ['list', 'direct'],
|
|
88
|
-
'default': 'list'
|
|
116
|
+
'default': 'list',
|
|
117
|
+
desc: {
|
|
118
|
+
en: "list: a separate legend; direct: names placed next to the data ( falls back to list when the chart can't )",
|
|
119
|
+
"zh-TW": "list:獨立的圖例清單;direct:名稱直接標在資料旁 ( 圖表不支援時改用 list )"
|
|
120
|
+
}
|
|
89
121
|
},
|
|
90
122
|
selectable: {
|
|
91
123
|
type: 'boolean',
|
|
92
|
-
'default': true
|
|
124
|
+
'default': true,
|
|
125
|
+
desc: {
|
|
126
|
+
en: "click legend items to show or hide them",
|
|
127
|
+
"zh-TW": "可以點圖例項目來顯示或隱藏"
|
|
128
|
+
}
|
|
93
129
|
},
|
|
94
130
|
actions: {
|
|
95
131
|
type: 'boolean',
|
|
96
|
-
'default': true
|
|
132
|
+
'default': true,
|
|
133
|
+
desc: {
|
|
134
|
+
en: "show the select all / none buttons",
|
|
135
|
+
"zh-TW": "顯示「全選 / 全不選」按鈕"
|
|
136
|
+
}
|
|
97
137
|
},
|
|
98
138
|
enabled: {
|
|
99
139
|
type: 'boolean',
|
|
@@ -113,71 +153,119 @@
|
|
|
113
153
|
mode: {
|
|
114
154
|
type: 'choice',
|
|
115
155
|
values: ['label', 'value', 'none'],
|
|
116
|
-
'default': 'value'
|
|
156
|
+
'default': 'value',
|
|
157
|
+
desc: {
|
|
158
|
+
en: "sort items by label or value, or keep the data order ( none )",
|
|
159
|
+
"zh-TW": "圖例項目依名稱或數值排序,none 維持資料順序"
|
|
160
|
+
}
|
|
117
161
|
}
|
|
118
162
|
},
|
|
119
163
|
subset: {
|
|
120
164
|
mode: {
|
|
121
165
|
type: 'choice',
|
|
122
166
|
values: ['shrink', 'dim', 'partial'],
|
|
123
|
-
'default': 'shrink'
|
|
167
|
+
'default': 'shrink',
|
|
168
|
+
desc: {
|
|
169
|
+
en: "how hidden items look: shrink removes them, dim keeps their place and lowers opacity",
|
|
170
|
+
"zh-TW": "關掉的項目怎麼呈現:shrink 整個拿掉,dim 保留位置但變淡"
|
|
171
|
+
}
|
|
124
172
|
},
|
|
125
173
|
opacity: {
|
|
126
174
|
type: 'number',
|
|
127
175
|
'default': 0.2,
|
|
128
176
|
min: 0,
|
|
129
177
|
max: 1,
|
|
130
|
-
step: 0.05
|
|
178
|
+
step: 0.05,
|
|
179
|
+
desc: {
|
|
180
|
+
en: "opacity of hidden items in dim mode",
|
|
181
|
+
"zh-TW": "dim 模式下關掉的項目的透明度"
|
|
182
|
+
}
|
|
131
183
|
}
|
|
132
184
|
},
|
|
133
185
|
crossfilter: {
|
|
134
186
|
type: 'boolean',
|
|
135
|
-
'default': false
|
|
187
|
+
'default': false,
|
|
188
|
+
desc: {
|
|
189
|
+
en: "legend selection also filters other charts on a dashboard. for charts whose legend items are data values, like pie",
|
|
190
|
+
"zh-TW": "圖例的選取同時篩選儀表板上的其他圖;適用於圖例項目就是資料值的圖,例如圓餅圖"
|
|
191
|
+
}
|
|
136
192
|
}
|
|
137
193
|
},
|
|
138
194
|
bin: {
|
|
139
195
|
enabled: {
|
|
140
196
|
type: 'boolean',
|
|
141
|
-
'default': false
|
|
197
|
+
'default': false,
|
|
198
|
+
desc: {
|
|
199
|
+
en: "group raw values into ranges ( a histogram ); needs the value field bound",
|
|
200
|
+
"zh-TW": "把原始數值分組成區間 ( 直方圖 ),需要綁定 value 欄位"
|
|
201
|
+
}
|
|
142
202
|
},
|
|
143
203
|
width: {
|
|
144
204
|
type: 'number',
|
|
145
205
|
'default': 0,
|
|
146
206
|
min: 0,
|
|
147
207
|
max: 1000000,
|
|
148
|
-
step: 0.01
|
|
208
|
+
step: 0.01,
|
|
209
|
+
desc: {
|
|
210
|
+
en: "width of each range; 0 picks a round width automatically",
|
|
211
|
+
"zh-TW": "每組的寬度;0 表示自動挑一個整齊的組距"
|
|
212
|
+
}
|
|
149
213
|
},
|
|
150
214
|
count: {
|
|
151
215
|
type: 'number',
|
|
152
216
|
'default': 0,
|
|
153
217
|
min: 0,
|
|
154
218
|
max: 100,
|
|
155
|
-
step: 1
|
|
219
|
+
step: 1,
|
|
220
|
+
desc: {
|
|
221
|
+
en: "target number of groups when the width is automatic; 0 decides by the number of rows",
|
|
222
|
+
"zh-TW": "自動組距時希望分成幾組;0 表示依資料筆數決定"
|
|
223
|
+
}
|
|
156
224
|
},
|
|
157
225
|
anchor: {
|
|
158
226
|
type: 'number',
|
|
159
227
|
'default': 0,
|
|
160
228
|
min: -1000000,
|
|
161
229
|
max: 1000000,
|
|
162
|
-
step: 0.01
|
|
230
|
+
step: 0.01,
|
|
231
|
+
desc: {
|
|
232
|
+
en: "ranges are aligned so that boundaries fall on this value plus multiples of the width",
|
|
233
|
+
"zh-TW": "區間邊界對齊的位置:邊界一定落在這個值加上組距的整數倍"
|
|
234
|
+
}
|
|
163
235
|
},
|
|
164
236
|
closed: {
|
|
165
237
|
type: 'choice',
|
|
166
238
|
values: ['left', 'right'],
|
|
167
|
-
'default': 'left'
|
|
239
|
+
'default': 'left',
|
|
240
|
+
desc: {
|
|
241
|
+
en: "which range a value on a boundary belongs to",
|
|
242
|
+
"zh-TW": "剛好落在邊界上的值算進哪一側的區間"
|
|
243
|
+
}
|
|
168
244
|
},
|
|
169
245
|
label: {
|
|
170
246
|
type: 'choice',
|
|
171
247
|
values: ['range', 'start', 'center'],
|
|
172
|
-
'default': 'range'
|
|
248
|
+
'default': 'range',
|
|
249
|
+
desc: {
|
|
250
|
+
en: "label each group by its range, start or center",
|
|
251
|
+
"zh-TW": "每組的標籤:區間、起點或中點"
|
|
252
|
+
}
|
|
173
253
|
},
|
|
174
254
|
format: {
|
|
175
255
|
type: 'format',
|
|
176
|
-
'default': ''
|
|
256
|
+
'default': '',
|
|
257
|
+
desc: {
|
|
258
|
+
en: "number format of group labels; empty shows numbers as is",
|
|
259
|
+
"zh-TW": "分組標籤的數值格式;空白表示照原樣顯示"
|
|
260
|
+
}
|
|
177
261
|
},
|
|
178
262
|
empty: {
|
|
179
263
|
type: 'boolean',
|
|
180
|
-
'default': true
|
|
264
|
+
'default': true,
|
|
265
|
+
desc: {
|
|
266
|
+
en: "keep groups that have no data",
|
|
267
|
+
"zh-TW": "保留沒有資料的組"
|
|
268
|
+
}
|
|
181
269
|
}
|
|
182
270
|
},
|
|
183
271
|
axis: {
|
|
@@ -188,7 +276,11 @@
|
|
|
188
276
|
grid: {
|
|
189
277
|
show: {
|
|
190
278
|
type: 'boolean',
|
|
191
|
-
'default': false
|
|
279
|
+
'default': false,
|
|
280
|
+
desc: {
|
|
281
|
+
en: "draw a grid line at each tick across the plot area",
|
|
282
|
+
"zh-TW": "在每個刻度畫一條橫跨繪圖區的格線"
|
|
283
|
+
}
|
|
192
284
|
},
|
|
193
285
|
color: {
|
|
194
286
|
type: 'color',
|
|
@@ -210,12 +302,20 @@
|
|
|
210
302
|
},
|
|
211
303
|
dash: {
|
|
212
304
|
type: 'text',
|
|
213
|
-
'default': ''
|
|
305
|
+
'default': '',
|
|
306
|
+
desc: {
|
|
307
|
+
en: "dash pattern, e.g. 4 2; empty for a solid line",
|
|
308
|
+
"zh-TW": "虛線樣式,例如 4 2;空白為實線"
|
|
309
|
+
}
|
|
214
310
|
}
|
|
215
311
|
},
|
|
216
312
|
center: {
|
|
217
313
|
type: 'boolean',
|
|
218
|
-
'default': false
|
|
314
|
+
'default': false,
|
|
315
|
+
desc: {
|
|
316
|
+
en: "place the axis through the middle of the plot area ( only in charts that support it, e.g. scatter )",
|
|
317
|
+
"zh-TW": "把軸放在繪圖區中間 ( 支援的圖才有作用,例如散佈圖 )"
|
|
318
|
+
}
|
|
219
319
|
},
|
|
220
320
|
tick: {
|
|
221
321
|
inner: {
|
|
@@ -224,7 +324,11 @@
|
|
|
224
324
|
'default': 8,
|
|
225
325
|
min: 0,
|
|
226
326
|
max: 40,
|
|
227
|
-
step: 0.1
|
|
327
|
+
step: 0.1,
|
|
328
|
+
desc: {
|
|
329
|
+
en: "length of the tick marks, in px",
|
|
330
|
+
"zh-TW": "刻度線的長度 ( px )"
|
|
331
|
+
}
|
|
228
332
|
},
|
|
229
333
|
color: {
|
|
230
334
|
type: 'color',
|
|
@@ -234,17 +338,29 @@
|
|
|
234
338
|
type: 'number',
|
|
235
339
|
'default': 4,
|
|
236
340
|
min: 1,
|
|
237
|
-
max: 40
|
|
341
|
+
max: 40,
|
|
342
|
+
desc: {
|
|
343
|
+
en: "approximate number of ticks on a numeric axis",
|
|
344
|
+
"zh-TW": "數值軸上大約要有幾個刻度"
|
|
345
|
+
}
|
|
238
346
|
},
|
|
239
347
|
boundaryOffset: {
|
|
240
348
|
type: 'boolean',
|
|
241
|
-
'default': true
|
|
349
|
+
'default': true,
|
|
350
|
+
desc: {
|
|
351
|
+
en: "align the first and last labels inward so they don't stick out past the ends of the axis",
|
|
352
|
+
"zh-TW": "頭尾兩個標籤往內對齊,不凸出軸的兩端"
|
|
353
|
+
}
|
|
242
354
|
}
|
|
243
355
|
},
|
|
244
356
|
baseline: {
|
|
245
357
|
show: {
|
|
246
358
|
type: 'boolean',
|
|
247
|
-
'default': true
|
|
359
|
+
'default': true,
|
|
360
|
+
desc: {
|
|
361
|
+
en: "draw the axis line",
|
|
362
|
+
"zh-TW": "畫出軸線"
|
|
363
|
+
}
|
|
248
364
|
},
|
|
249
365
|
color: {
|
|
250
366
|
type: 'color',
|
|
@@ -258,45 +374,73 @@
|
|
|
258
374
|
},
|
|
259
375
|
format: {
|
|
260
376
|
type: 'format',
|
|
261
|
-
'default': '.3s'
|
|
377
|
+
'default': '.3s',
|
|
378
|
+
desc: {
|
|
379
|
+
en: "number format of the tick labels",
|
|
380
|
+
"zh-TW": "刻度標籤的數值格式"
|
|
381
|
+
}
|
|
262
382
|
},
|
|
263
383
|
direction: {
|
|
264
384
|
type: 'choice',
|
|
265
385
|
'default': 'horizontal',
|
|
266
|
-
values: ['horizontal', 'angled', 'vertical', 'auto']
|
|
386
|
+
values: ['horizontal', 'angled', 'vertical', 'auto'],
|
|
387
|
+
desc: {
|
|
388
|
+
en: "label orientation; auto tries horizontal, angled, then vertical, and hides some labels only if none fits",
|
|
389
|
+
"zh-TW": "標籤方向;auto 依序試水平、傾斜、垂直,都放不下才隱藏部分標籤"
|
|
390
|
+
}
|
|
267
391
|
},
|
|
268
392
|
angle: {
|
|
269
393
|
type: 'number',
|
|
270
394
|
'default': 45,
|
|
271
395
|
min: 0,
|
|
272
396
|
max: 90,
|
|
273
|
-
step: 1
|
|
397
|
+
step: 1,
|
|
398
|
+
desc: {
|
|
399
|
+
en: "angle of angled labels, in degrees",
|
|
400
|
+
"zh-TW": "傾斜標籤的角度 ( 度 )"
|
|
401
|
+
}
|
|
274
402
|
},
|
|
275
403
|
gap: {
|
|
276
404
|
type: 'number',
|
|
277
405
|
'default': 1.5,
|
|
278
406
|
min: 0,
|
|
279
407
|
max: 10,
|
|
280
|
-
step: 0.1
|
|
408
|
+
step: 0.1,
|
|
409
|
+
desc: {
|
|
410
|
+
en: "minimum space between labels, in em; when they don't fit, only every nth label is shown",
|
|
411
|
+
"zh-TW": "相鄰標籤至少要隔多遠 ( em );太擠時每隔幾個才顯示一個"
|
|
412
|
+
}
|
|
281
413
|
},
|
|
282
414
|
strategy: {
|
|
283
415
|
type: 'choice',
|
|
284
416
|
'default': 'stride',
|
|
285
|
-
values: ['stride', 'ends']
|
|
417
|
+
values: ['stride', 'ends'],
|
|
418
|
+
desc: {
|
|
419
|
+
en: "which labels to keep when they don't fit: stride keeps every nth from the first, ends always keeps the first and last",
|
|
420
|
+
"zh-TW": "放不下時保留哪些標籤:stride 從第一個起每隔幾個留一個,ends 一定保留頭尾"
|
|
421
|
+
}
|
|
286
422
|
},
|
|
287
423
|
tolerance: {
|
|
288
424
|
type: 'number',
|
|
289
425
|
'default': 0.2,
|
|
290
426
|
min: 0,
|
|
291
427
|
max: 1,
|
|
292
|
-
step: 0.05
|
|
428
|
+
step: 0.05,
|
|
429
|
+
desc: {
|
|
430
|
+
en: "with ends, how uneven the spacing may be ( 0.2 = ±20% ); 0 accepts only equal spacing",
|
|
431
|
+
"zh-TW": "ends 模式下間距可以不平均到什麼程度 ( 0.2 = ±20% );0 表示只接受完全平均"
|
|
432
|
+
}
|
|
293
433
|
},
|
|
294
434
|
padding: {
|
|
295
435
|
type: 'number',
|
|
296
436
|
'default': 1,
|
|
297
437
|
min: 0,
|
|
298
438
|
max: 100,
|
|
299
|
-
step: 0.5
|
|
439
|
+
step: 0.5,
|
|
440
|
+
desc: {
|
|
441
|
+
en: "space between the tick marks and the labels",
|
|
442
|
+
"zh-TW": "刻度與標籤之間的距離"
|
|
443
|
+
}
|
|
300
444
|
},
|
|
301
445
|
font: font
|
|
302
446
|
},
|
|
@@ -307,7 +451,11 @@
|
|
|
307
451
|
},
|
|
308
452
|
text: {
|
|
309
453
|
type: 'text',
|
|
310
|
-
'default': ''
|
|
454
|
+
'default': '',
|
|
455
|
+
desc: {
|
|
456
|
+
en: "axis title",
|
|
457
|
+
"zh-TW": "軸的標題文字"
|
|
458
|
+
}
|
|
311
459
|
},
|
|
312
460
|
show: {
|
|
313
461
|
type: 'boolean',
|
|
@@ -318,11 +466,19 @@
|
|
|
318
466
|
'default': 1,
|
|
319
467
|
min: 0,
|
|
320
468
|
max: 100,
|
|
321
|
-
step: 0.5
|
|
469
|
+
step: 0.5,
|
|
470
|
+
desc: {
|
|
471
|
+
en: "space between the labels and the axis title",
|
|
472
|
+
"zh-TW": "刻度標籤與軸標題之間的距離"
|
|
473
|
+
}
|
|
322
474
|
},
|
|
323
475
|
position: {
|
|
324
476
|
type: 'choice',
|
|
325
477
|
'default': 4,
|
|
478
|
+
desc: {
|
|
479
|
+
en: "where the axis title sits: inside or outside the axis, at its start, middle or end",
|
|
480
|
+
"zh-TW": "軸標題的位置:軸內或軸外,對齊開頭、中間或結尾"
|
|
481
|
+
},
|
|
326
482
|
values: [
|
|
327
483
|
{
|
|
328
484
|
name: 'in / start',
|
|
@@ -354,7 +510,11 @@
|
|
|
354
510
|
},
|
|
355
511
|
text: {
|
|
356
512
|
type: 'text',
|
|
357
|
-
'default': ''
|
|
513
|
+
'default': '',
|
|
514
|
+
desc: {
|
|
515
|
+
en: "a note at the start of the axis, e.g. a unit",
|
|
516
|
+
"zh-TW": "寫在軸開頭的附註,例如單位"
|
|
517
|
+
}
|
|
358
518
|
},
|
|
359
519
|
position: {
|
|
360
520
|
type: 'choice',
|
|
@@ -367,7 +527,11 @@
|
|
|
367
527
|
name: 'out',
|
|
368
528
|
value: 1
|
|
369
529
|
}
|
|
370
|
-
]
|
|
530
|
+
],
|
|
531
|
+
desc: {
|
|
532
|
+
en: "put the note inside or outside the axis",
|
|
533
|
+
"zh-TW": "附註放在軸的內側或外側"
|
|
534
|
+
}
|
|
371
535
|
},
|
|
372
536
|
font: font,
|
|
373
537
|
color: {
|
|
@@ -379,7 +543,11 @@
|
|
|
379
543
|
'default': 1,
|
|
380
544
|
min: 0,
|
|
381
545
|
max: 100,
|
|
382
|
-
step: 0.5
|
|
546
|
+
step: 0.5,
|
|
547
|
+
desc: {
|
|
548
|
+
en: "distance between the note and the axis",
|
|
549
|
+
"zh-TW": "附註與軸的距離"
|
|
550
|
+
}
|
|
383
551
|
}
|
|
384
552
|
},
|
|
385
553
|
sideNoteEnd: {
|
|
@@ -389,7 +557,11 @@
|
|
|
389
557
|
},
|
|
390
558
|
text: {
|
|
391
559
|
type: 'text',
|
|
392
|
-
'default': ''
|
|
560
|
+
'default': '',
|
|
561
|
+
desc: {
|
|
562
|
+
en: "a note at the end of the axis, e.g. a unit",
|
|
563
|
+
"zh-TW": "寫在軸結尾的附註,例如單位"
|
|
564
|
+
}
|
|
393
565
|
},
|
|
394
566
|
position: {
|
|
395
567
|
type: 'choice',
|
|
@@ -402,7 +574,11 @@
|
|
|
402
574
|
name: 'out',
|
|
403
575
|
value: 1
|
|
404
576
|
}
|
|
405
|
-
]
|
|
577
|
+
],
|
|
578
|
+
desc: {
|
|
579
|
+
en: "put the note inside or outside the axis",
|
|
580
|
+
"zh-TW": "附註放在軸的內側或外側"
|
|
581
|
+
}
|
|
406
582
|
},
|
|
407
583
|
font: font,
|
|
408
584
|
color: {
|
|
@@ -414,7 +590,11 @@
|
|
|
414
590
|
'default': 1,
|
|
415
591
|
min: 0,
|
|
416
592
|
max: 100,
|
|
417
|
-
step: 0.5
|
|
593
|
+
step: 0.5,
|
|
594
|
+
desc: {
|
|
595
|
+
en: "distance between the note and the axis",
|
|
596
|
+
"zh-TW": "附註與軸的距離"
|
|
597
|
+
}
|
|
418
598
|
}
|
|
419
599
|
}
|
|
420
600
|
}
|
package/utils/config.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var e;e={from:function(e){var
|
|
1
|
+
!function(){var e;e={from:function(e){var i=this,r=function(e,t){var a,n;if(t.preset){var o,s=e,l=JSON.parse(JSON.stringify(i.preset[t.preset])),d={}.hasOwnProperty;for(o in l)d.call(l,o)&&(s[o]=l[o])}for(a in t)n=t[a],"preset"!==a&&("string"==typeof n?e[a]=JSON.parse(JSON.stringify(i.preset[n]))||{}:r(e[a]||(e[a]={}),n));return e};return r({},e)},preset:{default:{margin:{type:"number",desc:{en:"space around the chart, in px","zh-TW":"圖表四周的留白 ( px )"}},font:e={family:{type:"font"},size:{type:"quantity",default:"1em",units:[{name:"em",max:10,step:.01,default:1},{name:"px",max:256,step:1,default:16}]}},color:{type:"color",default:"currentColor",desc:{en:"default color of text and lines","zh-TW":"文字與線條的預設顏色"}},palette:{type:"palette",desc:{en:"colors for the data series or categories","zh-TW":"資料系列或類別的配色"}},background:{type:"color",default:"transparent",desc:{en:"chart background; unselected parts also fade toward this color","zh-TW":"圖表的背景色,未選取的部分也會往這個顏色淡化"}}},font:e,tip:{enabled:{type:"boolean",default:!0,desc:{en:"show a tooltip when hovering over data","zh-TW":"滑鼠移到資料上時顯示提示框"}},format:{type:"format",default:".3s",desc:{en:"number format in the tooltip, e.g. .3s ( d3-format )","zh-TW":"提示框裡數值的格式,例如 .3s ( d3-format )"}}},label:{format:{type:"format",default:".3s",desc:{en:"number format of data labels","zh-TW":"資料標籤的數值格式"}}},legend:{mode:{type:"choice",values:["list","direct"],default:"list",desc:{en:"list: a separate legend; direct: names placed next to the data ( falls back to list when the chart can't )","zh-TW":"list:獨立的圖例清單;direct:名稱直接標在資料旁 ( 圖表不支援時改用 list )"}},selectable:{type:"boolean",default:!0,desc:{en:"click legend items to show or hide them","zh-TW":"可以點圖例項目來顯示或隱藏"}},actions:{type:"boolean",default:!0,desc:{en:"show the select all / none buttons","zh-TW":"顯示「全選 / 全不選」按鈕"}},enabled:{type:"boolean",default:!0},position:{type:"choice",values:["bottom","right"],default:"right"},sort:{direction:{type:"choice",values:["asc","desc"],default:"desc"},mode:{type:"choice",values:["label","value","none"],default:"value",desc:{en:"sort items by label or value, or keep the data order ( none )","zh-TW":"圖例項目依名稱或數值排序,none 維持資料順序"}}},subset:{mode:{type:"choice",values:["shrink","dim","partial"],default:"shrink",desc:{en:"how hidden items look: shrink removes them, dim keeps their place and lowers opacity","zh-TW":"關掉的項目怎麼呈現:shrink 整個拿掉,dim 保留位置但變淡"}},opacity:{type:"number",default:.2,min:0,max:1,step:.05,desc:{en:"opacity of hidden items in dim mode","zh-TW":"dim 模式下關掉的項目的透明度"}}},crossfilter:{type:"boolean",default:!1,desc:{en:"legend selection also filters other charts on a dashboard. for charts whose legend items are data values, like pie","zh-TW":"圖例的選取同時篩選儀表板上的其他圖;適用於圖例項目就是資料值的圖,例如圓餅圖"}}},bin:{enabled:{type:"boolean",default:!1,desc:{en:"group raw values into ranges ( a histogram ); needs the value field bound","zh-TW":"把原始數值分組成區間 ( 直方圖 ),需要綁定 value 欄位"}},width:{type:"number",default:0,min:0,max:1e6,step:.01,desc:{en:"width of each range; 0 picks a round width automatically","zh-TW":"每組的寬度;0 表示自動挑一個整齊的組距"}},count:{type:"number",default:0,min:0,max:100,step:1,desc:{en:"target number of groups when the width is automatic; 0 decides by the number of rows","zh-TW":"自動組距時希望分成幾組;0 表示依資料筆數決定"}},anchor:{type:"number",default:0,min:-1e6,max:1e6,step:.01,desc:{en:"ranges are aligned so that boundaries fall on this value plus multiples of the width","zh-TW":"區間邊界對齊的位置:邊界一定落在這個值加上組距的整數倍"}},closed:{type:"choice",values:["left","right"],default:"left",desc:{en:"which range a value on a boundary belongs to","zh-TW":"剛好落在邊界上的值算進哪一側的區間"}},label:{type:"choice",values:["range","start","center"],default:"range",desc:{en:"label each group by its range, start or center","zh-TW":"每組的標籤:區間、起點或中點"}},format:{type:"format",default:"",desc:{en:"number format of group labels; empty shows numbers as is","zh-TW":"分組標籤的數值格式;空白表示照原樣顯示"}},empty:{type:"boolean",default:!0,desc:{en:"keep groups that have no data","zh-TW":"保留沒有資料的組"}}},axis:{enabled:{type:"boolean",default:!0},grid:{show:{type:"boolean",default:!1,desc:{en:"draw a grid line at each tick across the plot area","zh-TW":"在每個刻度畫一條橫跨繪圖區的格線"}},color:{type:"color",default:"currentColor"},opacity:{type:"number",default:.12,min:0,max:1,step:.01},width:{type:"number",default:1,min:0,max:10,step:.5},dash:{type:"text",default:"",desc:{en:"dash pattern, e.g. 4 2; empty for a solid line","zh-TW":"虛線樣式,例如 4 2;空白為實線"}}},center:{type:"boolean",default:!1,desc:{en:"place the axis through the middle of the plot area ( only in charts that support it, e.g. scatter )","zh-TW":"把軸放在繪圖區中間 ( 支援的圖才有作用,例如散佈圖 )"}},tick:{inner:{type:"number",name:"Inner Tick Size",default:8,min:0,max:40,step:.1,desc:{en:"length of the tick marks, in px","zh-TW":"刻度線的長度 ( px )"}},color:{type:"color",default:"currentColor"},count:{type:"number",default:4,min:1,max:40,desc:{en:"approximate number of ticks on a numeric axis","zh-TW":"數值軸上大約要有幾個刻度"}},boundaryOffset:{type:"boolean",default:!0,desc:{en:"align the first and last labels inward so they don't stick out past the ends of the axis","zh-TW":"頭尾兩個標籤往內對齊,不凸出軸的兩端"}}},baseline:{show:{type:"boolean",default:!0,desc:{en:"draw the axis line","zh-TW":"畫出軸線"}},color:{type:"color",default:"currentColor"}},label:{color:{type:"color",default:"currentColor"},format:{type:"format",default:".3s",desc:{en:"number format of the tick labels","zh-TW":"刻度標籤的數值格式"}},direction:{type:"choice",default:"horizontal",values:["horizontal","angled","vertical","auto"],desc:{en:"label orientation; auto tries horizontal, angled, then vertical, and hides some labels only if none fits","zh-TW":"標籤方向;auto 依序試水平、傾斜、垂直,都放不下才隱藏部分標籤"}},angle:{type:"number",default:45,min:0,max:90,step:1,desc:{en:"angle of angled labels, in degrees","zh-TW":"傾斜標籤的角度 ( 度 )"}},gap:{type:"number",default:1.5,min:0,max:10,step:.1,desc:{en:"minimum space between labels, in em; when they don't fit, only every nth label is shown","zh-TW":"相鄰標籤至少要隔多遠 ( em );太擠時每隔幾個才顯示一個"}},strategy:{type:"choice",default:"stride",values:["stride","ends"],desc:{en:"which labels to keep when they don't fit: stride keeps every nth from the first, ends always keeps the first and last","zh-TW":"放不下時保留哪些標籤:stride 從第一個起每隔幾個留一個,ends 一定保留頭尾"}},tolerance:{type:"number",default:.2,min:0,max:1,step:.05,desc:{en:"with ends, how uneven the spacing may be ( 0.2 = ±20% ); 0 accepts only equal spacing","zh-TW":"ends 模式下間距可以不平均到什麼程度 ( 0.2 = ±20% );0 表示只接受完全平均"}},padding:{type:"number",default:1,min:0,max:100,step:.5,desc:{en:"space between the tick marks and the labels","zh-TW":"刻度與標籤之間的距離"}},font:e},caption:{color:{type:"color",default:"currentColor"},text:{type:"text",default:"",desc:{en:"axis title","zh-TW":"軸的標題文字"}},show:{type:"boolean",default:!0},padding:{type:"number",default:1,min:0,max:100,step:.5,desc:{en:"space between the labels and the axis title","zh-TW":"刻度標籤與軸標題之間的距離"}},position:{type:"choice",default:4,desc:{en:"where the axis title sits: inside or outside the axis, at its start, middle or end","zh-TW":"軸標題的位置:軸內或軸外,對齊開頭、中間或結尾"},values:[{name:"in / start",value:0},{name:"in / middle",value:1},{name:"in / end",value:2},{name:"out / start",value:3},{name:"out / middle",value:4},{name:"out / end",value:5}]},font:e},sideNoteStart:{show:{type:"boolean",default:!1},text:{type:"text",default:"",desc:{en:"a note at the start of the axis, e.g. a unit","zh-TW":"寫在軸開頭的附註,例如單位"}},position:{type:"choice",default:0,values:[{name:"in",value:0},{name:"out",value:1}],desc:{en:"put the note inside or outside the axis","zh-TW":"附註放在軸的內側或外側"}},font:e,color:{type:"color",default:"currentColor"},padding:{type:"number",default:1,min:0,max:100,step:.5,desc:{en:"distance between the note and the axis","zh-TW":"附註與軸的距離"}}},sideNoteEnd:{show:{type:"boolean",default:!1},text:{type:"text",default:"",desc:{en:"a note at the end of the axis, e.g. a unit","zh-TW":"寫在軸結尾的附註,例如單位"}},position:{type:"choice",default:0,values:[{name:"in",value:0},{name:"out",value:1}],desc:{en:"put the note inside or outside the axis","zh-TW":"附註放在軸的內側或外側"}},font:e,color:{type:"color",default:"currentColor"},padding:{type:"number",default:1,min:0,max:100,step:.5,desc:{en:"distance between the note and the axis","zh-TW":"附註與軸的距離"}}}}}},"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).config=e)}.call(this);
|