open-grid 1.3.0 → 1.4.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.
@@ -1,26 +1,132 @@
1
1
  import { CellRange } from '../types.js';
2
2
  /**
3
- * Phase1 MVP = 'bar'|'line'. 나머지는 Phase2/3 예약(타입만 선언, 미구현).
3
+ * 그리드 데이터를 어떤 모양의 차트로 그릴지 고르는 값.
4
4
  *
5
- * ⚠️ 'bar-stacked': 공개 타입으로 노출되어 있으나 내장(builtin-canvas) 렌더러는 현재 스택
6
- * 누적을 구현하지 않는다 — 지정해도 'bar-grouped'와 동일하게 그룹형(side-by-side)으로
7
- * 폴백 렌더된다(CanvasAdapter._computeGeometry). 하위호환을 위해 타입 자체는 유지한다.
5
+ * Picks which shape of chart to draw the grid data as.
6
+ *
7
+ * グリッドのデータをどの形のチャートで描くかを選ぶ値。
8
+ *
9
+ * 用于选择把表格数据绘制成哪种形态的图表。
10
+ *
11
+ * 현재(Phase1 MVP) 실제로 렌더되는 값은 'bar'|'line' 뿐이다. 나머지는 Phase2/3 를 위해 타입만
12
+ * 미리 선언해 둔 예약값이며 아직 구현되지 않았다.
13
+ *
14
+ * Right now (Phase1 MVP) only 'bar' and 'line' actually render. The rest are reserved values —
15
+ * the type exists for Phase2/3 but nothing implements them yet.
16
+ *
17
+ * 現在(Phase1 MVP)実際にレンダリングされる値は 'bar'|'line' だけです。残りは Phase2/3 のために
18
+ * 型だけをあらかじめ宣言しておいた予約値であり、まだ実装されていません。
19
+ *
20
+ * 目前(Phase1 MVP)真正渲染的值只有 'bar'|'line'。其余是为 Phase2/3 预先声明类型的保留值,
21
+ * 尚未实现。
22
+ *
23
+ * ⚠️ 'bar-stacked': 공개 타입으로는 노출돼 있지만, 내장(builtin-canvas) 렌더러는 아직 누적
24
+ * 스택을 그리지 못한다 — 지정해도 'bar-grouped'와 똑같이 그룹형(막대를 나란히)으로 대신
25
+ * 그려진다. 하위 호환을 위해(이미 이 값을 쓰는 코드가 깨지지 않도록) 타입 자체는 남겨 둔다.
26
+ *
27
+ * ⚠️ 'bar-stacked': exposed as a public type, but the built-in canvas renderer can't draw a
28
+ * stacked bar yet — specifying it falls back to the same grouped (side-by-side) rendering as
29
+ * 'bar-grouped'. The type itself is kept for backward compatibility, so existing code using this
30
+ * value doesn't break.
31
+ *
32
+ * ⚠️ 'bar-stacked': 公開型としては露出していますが、内蔵(builtin-canvas)レンダラーはまだ積み上げ
33
+ * スタックを描けません — 指定しても 'bar-grouped' と同じくグループ型(棒を横に並べる)で代わりに
34
+ * 描かれます。下位互換のため(すでにこの値を使っているコードが壊れないように)型自体は残して
35
+ * あります。
36
+ *
37
+ * ⚠️ 'bar-stacked':虽然作为公开类型对外暴露,但内置(builtin-canvas)渲染器还画不出堆叠 —
38
+ * 即使指定它,也会像 'bar-grouped' 一样以分组形态(柱子并排)代为绘制。为了向后兼容
39
+ * (不让已经使用该值的代码出错),类型本身予以保留。
8
40
  */
9
41
  export type ChartType = 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'bar-stacked' | 'bar-grouped';
10
- /** 시리즈(컬럼) 명세. / Series (column) spec. */
42
+ /**
43
+ * 시리즈(컬럼) 명세.
44
+ *
45
+ * Series (column) spec.
46
+ *
47
+ * シリーズ(列)の仕様。
48
+ *
49
+ * 系列(列)的规格。
50
+ */
11
51
  export interface ChartSeriesSpec {
12
- /** 값 컬럼 field 명. / Value column field name. */
52
+ /**
53
+ * 값 컬럼 field 명.
54
+ *
55
+ * Value column field name.
56
+ *
57
+ * 値の列の field 名。
58
+ *
59
+ * 值列的 field 名。
60
+ */
13
61
  field: string;
14
- /** 범례 라벨(기본 = 컬럼 header/field). / Legend label (default = column header/field). */
62
+ /**
63
+ * 범례 라벨(기본 = 컬럼 header/field).
64
+ *
65
+ * Legend label (default = column header/field).
66
+ *
67
+ * 凡例のラベル(既定 = 列の header/field)。
68
+ *
69
+ * 图例标签(默认 = 列的 header/field)。
70
+ */
15
71
  name?: string;
16
- /** 시리즈 색. / Series color. */
72
+ /**
73
+ * 시리즈 색.
74
+ *
75
+ * Series color.
76
+ *
77
+ * シリーズの色。
78
+ *
79
+ * 系列的颜色。
80
+ */
17
81
  color?: string;
18
- /** 색 외 구분 패턴. / Non-color distinction pattern. */
82
+ /**
83
+ * 색 외 구분 패턴.
84
+ *
85
+ * Non-color distinction pattern.
86
+ *
87
+ * 色以外の区別パターン。
88
+ *
89
+ * 颜色之外的区分图案。
90
+ */
19
91
  pattern?: ChartSeries['pattern'];
20
- /** 시리즈별 렌더 타입(혼합 차트). / Per-series render type (mixed charts). */
92
+ /**
93
+ * 시리즈별 렌더 타입(혼합 차트).
94
+ *
95
+ * Per-series render type (mixed charts).
96
+ *
97
+ * シリーズごとのレンダータイプ(混合チャート)。
98
+ *
99
+ * 每个系列的渲染类型(混合图表)。
100
+ */
21
101
  type?: 'bar' | 'line' | 'area';
22
102
  }
23
- /** 차트 데이터 소스(범위/선택/체크/전체/컬럼 지정). / Chart data source (range/selection/checked/all/explicit columns). */
103
+ /**
104
+ * 차트 파이프라인의 첫 단계 — "그리드의 어느 데이터를 그릴 것인가"를 고른다.
105
+ *
106
+ * The first stage of the chart pipeline — picks which grid data to draw.
107
+ *
108
+ * チャートパイプラインの最初の段階 — 「グリッドのどのデータを描くか」を選びます。
109
+ *
110
+ * 图表流水线的第一个阶段 — 选择「绘制表格的哪些数据」。
111
+ *
112
+ * `'range'`(지정 범위)·`'selection'`(현재 드래그 선택)·`'checked'`(체크된 행)·`'all'`(전체
113
+ * 데이터) 는 "사용자가 화면에서 고른 것을 그대로 차트로" 만들 때 쓰고, `'columns'` 는 화면 선택과
114
+ * 무관하게 카테고리/시리즈 컬럼을 코드로 직접 지정하고 싶을 때 쓴다.
115
+ *
116
+ * `'range'` (a given cell range), `'selection'` (the current drag selection), `'checked'`
117
+ * (checked rows), and `'all'` (the whole dataset) turn whatever the user picked on screen
118
+ * straight into a chart. `'columns'` is for when you want to specify the category/series columns
119
+ * in code, independent of any on-screen selection.
120
+ *
121
+ * `'range'`(指定した範囲)・`'selection'`(現在のドラッグ選択)・`'checked'`(チェックされた行)・
122
+ * `'all'`(全データ)は「ユーザーが画面で選んだものをそのままチャートに」するときに使い、
123
+ * `'columns'` は画面の選択とは無関係にカテゴリー/シリーズの列をコードで直接指定したいときに
124
+ * 使います。
125
+ *
126
+ * `'range'`(指定范围)、`'selection'`(当前拖拽选择)、`'checked'`(勾选的行)、`'all'`
127
+ * (全部数据)用于把「用户在界面上选中的内容」原样做成图表;`'columns'` 用于不依赖界面选择、
128
+ * 在代码中直接指定类别/系列列的场景。
129
+ */
24
130
  export type ChartSource = {
25
131
  kind: 'range';
26
132
  range?: CellRange;
@@ -35,92 +141,423 @@ export type ChartSource = {
35
141
  category?: string;
36
142
  series: Array<string | ChartSeriesSpec>;
37
143
  };
38
- /** 카테고리 집계 연산. / Category aggregation operation. */
144
+ /**
145
+ * 카테고리 집계 연산.
146
+ *
147
+ * Category aggregation operation.
148
+ *
149
+ * カテゴリーの集計演算。
150
+ *
151
+ * 类别的聚合运算。
152
+ */
39
153
  export type ChartAggregateOp = 'sum' | 'avg' | 'count' | 'min' | 'max';
40
- /** 집계 연산 또는 커스텀 리듀서. / An aggregation op or a custom reducer. */
154
+ /**
155
+ * 집계 연산 또는 커스텀 리듀서.
156
+ *
157
+ * An aggregation op or a custom reducer.
158
+ *
159
+ * 集計演算、またはカスタムリデューサー。
160
+ *
161
+ * 聚合运算,或自定义归约器。
162
+ */
41
163
  export type ChartAggregate = ChartAggregateOp | ((values: number[], category: string) => number);
42
- /** 접근성(SR) 테이블 모델 — 스크린리더 폴백. / Accessibility (SR) table model — screen-reader fallback. */
164
+ /**
165
+ * 접근성(SR) 테이블 모델 — 스크린리더 폴백.
166
+ *
167
+ * Accessibility (SR) table model — screen-reader fallback.
168
+ *
169
+ * アクセシビリティ(SR)のテーブルモデル — スクリーンリーダー向けフォールバック。
170
+ *
171
+ * 无障碍(SR)表格模型 — 面向屏幕阅读器的回退。
172
+ */
43
173
  export interface A11yTableModel {
44
- /** aria-label 요약 캡션. / aria-label summary caption. */
174
+ /**
175
+ * aria-label 요약 캡션.
176
+ *
177
+ * aria-label summary caption.
178
+ *
179
+ * aria-label の要約キャプション。
180
+ *
181
+ * aria-label 的摘要标题。
182
+ */
45
183
  caption: string;
46
184
  /** ['category', ...series names] */
47
185
  colHeaders: string[];
48
- /** [category, v1, v2, ...] — locale 포맷 문자열. / [category, v1, v2, ...] — locale-formatted strings. */
186
+ /**
187
+ * [category, v1, v2, ...] — locale 포맷 문자열.
188
+ *
189
+ * [category, v1, v2, ...] — locale-formatted strings.
190
+ *
191
+ * [category, v1, v2, ...] — locale 書式の文字列。
192
+ *
193
+ * [category, v1, v2, ...] — 按 locale 格式化的字符串。
194
+ */
49
195
  rows: string[][];
50
196
  }
51
- /** 차트 시리즈(정규화된 값 배열). / Chart series (normalized value array). */
197
+ /**
198
+ * 차트 시리즈(정규화된 값 배열).
199
+ *
200
+ * Chart series (normalized value array).
201
+ *
202
+ * チャートのシリーズ(正規化された値の配列)。
203
+ *
204
+ * 图表系列(规范化后的值数组)。
205
+ */
52
206
  export interface ChartSeries {
53
- /** 범례 라벨(기본값 = 원본 컬럼 header/field). / Legend label (default = source column header/field). */
207
+ /**
208
+ * 범례 라벨(기본값 = 원본 컬럼 header/field).
209
+ *
210
+ * Legend label (default = source column header/field).
211
+ *
212
+ * 凡例のラベル(既定値 = 元の列の header/field)。
213
+ *
214
+ * 图例标签(默认值 = 源列的 header/field)。
215
+ */
54
216
  name: string;
55
- /** categories 와 동일 순서로 정렬. 결측=null. / Aligned to categories order; missing = null. */
217
+ /**
218
+ * categories 와 동일 순서로 정렬. 결측=null.
219
+ *
220
+ * Aligned to categories order; missing = null.
221
+ *
222
+ * categories と同じ順序に整列。欠測 = null。
223
+ *
224
+ * 与 categories 的顺序对齐;缺失 = null。
225
+ */
56
226
  data: Array<number | null>;
57
- /** 시리즈 색. / Series color. */
227
+ /**
228
+ * 시리즈 색.
229
+ *
230
+ * Series color.
231
+ *
232
+ * シリーズの色。
233
+ *
234
+ * 系列的颜色。
235
+ */
58
236
  color?: string;
59
- /** 색 외 구분(HANMS-19). / Non-color distinction (HANMS-19). */
237
+ /**
238
+ * 색만으로 시리즈를 구분하기 어려운 사용자(색약 등)를 위해, 색과 함께(또는 색 대신) 채움
239
+ * 무늬로도 시리즈를 구분한다. 'solid'=무늬 없음(기본), 'hatch'=사선, 'dot'=점, 'cross'=십자.
240
+ *
241
+ * A fill pattern that distinguishes series alongside color — or in place of it — for viewers
242
+ * who can't rely on color alone (color-vision deficiency, etc.). 'solid' = no pattern
243
+ * (default), 'hatch' = diagonal lines, 'dot' = dots, 'cross' = crosshatch.
244
+ *
245
+ * 色だけではシリーズを区別しにくいユーザー(色覚特性など)のために、色とともに(または色の
246
+ * 代わりに)塗りの模様でもシリーズを区別します。'solid'=模様なし(既定)、'hatch'=斜線、
247
+ * 'dot'=点、'cross'=十字。
248
+ *
249
+ * 为仅凭颜色难以区分系列的用户(色觉障碍等),在颜色之外(或代替颜色)再用填充图案来区分
250
+ * 系列。'solid' = 无图案(默认),'hatch' = 斜线,'dot' = 点,'cross' = 十字。
251
+ */
60
252
  pattern?: 'solid' | 'hatch' | 'dot' | 'cross';
61
253
  }
62
- /** 차트 데이터 모델 메타(출처·샘플링·집계 배지 정보). / Chart data model meta (source, sampling, aggregation badge info). */
254
+ /**
255
+ * 차트 데이터 모델 메타(출처·샘플링·집계 배지 정보).
256
+ *
257
+ * Chart data model meta (source, sampling, aggregation badge info).
258
+ *
259
+ * チャートデータモデルのメタ(出所・サンプリング・集計バッジの情報)。
260
+ *
261
+ * 图表数据模型的元信息(来源、采样、聚合徽章的信息)。
262
+ */
63
263
  export interface ChartDataModelMeta {
64
- /** 소스 종류. / Source kind. */
264
+ /**
265
+ * 소스 종류.
266
+ *
267
+ * Source kind.
268
+ *
269
+ * ソースの種類。
270
+ *
271
+ * 数据源的种类。
272
+ */
65
273
  sourceKind: ChartSource['kind'];
66
- /** 원본 포인트(행) 수. / Original point (row) count. */
274
+ /**
275
+ * 원본 포인트(행) 수.
276
+ *
277
+ * Original point (row) count.
278
+ *
279
+ * 元のポイント(行)の数。
280
+ *
281
+ * 原始点(行)的数量。
282
+ */
67
283
  total: number;
68
- /** LTTB 다운샘플 또는 category 집계로 축약됐는가 → 배지(§C). / Whether reduced by LTTB downsample or category aggregation → badge (§C). */
284
+ /**
285
+ * 원본 데이터가 LTTB 다운샘플링이나 카테고리 집계로 축약됐는가. true 면 화면에 그려진 값이
286
+ * 원본 그대로가 아니라는 뜻이므로, 이 값을 보고 UI에서 축약 사실을 배지로 고지해야 한다.
287
+ *
288
+ * Whether the original data was reduced via LTTB downsampling or category aggregation. When
289
+ * true, what's drawn on screen isn't the raw data verbatim, so the UI should read this flag
290
+ * and disclose the reduction with a badge.
291
+ *
292
+ * 元のデータが LTTB ダウンサンプリングやカテゴリー集計で縮約されたか。true なら画面に描かれた
293
+ * 値が元のままではないという意味なので、この値を見て UI で縮約の事実をバッジとして知らせる
294
+ * 必要があります。
295
+ *
296
+ * 原始数据是否经 LTTB 降采样或类别聚合而缩减。为 true 时,表示画面上绘制的值并非原始数据
297
+ * 本身,因此应根据该值在 UI 中以徽章告知缩减的事实。
298
+ */
69
299
  sampled: boolean;
70
- /** 다운샘플 전 포인트 수. / Point count before downsampling. */
300
+ /**
301
+ * 다운샘플링 전 포인트 수.
302
+ *
303
+ * Point count before downsampling.
304
+ *
305
+ * ダウンサンプリング前のポイント数。
306
+ *
307
+ * 降采样前的点数。
308
+ */
71
309
  sampledFrom?: number;
72
- /** 다운샘플 후 포인트 수. / Point count after downsampling. */
310
+ /**
311
+ * 다운샘플링 후 포인트 수.
312
+ *
313
+ * Point count after downsampling.
314
+ *
315
+ * ダウンサンプリング後のポイント数。
316
+ *
317
+ * 降采样后的点数。
318
+ */
73
319
  sampledTo?: number;
74
- /** 적용된 집계 연산. / Applied aggregation op. */
320
+ /**
321
+ * 적용된 집계 연산.
322
+ *
323
+ * Applied aggregation op.
324
+ *
325
+ * 適用された集計演算。
326
+ *
327
+ * 已应用的聚合运算。
328
+ */
75
329
  aggregatedOp?: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'custom';
76
- /** pie 에서 첫 시리즈만 사용됐는가. / Whether pie used only the first series. */
330
+ /**
331
+ * pie 에서 첫 시리즈만 사용됐는가.
332
+ *
333
+ * Whether pie used only the first series.
334
+ *
335
+ * pie で最初のシリーズだけが使われたか。
336
+ *
337
+ * pie 是否只使用了第一个系列。
338
+ */
77
339
  pieReducedToFirst?: boolean;
78
- /** pie 에서 음수를 절댓값 처리했는가. / Whether pie used absolute values for negatives. */
340
+ /**
341
+ * pie 에서 음수를 절댓값 처리했는가.
342
+ *
343
+ * Whether pie used absolute values for negatives.
344
+ *
345
+ * pie で負の数を絶対値として扱ったか。
346
+ *
347
+ * pie 是否把负数按绝对值处理。
348
+ */
79
349
  negativesAbsInPie?: boolean;
80
- /** SR 폴백 — extractor 가 렌더러와 무관하게 항상 채운다(§B 하드 게이트). / SR fallback — always filled by the extractor regardless of renderer (§B hard gate). */
350
+ /**
351
+ * 스크린리더 사용자를 위한 표 형태의 텍스트 등가물. 어떤 렌더 엔진(내장 canvas·외부 lib)을
352
+ * 쓰든 추출(extractor) 단계에서 항상 채워지므로, 렌더러가 접근성을 신경 쓰지 않아도 이 값은
353
+ * 항상 존재한다.
354
+ *
355
+ * A table-shaped text alternative for screen-reader users. It's always filled
356
+ * during extraction regardless of which render engine (built-in canvas or an external lib) is
357
+ * used, so it's guaranteed to exist even if the renderer itself doesn't handle accessibility.
358
+ *
359
+ * スクリーンリーダー利用者のための表形式のテキスト等価物。どのレンダーエンジン(内蔵 canvas・
360
+ * 外部 lib)を使っても抽出(extractor)の段階で必ず埋められるので、レンダラーがアクセシビリティ
361
+ * に気を配らなくてもこの値は常に存在します。
362
+ *
363
+ * 面向屏幕阅读器用户的表格形式文本等价物。无论使用哪种渲染引擎(内置 canvas、外部 lib),
364
+ * 抽取(extractor)阶段总会填充该值,因此即使渲染器不关心无障碍,它也始终存在。
365
+ */
81
366
  a11yTable: A11yTableModel;
82
367
  }
83
- /** 헤드리스 차트 데이터 모델(추출 산출물). / Headless chart data model (extraction output). */
368
+ /**
369
+ * 헤드리스 차트 데이터 모델(추출 산출물).
370
+ *
371
+ * Headless chart data model (extraction output).
372
+ *
373
+ * ヘッドレスなチャートデータモデル(抽出の成果物)。
374
+ *
375
+ * 无头图表数据模型(抽取的产物)。
376
+ */
84
377
  export interface ChartDataModel {
85
- /** 카테고리(x축) 라벨. / Category (x-axis) labels. */
378
+ /**
379
+ * 카테고리(x축) 라벨.
380
+ *
381
+ * Category (x-axis) labels.
382
+ *
383
+ * カテゴリー(x軸)のラベル。
384
+ *
385
+ * 类别(x轴)的标签。
386
+ */
86
387
  categories: string[];
87
- /** 시리즈 배열. / Series array. */
388
+ /**
389
+ * 시리즈 배열.
390
+ *
391
+ * Series array.
392
+ *
393
+ * シリーズの配列。
394
+ *
395
+ * 系列的数组。
396
+ */
88
397
  series: ChartSeries[];
89
- /** 모델 메타. / Model meta. */
398
+ /**
399
+ * 모델 메타.
400
+ *
401
+ * Model meta.
402
+ *
403
+ * モデルのメタ。
404
+ *
405
+ * 模型的元信息。
406
+ */
90
407
  meta: ChartDataModelMeta;
91
408
  }
92
- /** 차트 테마(색·글꼴·팔레트). / Chart theme (colors, fonts, palette). */
409
+ /**
410
+ * 차트 테마(색·글꼴·팔레트).
411
+ *
412
+ * Chart theme (colors, fonts, palette).
413
+ *
414
+ * チャートのテーマ(色・フォント・パレット)。
415
+ *
416
+ * 图表主题(颜色、字体、调色板)。
417
+ */
93
418
  export interface ChartTheme {
94
- /** 주 색. / Primary color. */
419
+ /**
420
+ * 주 색.
421
+ *
422
+ * Primary color.
423
+ *
424
+ * 主要な色。
425
+ *
426
+ * 主色。
427
+ */
95
428
  primary: string;
96
- /** 축·테두리 색. / Axis/border color. */
429
+ /**
430
+ * 축·테두리 색.
431
+ *
432
+ * Axis/border color.
433
+ *
434
+ * 軸・枠線の色。
435
+ *
436
+ * 轴/边框的颜色。
437
+ */
97
438
  border: string;
98
- /** 텍스트 색. / Text color. */
439
+ /**
440
+ * 텍스트 색.
441
+ *
442
+ * Text color.
443
+ *
444
+ * テキストの色。
445
+ *
446
+ * 文本的颜色。
447
+ */
99
448
  text: string;
100
- /** 배경 색. / Background color. */
449
+ /**
450
+ * 배경 색.
451
+ *
452
+ * Background color.
453
+ *
454
+ * 背景の色。
455
+ *
456
+ * 背景的颜色。
457
+ */
101
458
  bg: string;
102
- /** 그리드 선 색. / Grid line color. */
459
+ /**
460
+ * 그리드 선 색.
461
+ *
462
+ * Grid line color.
463
+ *
464
+ * グリッド線の色。
465
+ *
466
+ * 网格线的颜色。
467
+ */
103
468
  gridLine: string;
104
- /** 글꼴 패밀리. / Font family. */
469
+ /**
470
+ * 글꼴 패밀리.
471
+ *
472
+ * Font family.
473
+ *
474
+ * フォントファミリー。
475
+ *
476
+ * 字体族。
477
+ */
105
478
  fontFamily: string;
106
- /** 기본 글꼴 크기(px). / Base font size in px. */
479
+ /**
480
+ * 기본 글꼴 크기(px).
481
+ *
482
+ * Base font size in px.
483
+ *
484
+ * 基本のフォントサイズ(px)。
485
+ *
486
+ * 基础字号(px)。
487
+ */
107
488
  fontSize: number;
108
- /** 시리즈 순환 팔레트. / Series-cycling palette. */
489
+ /**
490
+ * 시리즈 순환 팔레트.
491
+ *
492
+ * Series-cycling palette.
493
+ *
494
+ * シリーズを循環させるパレット。
495
+ *
496
+ * 供系列循环使用的调色板。
497
+ */
109
498
  palette: string[];
110
499
  }
111
- /** 렌더 스펙(어댑터에 전달되는 스냅샷). / Render spec (snapshot passed to adapters). */
500
+ /**
501
+ * 렌더 스펙(어댑터에 전달되는 스냅샷).
502
+ *
503
+ * Render spec (snapshot passed to adapters).
504
+ *
505
+ * レンダー仕様(アダプターに渡されるスナップショット)。
506
+ *
507
+ * 渲染规格(传给适配器的快照)。
508
+ */
112
509
  export interface ChartRenderSpec {
113
- /** 차트 타입. / Chart type. */
510
+ /**
511
+ * 차트 타입.
512
+ *
513
+ * Chart type.
514
+ *
515
+ * チャートのタイプ。
516
+ *
517
+ * 图表的类型。
518
+ */
114
519
  type: ChartType;
115
- /** 차트 제목. / Chart title. */
520
+ /**
521
+ * 차트 제목.
522
+ *
523
+ * Chart title.
524
+ *
525
+ * チャートのタイトル。
526
+ *
527
+ * 图表的标题。
528
+ */
116
529
  title?: string;
117
- /** 범례 표시/위치. / Legend visibility/position. */
530
+ /**
531
+ * 범례 표시/위치.
532
+ *
533
+ * Legend visibility/position.
534
+ *
535
+ * 凡例の表示/位置。
536
+ *
537
+ * 图例的显示/位置。
538
+ */
118
539
  legend?: boolean | {
119
540
  position: 'top' | 'bottom' | 'left' | 'right';
120
541
  };
121
- /** 툴팁 사용 여부. / Whether tooltips are enabled. */
542
+ /**
543
+ * 툴팁 사용 여부.
544
+ *
545
+ * Whether tooltips are enabled.
546
+ *
547
+ * ツールチップを使うかどうか。
548
+ *
549
+ * 是否启用提示框。
550
+ */
122
551
  tooltip?: boolean;
123
- /** 축 설정(라벨·min/max·스택). / Axis config (labels, min/max, stacked). */
552
+ /**
553
+ * 축 설정(라벨·min/max·스택).
554
+ *
555
+ * Axis config (labels, min/max, stacked).
556
+ *
557
+ * 軸の設定(ラベル・min/max・スタック)。
558
+ *
559
+ * 轴的配置(标签、min/max、堆叠)。
560
+ */
124
561
  axis?: {
125
562
  xLabel?: string;
126
563
  yLabel?: string;
@@ -128,149 +565,675 @@ export interface ChartRenderSpec {
128
565
  yMax?: number;
129
566
  stacked?: boolean;
130
567
  };
131
- /** 시리즈 팔레트(테마 팔레트 오버라이드). / Series palette (overrides theme palette). */
568
+ /**
569
+ * 시리즈 팔레트(테마 팔레트 오버라이드).
570
+ *
571
+ * Series palette (overrides theme palette).
572
+ *
573
+ * シリーズのパレット(テーマのパレットを上書き)。
574
+ *
575
+ * 系列的调色板(覆盖主题的调色板)。
576
+ */
132
577
  palette?: string[];
133
- /** 렌더 테마. / Render theme. */
578
+ /**
579
+ * 렌더 테마.
580
+ *
581
+ * Render theme.
582
+ *
583
+ * レンダーのテーマ。
584
+ *
585
+ * 渲染的主题。
586
+ */
134
587
  theme: ChartTheme;
135
- /** 숫자 포맷터(축/툴팁/범례 컨텍스트). / Number formatter (axis/tooltip/legend context). */
588
+ /**
589
+ * 숫자 포맷터(축/툴팁/범례 컨텍스트).
590
+ *
591
+ * Number formatter (axis/tooltip/legend context).
592
+ *
593
+ * 数値のフォーマッター(軸/ツールチップ/凡例のコンテキスト)。
594
+ *
595
+ * 数值格式化函数(轴/提示框/图例的上下文)。
596
+ */
136
597
  numberFormat?: (v: number, ctx: {
137
598
  axis: 'x' | 'y' | 'tooltip' | 'legend';
138
599
  field?: string;
139
600
  }) => string;
140
- /** 접근성 테이블 모델. / Accessibility table model. */
601
+ /**
602
+ * 접근성 테이블 모델.
603
+ *
604
+ * Accessibility table model.
605
+ *
606
+ * アクセシビリティのテーブルモデル。
607
+ *
608
+ * 无障碍表格模型。
609
+ */
141
610
  a11y: A11yTableModel;
142
611
  }
143
- /** 차트 포인트(히트테스트/클릭 대상). / Chart point (hit-test/click target). */
612
+ /**
613
+ * 차트 포인트(히트테스트/클릭 대상).
614
+ *
615
+ * Chart point (hit-test/click target).
616
+ *
617
+ * チャートのポイント(ヒットテスト/クリックの対象)。
618
+ *
619
+ * 图表的点(命中测试/点击的目标)。
620
+ */
144
621
  export interface ChartPoint {
145
- /** 시리즈 이름. / Series name. */
622
+ /**
623
+ * 시리즈 이름.
624
+ *
625
+ * Series name.
626
+ *
627
+ * シリーズの名前。
628
+ *
629
+ * 系列的名称。
630
+ */
146
631
  seriesName: string;
147
- /** 카테고리 라벨. / Category label. */
632
+ /**
633
+ * 카테고리 라벨.
634
+ *
635
+ * Category label.
636
+ *
637
+ * カテゴリーのラベル。
638
+ *
639
+ * 类别的标签。
640
+ */
148
641
  category: string;
149
- /** 값(결측 null). / Value (null if missing). */
642
+ /**
643
+ * 값(결측 null).
644
+ *
645
+ * Value (null if missing).
646
+ *
647
+ * 値(欠測は null)。
648
+ *
649
+ * 值(缺失为 null)。
650
+ */
150
651
  value: number | null;
151
- /** 카테고리 인덱스. / Category index. */
652
+ /**
653
+ * 카테고리 인덱스.
654
+ *
655
+ * Category index.
656
+ *
657
+ * カテゴリーのインデックス。
658
+ *
659
+ * 类别的索引。
660
+ */
152
661
  index: number;
153
- /** 원본 행 stable id(있으면). / Source row stable id (if any). */
662
+ /**
663
+ * 원본 행 stable id(있으면).
664
+ *
665
+ * Source row stable id (if any).
666
+ *
667
+ * 元の行の stable id(あれば)。
668
+ *
669
+ * 源行的 stable id(如果有)。
670
+ */
154
671
  rowId?: string;
155
672
  }
156
673
  /**
157
- * 차트 렌더 어댑터(교체 seam) — 내장 canvas / 외부 lib 백엔드를 통일된 인터페이스로 감싼다.
158
- * / Chart render adapter (swap seam) — wraps the built-in canvas / external-lib backends behind one interface.
674
+ * 차트 렌더 어댑터(교체 seam) — 내장 canvas 렌더러와 외부 차트 라이브러리(ECharts 등) 백엔드를
675
+ * 하나의 공통 인터페이스로 감싼다. 내장 렌더러로는 부족해서 다른 차트 라이브러리로 실제 그리는
676
+ * 부분만 바꿔치기하고 싶을 때, 이 인터페이스를 구현해 `ChartConfig.engine`에 넘긴다.
677
+ *
678
+ * Chart render adapter (swap seam) — wraps the built-in canvas renderer and external chart
679
+ * library backends (e.g. ECharts) behind one common interface. Implement this when the built-in
680
+ * renderer isn't enough and you want to swap in a different charting library for the actual
681
+ * drawing, then pass it via `ChartConfig.engine`.
682
+ *
683
+ * チャートのレンダーアダプター(差し替えの seam) — 内蔵 canvas レンダラーと外部チャート
684
+ * ライブラリ(ECharts など)のバックエンドを、一つの共通インターフェースで包みます。内蔵
685
+ * レンダラーでは足りず、別のチャートライブラリで実際に描く部分だけを差し替えたいときに、この
686
+ * インターフェースを実装して `ChartConfig.engine` に渡します。
687
+ *
688
+ * 图表渲染适配器(替换用的 seam) — 用一个共同的接口包裹内置 canvas 渲染器和外部图表库
689
+ * (如 ECharts)后端。当内置渲染器不够用、只想把实际绘制的部分换成别的图表库时,实现该接口
690
+ * 并传给 `ChartConfig.engine`。
691
+ *
692
+ * @example
693
+ * const myAdapter: ChartAdapter = {
694
+ * id: 'my-echarts-adapter',
695
+ * // create the chart-lib instance
696
+ * async init(host, spec) { echartsInstance = echarts.init(host); },
697
+ * // map the model into the lib's format and draw
698
+ * render(model, spec) { echartsInstance.setOption(toEchartsOption(model, spec)); },
699
+ * // call the lib's resize
700
+ * resize(w, h) { echartsInstance.resize({ width: w, height: h }); },
701
+ * // tear down the lib instance
702
+ * destroy() { echartsInstance.dispose(); },
703
+ * };
159
704
  */
160
705
  export interface ChartAdapter {
161
- /** 어댑터 식별자. / Adapter identifier. */
706
+ /**
707
+ * 어댑터 식별자.
708
+ *
709
+ * Adapter identifier.
710
+ *
711
+ * アダプターの識別子。
712
+ *
713
+ * 适配器的标识符。
714
+ */
162
715
  readonly id: string;
163
- /** 호스트에 초기화. / Initialize into the host. */
716
+ /**
717
+ * 호스트에 초기화.
718
+ *
719
+ * Initialize into the host.
720
+ *
721
+ * ホストへ初期化。
722
+ *
723
+ * 在宿主元素中初始化。
724
+ */
164
725
  init(host: HTMLElement, spec: ChartRenderSpec): Promise<void>;
165
- /** 모델을 렌더. / Render the model. */
726
+ /**
727
+ * 모델을 렌더.
728
+ *
729
+ * Render the model.
730
+ *
731
+ * モデルをレンダー。
732
+ *
733
+ * 渲染模型。
734
+ */
166
735
  render(model: ChartDataModel, spec: ChartRenderSpec): void;
167
- /** 렌더 영역 크기 변경. / Resize the render area. */
736
+ /**
737
+ * 렌더 영역 크기 변경.
738
+ *
739
+ * Resize the render area.
740
+ *
741
+ * レンダー領域のサイズ変更。
742
+ *
743
+ * 调整渲染区域的大小。
744
+ */
168
745
  resize(width: number, height: number): void;
169
- /** 현재 렌더를 이미지 Blob 으로(선택). / Export current render as an image Blob (optional). */
746
+ /**
747
+ * 현재 렌더를 이미지 Blob 으로(선택).
748
+ *
749
+ * Export current render as an image Blob (optional).
750
+ *
751
+ * 現在のレンダーを画像 Blob として(任意)。
752
+ *
753
+ * 把当前渲染结果导出为图片 Blob(可选)。
754
+ */
170
755
  toBlob?(mime?: string): Promise<Blob | null>;
171
- /** 포인트 클릭 콜백 등록(선택). / Register a point-click callback (optional). */
756
+ /**
757
+ * 포인트 클릭 콜백 등록(선택).
758
+ *
759
+ * Register a point-click callback (optional).
760
+ *
761
+ * ポイントクリックのコールバック登録(任意)。
762
+ *
763
+ * 注册点位点击的回调(可选)。
764
+ */
172
765
  onPointClick?(cb: (p: ChartPoint) => void): void;
173
- /** 어댑터 정리. / Tear down the adapter. */
766
+ /**
767
+ * 어댑터 정리.
768
+ *
769
+ * Tear down the adapter.
770
+ *
771
+ * アダプターの後始末。
772
+ *
773
+ * 清理适配器。
774
+ */
174
775
  destroy(): void;
175
776
  }
176
- /** createChart 반환 핸들(§6). 구현은 ChartManager. / Handle returned by createChart (§6); implemented by ChartManager. */
777
+ /**
778
+ * `grid.createChart()`가 반환하는, 살아있는 차트를 다루는 핸들. 실제 구현체는 ChartManager.
779
+ * 이 핸들로 타입 전환·갱신·이미지 추출·파기까지 차트의 생애주기 전체를 조작한다.
780
+ *
781
+ * The handle returned by `grid.createChart()` for controlling a live chart; implemented by
782
+ * ChartManager. Use it to change type, refresh, export an image, and destroy — the chart's
783
+ * whole lifecycle.
784
+ *
785
+ * `grid.createChart()` が返す、生きているチャートを扱うハンドル。実際の実装は ChartManager。
786
+ * このハンドルでタイプの切り替え・更新・画像の取り出し・破棄まで、チャートのライフサイクル
787
+ * 全体を操作します。
788
+ *
789
+ * `grid.createChart()` 返回的句柄,用于操作活动中的图表;实际实现是 ChartManager。用它切换类型、
790
+ * 更新、导出图片、销毁 — 操作图表的整个生命周期。
791
+ */
177
792
  export interface ChartInstance {
178
- /** 차트 인스턴스 id. / Chart instance id. */
793
+ /**
794
+ * 차트 인스턴스 id.
795
+ *
796
+ * Chart instance id.
797
+ *
798
+ * チャートインスタンスの id。
799
+ *
800
+ * 图表实例的 id。
801
+ */
179
802
  readonly id: string;
180
- /** 설정 패치 후 갱신. / Patch config and update. */
803
+ /**
804
+ * 설정 패치 후 갱신.
805
+ *
806
+ * Patch config and update.
807
+ *
808
+ * 設定をパッチしてから更新。
809
+ *
810
+ * 修补配置后更新。
811
+ */
181
812
  update(patch?: Partial<ChartConfig>): void;
182
813
  /**
183
- * 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더한다(§5.3). 그리드는 테마 변경
184
- * 이벤트를 발행하지 않으므로(`setTheme`/`setThemeVar`는 CSS 만 갱신) 다크모드 토글처럼 데이터
185
- * 변화 없는 순수 테마 전환 후에는, 열려 있는 각 차트에 대해 이 메서드를 호출해야 새 테마
186
- * (색·글꼴·팔레트)가 재적용된다. `update()`/`setType()`도 내부적으로 동일 경로를 탄다.
814
+ * 모델을 재추출하고 렌더 스펙(테마 포함)을 다시 계산해 재렌더한다.
815
+ *
816
+ * Re-extract the model and recompute the render spec (incl. theme), then re-render.
817
+ *
818
+ * モデルを再抽出し、レンダー仕様(テーマを含む)を計算し直して再レンダーします。
819
+ *
820
+ * 重新抽取模型,重新计算渲染规格(含主题),然后重新渲染。
821
+ *
822
+ * 그리드는 테마가 바뀌어도 별도 이벤트를 발행하지 않는다(`setTheme`/`setThemeVar`는 CSS만
823
+ * 갱신). 그래서 다크모드 토글처럼 데이터는 그대로고 테마만 바뀐 경우, 열려 있는 각 차트에
824
+ * 대해 이 메서드를 직접 호출해야 새 테마(색·글꼴·팔레트)가 반영된다. `update()`/`setType()`도
825
+ * 내부적으로 이 경로를 그대로 탄다.
826
+ *
827
+ * The grid doesn't emit a dedicated event when only the theme changes (`setTheme`/
828
+ * `setThemeVar` update CSS only). So after a pure theme switch with no data change — e.g. a
829
+ * dark-mode toggle — call this on each open chart to apply the new theme (colors, fonts,
830
+ * palette). `update()` and `setType()` internally follow the same path.
831
+ *
832
+ * グリッドはテーマが変わっても別途イベントを発行しません(`setTheme`/`setThemeVar` は CSS
833
+ * だけを更新)。そのため、ダークモードの切り替えのようにデータはそのままでテーマだけが
834
+ * 変わった場合は、開いている各チャートに対してこのメソッドを直接呼ばないと新しいテーマ
835
+ * (色・フォント・パレット)が反映されません。`update()`/`setType()` も内部的にこの経路を
836
+ * そのまま通ります。
837
+ *
838
+ * 主题变化时表格不会发出专门的事件(`setTheme`/`setThemeVar` 只更新 CSS)。因此,像切换暗色
839
+ * 模式那样数据不变、只有主题变化的情况下,必须对每个已打开的图表直接调用该方法,新主题
840
+ * (颜色、字体、调色板)才会生效。`update()`/`setType()` 内部也走同一条路径。
187
841
  */
188
- /** 모델을 재추출하고 렌더 스펙(테마 포함)을 재스냅샷해 재렌더. / Re-extract the model and re-snapshot the render spec (incl. theme), then re-render. */
189
842
  refresh(): void;
190
- /** 차트 타입 변경. / Change the chart type. */
843
+ /**
844
+ * 차트 타입 변경.
845
+ *
846
+ * Change the chart type.
847
+ *
848
+ * チャートタイプの変更。
849
+ *
850
+ * 变更图表的类型。
851
+ */
191
852
  setType(type: ChartType): void;
192
- /** 차트 인스턴스 파기. / Destroy the chart instance. */
853
+ /**
854
+ * 차트 인스턴스 파기.
855
+ *
856
+ * Destroy the chart instance.
857
+ *
858
+ * チャートインスタンスの破棄。
859
+ *
860
+ * 销毁图表实例。
861
+ */
193
862
  destroy(): void;
194
- /** 현재 렌더를 이미지 Blob 으로. / Export current render as an image Blob. */
863
+ /**
864
+ * 현재 렌더를 이미지 Blob 으로.
865
+ *
866
+ * Export current render as an image Blob.
867
+ *
868
+ * 現在のレンダーを画像 Blob として。
869
+ *
870
+ * 把当前渲染结果导出为图片 Blob。
871
+ */
195
872
  toBlob(mime?: string): Promise<Blob | null>;
196
- /** 현재 데이터 모델 반환. / Return the current data model. */
873
+ /**
874
+ * 현재 데이터 모델 반환.
875
+ *
876
+ * Return the current data model.
877
+ *
878
+ * 現在のデータモデルを返します。
879
+ *
880
+ * 返回当前的数据模型。
881
+ */
197
882
  getModel(): ChartDataModel;
198
- /** 차트 이벤트 리스너 등록. / Register a chart event listener. */
883
+ /**
884
+ * 차트 이벤트 리스너 등록.
885
+ *
886
+ * Register a chart event listener.
887
+ *
888
+ * チャートイベントのリスナー登録。
889
+ *
890
+ * 注册图表事件的监听器。
891
+ */
199
892
  on(ev: 'chartRender' | 'chartPointClick', cb: (...a: any[]) => void): void;
200
893
  }
201
- /** GridOptions.chart 로 중첩되는 전역 옵션(C5.1, 최상위 flat 키 금지). / Global options nested under GridOptions.chart (C5.1; no top-level flat keys). */
894
+ /**
895
+ * `GridOptions.chart`에 중첩해서 넣는, 그리드 전체에 적용되는 차트 기본값. 그리드 인스턴스를
896
+ * 만들 때 한 번 설정해 두면 이후 `createChart()` 호출마다 반복하지 않아도 되는 공통값(기본
897
+ * 엔진·팔레트·포인트 상한 등)이다.
898
+ *
899
+ * Chart defaults applied grid-wide, nested under
900
+ * `GridOptions.chart`. Set once when constructing the grid, and every later `createChart()` call
901
+ * inherits the shared defaults (default engine, palette, point cap, etc.) without repeating them.
902
+ *
903
+ * `GridOptions.chart` に入れ子にして入れる、グリッド全体に適用されるチャートの既定値。グリッド
904
+ * インスタンスを作るときに一度設定しておけば、以後の `createChart()` の呼び出しごとに繰り返さ
905
+ * なくてよい共通の値(既定のエンジン・パレット・ポイント上限など)です。
906
+ *
907
+ * 嵌套在 `GridOptions.chart` 下、作用于整个表格的图表默认值。构建表格实例时设置一次,之后每次
908
+ * 调用 `createChart()` 都无需重复填写这些共同的值(默认引擎、调色板、点数上限等)。
909
+ */
202
910
  export interface ChartGlobalOptions {
203
- /** 차트 기능 활성화. / Enable the chart feature. */
911
+ /**
912
+ * 차트 기능 활성화.
913
+ *
914
+ * Enable the chart feature.
915
+ *
916
+ * チャート機能の有効化。
917
+ *
918
+ * 启用图表功能。
919
+ */
204
920
  enabled?: boolean;
205
- /** 기본 렌더 엔진. / Default render engine. */
921
+ /**
922
+ * 기본 렌더 엔진.
923
+ *
924
+ * Default render engine.
925
+ *
926
+ * 既定のレンダーエンジン。
927
+ *
928
+ * 默认的渲染引擎。
929
+ */
206
930
  defaultEngine?: 'builtin' | 'chartjs' | 'echarts';
207
- /** 기본 차트 타입. / Default chart type. */
931
+ /**
932
+ * 기본 차트 타입.
933
+ *
934
+ * Default chart type.
935
+ *
936
+ * 既定のチャートタイプ。
937
+ *
938
+ * 默认的图表类型。
939
+ */
208
940
  defaultType?: ChartType;
209
- /** 기본 배치 방식. / Default placement. */
941
+ /**
942
+ * 기본 배치 방식.
943
+ *
944
+ * Default placement.
945
+ *
946
+ * 既定の配置方法。
947
+ *
948
+ * 默认的放置方式。
949
+ */
210
950
  placement?: 'docked' | 'modal' | 'inline' | 'floating';
211
- /** 렌더 포인트 상한(초과 시 다운샘플). / Max render points (downsample above this). */
951
+ /**
952
+ * 렌더 포인트 상한(초과 시 다운샘플링).
953
+ *
954
+ * Max render points (downsample above this).
955
+ *
956
+ * レンダーするポイントの上限(超えたらダウンサンプリング)。
957
+ *
958
+ * 渲染点数的上限(超出则降采样)。
959
+ */
212
960
  maxPoints?: number;
213
- /** live 갱신 디바운스(ms). / Debounce for live updates (ms). */
961
+ /**
962
+ * live 갱신 디바운스(ms).
963
+ *
964
+ * Debounce for live updates (ms).
965
+ *
966
+ * live 更新のデバウンス(ms)。
967
+ *
968
+ * live 更新的防抖(ms)。
969
+ */
214
970
  debounceMs?: number;
215
- /** 기본 팔레트. / Default palette. */
971
+ /**
972
+ * 기본 팔레트.
973
+ *
974
+ * Default palette.
975
+ *
976
+ * 既定のパレット。
977
+ *
978
+ * 默认的调色板。
979
+ */
216
980
  palette?: string[];
217
- /** 기본 숫자 포맷터. / Default number formatter. */
981
+ /**
982
+ * 기본 숫자 포맷터.
983
+ *
984
+ * Default number formatter.
985
+ *
986
+ * 既定の数値フォーマッター。
987
+ *
988
+ * 默认的数值格式化函数。
989
+ */
218
990
  numberFormat?: (v: number, ctx: {
219
991
  axis: 'x' | 'y' | 'tooltip' | 'legend';
220
992
  field?: string;
221
993
  }) => string;
222
- /** 차트 생성 콜백. / Chart-create callback. */
994
+ /**
995
+ * 차트 생성 콜백.
996
+ *
997
+ * Chart-create callback.
998
+ *
999
+ * チャート生成のコールバック。
1000
+ *
1001
+ * 图表创建的回调。
1002
+ */
223
1003
  onChartCreate?: (i: ChartInstance) => void;
224
- /** 차트 렌더 콜백. / Chart-render callback. */
1004
+ /**
1005
+ * 차트 렌더 콜백.
1006
+ *
1007
+ * Chart-render callback.
1008
+ *
1009
+ * チャートレンダーのコールバック。
1010
+ *
1011
+ * 图表渲染的回调。
1012
+ */
225
1013
  onChartRender?: (e: {
226
1014
  id: string;
227
1015
  model: ChartDataModel;
228
1016
  }) => void;
229
- /** 포인트 클릭 콜백. / Point-click callback. */
1017
+ /**
1018
+ * 포인트 클릭 콜백.
1019
+ *
1020
+ * Point-click callback.
1021
+ *
1022
+ * ポイントクリックのコールバック。
1023
+ *
1024
+ * 点位点击的回调。
1025
+ */
230
1026
  onChartPointClick?: (e: {
231
1027
  id: string;
232
1028
  point: ChartPoint;
233
1029
  }) => void;
234
- /** 차트 파기 콜백. / Chart-destroy callback. */
1030
+ /**
1031
+ * 차트 파기 콜백.
1032
+ *
1033
+ * Chart-destroy callback.
1034
+ *
1035
+ * チャート破棄のコールバック。
1036
+ *
1037
+ * 图表销毁的回调。
1038
+ */
235
1039
  onChartDestroy?: (e: {
236
1040
  id: string;
237
1041
  }) => void;
238
1042
  }
239
- /** createChart() 공개 설정(§6). / Public config for createChart() (§6). */
1043
+ /**
1044
+ * `grid.createChart(config)`에 넘기는 공개 설정. 어떤 데이터를(source) 어떤 모양으로(type)
1045
+ * 그릴지가 필수고, 나머지는 배치·엔진·꾸밈(제목/범례/축 등)을 위한 선택 옵션이다.
1046
+ *
1047
+ * The public config passed to `grid.createChart(config)`. Only which data (source) and what
1048
+ * shape (type) to draw are required; the rest are optional placement/engine/decoration
1049
+ * (title, legend, axis, etc.) settings.
1050
+ *
1051
+ * `grid.createChart(config)` に渡す公開設定。どのデータを(source)どの形で(type)描くかが必須で、
1052
+ * 残りは配置・エンジン・装飾(タイトル/凡例/軸など)のための任意オプションです。
1053
+ *
1054
+ * 传给 `grid.createChart(config)` 的公开配置。绘制哪些数据(source)、绘制成什么形态(type)是
1055
+ * 必填项;其余是用于放置、引擎、装饰(标题/图例/轴等)的可选项。
1056
+ *
1057
+ * @example
1058
+ * const chart = grid.createChart({
1059
+ * source: { kind: 'all' },
1060
+ * type: 'bar',
1061
+ * category: 'region',
1062
+ * series: ['sales'],
1063
+ * placement: 'inline',
1064
+ * mount: document.querySelector('#chart-host')!,
1065
+ * });
1066
+ */
240
1067
  export interface ChartConfig {
241
- /** 데이터 소스. / Data source. */
1068
+ /**
1069
+ * 데이터 소스.
1070
+ *
1071
+ * Data source.
1072
+ *
1073
+ * データソース。
1074
+ *
1075
+ * 数据源。
1076
+ */
242
1077
  source: ChartSource;
243
- /** 차트 타입. / Chart type. */
1078
+ /**
1079
+ * 차트 타입.
1080
+ *
1081
+ * Chart type.
1082
+ *
1083
+ * チャートのタイプ。
1084
+ *
1085
+ * 图表的类型。
1086
+ */
244
1087
  type: ChartType;
245
- /** 렌더 엔진 또는 커스텀 어댑터. / Render engine or custom adapter. */
1088
+ /**
1089
+ * 렌더 엔진 또는 커스텀 어댑터.
1090
+ *
1091
+ * Render engine or custom adapter.
1092
+ *
1093
+ * レンダーエンジン、またはカスタムアダプター。
1094
+ *
1095
+ * 渲染引擎,或自定义适配器。
1096
+ */
246
1097
  engine?: 'builtin' | 'chartjs' | 'echarts' | ChartAdapter;
247
- /** 배치 방식. / Placement. */
1098
+ /**
1099
+ * 배치 방식.
1100
+ *
1101
+ * Placement.
1102
+ *
1103
+ * 配置方法。
1104
+ *
1105
+ * 放置方式。
1106
+ */
248
1107
  placement?: 'docked' | 'modal' | 'inline' | 'floating';
249
- /** inline/floating 시 마운트 대상. / Mount target for inline/floating. */
1108
+ /**
1109
+ * inline/floating 시 마운트 대상.
1110
+ *
1111
+ * Mount target for inline/floating.
1112
+ *
1113
+ * inline/floating のときのマウント先。
1114
+ *
1115
+ * inline/floating 时的挂载目标。
1116
+ */
250
1117
  mount?: HTMLElement;
251
- /** 카테고리(x축) 컬럼 field. / Category (x-axis) column field. */
1118
+ /**
1119
+ * 카테고리(x축) 컬럼 field.
1120
+ *
1121
+ * Category (x-axis) column field.
1122
+ *
1123
+ * カテゴリー(x軸)の列の field。
1124
+ *
1125
+ * 类别(x轴)列的 field。
1126
+ */
252
1127
  category?: string;
253
- /** 시리즈 명세 목록. / Series specs. */
1128
+ /**
1129
+ * 시리즈 명세 목록.
1130
+ *
1131
+ * Series specs.
1132
+ *
1133
+ * シリーズ仕様の一覧。
1134
+ *
1135
+ * 系列规格的列表。
1136
+ */
254
1137
  series?: Array<string | ChartSeriesSpec>;
255
- /** 카테고리 집계 연산. / Category aggregation op. */
1138
+ /**
1139
+ * 카테고리 집계 연산.
1140
+ *
1141
+ * Category aggregation op.
1142
+ *
1143
+ * カテゴリーの集計演算。
1144
+ *
1145
+ * 类别的聚合运算。
1146
+ */
256
1147
  aggregate?: ChartAggregate;
257
- /** 렌더 포인트 상한. / Max render points. */
1148
+ /**
1149
+ * 렌더 포인트 상한.
1150
+ *
1151
+ * Max render points.
1152
+ *
1153
+ * レンダーするポイントの上限。
1154
+ *
1155
+ * 渲染点数的上限。
1156
+ */
258
1157
  maxPoints?: number;
259
- /** 데이터 변경 시 자동 갱신. / Auto-refresh on data changes. */
1158
+ /**
1159
+ * 데이터 변경 시 자동 갱신.
1160
+ *
1161
+ * Auto-refresh on data changes.
1162
+ *
1163
+ * データ変更時の自動更新。
1164
+ *
1165
+ * 数据变化时自动更新。
1166
+ */
260
1167
  live?: boolean;
261
- /** 차트 제목. / Chart title. */
1168
+ /**
1169
+ * 차트 제목.
1170
+ *
1171
+ * Chart title.
1172
+ *
1173
+ * チャートのタイトル。
1174
+ *
1175
+ * 图表的标题。
1176
+ */
262
1177
  title?: string;
263
- /** 범례 설정. / Legend config. */
1178
+ /**
1179
+ * 범례 설정.
1180
+ *
1181
+ * Legend config.
1182
+ *
1183
+ * 凡例の設定。
1184
+ *
1185
+ * 图例的配置。
1186
+ */
264
1187
  legend?: ChartRenderSpec['legend'];
265
- /** 툴팁 사용 여부. / Whether tooltips are enabled. */
1188
+ /**
1189
+ * 툴팁 사용 여부.
1190
+ *
1191
+ * Whether tooltips are enabled.
1192
+ *
1193
+ * ツールチップを使うかどうか。
1194
+ *
1195
+ * 是否启用提示框。
1196
+ */
266
1197
  tooltip?: boolean;
267
- /** 축 설정. / Axis config. */
1198
+ /**
1199
+ * 축 설정.
1200
+ *
1201
+ * Axis config.
1202
+ *
1203
+ * 軸の設定。
1204
+ *
1205
+ * 轴的配置。
1206
+ */
268
1207
  axis?: ChartRenderSpec['axis'];
269
- /** 시리즈 팔레트. / Series palette. */
1208
+ /**
1209
+ * 시리즈 팔레트.
1210
+ *
1211
+ * Series palette.
1212
+ *
1213
+ * シリーズのパレット。
1214
+ *
1215
+ * 系列的调色板。
1216
+ */
270
1217
  palette?: string[];
271
- /** 숫자 포맷터. / Number formatter. */
1218
+ /**
1219
+ * 숫자 포맷터.
1220
+ *
1221
+ * Number formatter.
1222
+ *
1223
+ * 数値のフォーマッター。
1224
+ *
1225
+ * 数值的格式化函数。
1226
+ */
272
1227
  numberFormat?: ChartRenderSpec['numberFormat'];
273
- /** 렌더 크기(px). / Render size (px). */
1228
+ /**
1229
+ * 렌더 크기(px).
1230
+ *
1231
+ * Render size (px).
1232
+ *
1233
+ * レンダーのサイズ(px)。
1234
+ *
1235
+ * 渲染的尺寸(px)。
1236
+ */
274
1237
  size?: {
275
1238
  width: number;
276
1239
  height: number;