@open-spreadsheet/core 0.2.0 → 0.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.
- package/app/assets.ts +1479 -0
- package/app/book.ts +115 -24
- package/app/charts.test.ts +62 -1
- package/app/charts.ts +268 -46
- package/app/i18n-more.ts +230 -2
- package/app/i18n.ts +154 -2
- package/app/icons.ts +5 -0
- package/app/markdown.test.ts +25 -0
- package/app/markdown.ts +150 -0
- package/app/note-editor.ts +252 -0
- package/app/style.css +154 -0
- package/app/types.ts +3 -1
- package/assets.js +232 -0
- package/dist/charts.js +384 -0
- package/mcp.js +97 -5
- package/ops.js +6 -1
- package/package.json +6 -3
- package/server.js +81 -2
- package/skills/apply-notes/SKILL.md +3 -1
- package/skills/sheet-authoring/SKILL.md +11 -1
- package/templates/AGENTS.md +1 -0
package/app/charts.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Charts drawn as SVG from a range:
|
|
2
|
+
* Charts drawn as SVG from a range: columns (grouped or stacked), horizontal
|
|
3
|
+
* bars, lines, areas, pie and doughnut, scatter, and combo. Hand-written,
|
|
3
4
|
* like open-dashboard's: one y-axis, zero in the domain, a fixed categorical
|
|
4
5
|
* palette, ticks from one formatter, text in ink colours.
|
|
5
6
|
*/
|
|
6
7
|
import { CellError, formatValue, type Scalar } from '@open-spreadsheet/engine';
|
|
7
|
-
import type { ChartSpec } from './types.ts';
|
|
8
|
+
import type { ChartSpec, ChartType } from './types.ts';
|
|
9
|
+
|
|
10
|
+
export const CHART_TYPES: ChartType[] = ['bar', 'barH', 'stacked', 'line', 'area', 'pie', 'doughnut', 'scatter', 'combo'];
|
|
8
11
|
|
|
9
12
|
export type { ChartSpec, ChartType } from './types.ts';
|
|
10
13
|
|
|
@@ -15,6 +18,71 @@ export interface ChartData {
|
|
|
15
18
|
|
|
16
19
|
export const PALETTE = ['#2a78d6', '#e8710a', '#1e8e3e', '#d93025', '#9334e6', '#12b5cb', '#c5221f', '#7f6000'];
|
|
17
20
|
|
|
21
|
+
/**
|
|
22
|
+
* How a chart file looks: series colours, background, text, grid and type.
|
|
23
|
+
* A few come built in; a workspace's own live in assets/chart-styles.json so
|
|
24
|
+
* every workbook, teammate and agent draws with the same house style.
|
|
25
|
+
*/
|
|
26
|
+
export interface ChartStyle {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
colors: string[];
|
|
30
|
+
background: string;
|
|
31
|
+
text: string;
|
|
32
|
+
muted: string;
|
|
33
|
+
grid: string;
|
|
34
|
+
/** Grid lines drawn at all. */
|
|
35
|
+
gridLines: boolean;
|
|
36
|
+
font: 'sans' | 'serif' | 'mono' | 'rounded';
|
|
37
|
+
/** Corner radius of bars, 0–8. */
|
|
38
|
+
radius: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const CHART_FONTS: Record<ChartStyle['font'], string> = {
|
|
42
|
+
sans: '-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC","Segoe UI",sans-serif',
|
|
43
|
+
serif: '"Noto Serif TC","Songti TC",Georgia,"Times New Roman",serif',
|
|
44
|
+
mono: '"SF Mono",Menlo,Consolas,"Noto Sans Mono CJK TC",monospace',
|
|
45
|
+
rounded: '"SF Pro Rounded","Hiragino Maru Gothic ProN","Arial Rounded MT Bold",-apple-system,sans-serif',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const BUILTIN_STYLES: ChartStyle[] = [
|
|
49
|
+
{ id: 'default', name: 'Default', colors: PALETTE, background: '#ffffff', text: '#1f1f1f', muted: '#5f6368', grid: '#e8eaed', gridLines: true, font: 'sans', radius: 2 },
|
|
50
|
+
{ id: 'ocean', name: 'Ocean', colors: ['#0b3c5d', '#1d7ab8', '#4fb0e0', '#8fd0ee', '#328cc1', '#17577e', '#a9d6e5', '#5c7f99'], background: '#ffffff', text: '#0b2233', muted: '#52687a', grid: '#e3edf3', gridLines: true, font: 'sans', radius: 3 },
|
|
51
|
+
{ id: 'warm', name: 'Warm', colors: ['#c2410c', '#ea8a2e', '#f2c14e', '#9a3412', '#d9775b', '#7c2d12', '#e7b98a', '#b45309'], background: '#fffaf3', text: '#3b2417', muted: '#8a6a55', grid: '#f1e4d3', gridLines: true, font: 'serif', radius: 0 },
|
|
52
|
+
{ id: 'pastel', name: 'Pastel', colors: ['#7aa6e8', '#f4a6a0', '#8fd3b6', '#f6cf7d', '#b9a4e6', '#86d0dc', '#f2b3d6', '#a9c18a'], background: '#ffffff', text: '#2e3440', muted: '#6b7280', grid: '#eef0f3', gridLines: true, font: 'rounded', radius: 6 },
|
|
53
|
+
{ id: 'mono', name: 'Mono', colors: ['#111111', '#555555', '#8c8c8c', '#bdbdbd', '#333333', '#707070', '#a6a6a6', '#d4d4d4'], background: '#ffffff', text: '#111111', muted: '#666666', grid: '#ebebeb', gridLines: false, font: 'mono', radius: 0 },
|
|
54
|
+
{ id: 'night', name: 'Night', colors: ['#7cc4ff', '#ffb86b', '#7ee2a8', '#ff7a90', '#c4a7ff', '#5ee0e0', '#ffd866', '#a0a8b8'], background: '#15181e', text: '#eef1f6', muted: '#9aa3b2', grid: '#2a2f39', gridLines: true, font: 'sans', radius: 2 },
|
|
55
|
+
];
|
|
56
|
+
export const DEFAULT_STYLE = BUILTIN_STYLES[0]!;
|
|
57
|
+
|
|
58
|
+
const HEX = /^#[0-9a-f]{6}$/i;
|
|
59
|
+
/** A style read from a file, every field checked; anything missing or wrong falls back to Default's. */
|
|
60
|
+
export function cleanStyle(v: unknown): ChartStyle | null {
|
|
61
|
+
if (!v || typeof v !== 'object') return null;
|
|
62
|
+
const o = v as Record<string, unknown>;
|
|
63
|
+
if (typeof o.id !== 'string' || !/^[a-z0-9][a-z0-9-]{0,40}$/.test(o.id)) return null;
|
|
64
|
+
const hex = (x: unknown, d: string) => (typeof x === 'string' && HEX.test(x) ? x.toLowerCase() : d);
|
|
65
|
+
const colors = Array.isArray(o.colors) ? o.colors.filter((c): c is string => typeof c === 'string' && HEX.test(c)).slice(0, 12) : [];
|
|
66
|
+
const d = DEFAULT_STYLE;
|
|
67
|
+
return {
|
|
68
|
+
id: o.id,
|
|
69
|
+
name: typeof o.name === 'string' && o.name.trim() ? o.name.trim().slice(0, 40) : o.id,
|
|
70
|
+
colors: colors.length ? colors.map((c) => c.toLowerCase()) : d.colors,
|
|
71
|
+
background: hex(o.background, d.background),
|
|
72
|
+
text: hex(o.text, d.text),
|
|
73
|
+
muted: hex(o.muted, d.muted),
|
|
74
|
+
grid: hex(o.grid, d.grid),
|
|
75
|
+
gridLines: o.gridLines !== false,
|
|
76
|
+
font: typeof o.font === 'string' && o.font in CHART_FONTS ? (o.font as ChartStyle['font']) : 'sans',
|
|
77
|
+
radius: typeof o.radius === 'number' && Number.isFinite(o.radius) ? Math.max(0, Math.min(8, Math.round(o.radius))) : d.radius,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The style a chart names, among the workspace's own and the built-in ones; Default when it is gone. */
|
|
82
|
+
export function findStyle(id: string | undefined, own: ChartStyle[] = []): ChartStyle {
|
|
83
|
+
return own.find((s) => s.id === id) ?? BUILTIN_STYLES.find((s) => s.id === id) ?? DEFAULT_STYLE;
|
|
84
|
+
}
|
|
85
|
+
|
|
18
86
|
const text = (v: Scalar) => (v === null ? '' : v instanceof CellError ? v.code : typeof v === 'number' ? formatValue(v, '').text : String(v));
|
|
19
87
|
|
|
20
88
|
/**
|
|
@@ -69,94 +137,248 @@ function tickFormat(ticks: number[]): (n: number) => string {
|
|
|
69
137
|
}
|
|
70
138
|
const esc = (s: string) => s.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"');
|
|
71
139
|
|
|
72
|
-
export function chartSvg(spec: ChartSpec, data: ChartData, w: number, h: number): string {
|
|
140
|
+
export function chartSvg(spec: ChartSpec, data: ChartData, w: number, h: number, style: ChartStyle = DEFAULT_STYLE): string {
|
|
141
|
+
const type = spec.type;
|
|
142
|
+
const round = type === 'pie' || type === 'doughnut';
|
|
143
|
+
const scatter = type === 'scatter';
|
|
144
|
+
// Scatter reads its first numeric column as x: the series are the rest.
|
|
145
|
+
const xs = scatter && data.series.length > 1 ? data.series[0]!.values : null;
|
|
146
|
+
const series = xs ? data.series.slice(1) : data.series;
|
|
73
147
|
const titleH = spec.title ? 26 : 8;
|
|
74
|
-
const legendH =
|
|
148
|
+
const legendH = series.length > 1 || round ? 22 : 0;
|
|
75
149
|
const title = spec.title ? `<text x="${w / 2}" y="18" text-anchor="middle" class="c-title">${esc(spec.title)}</text>` : '';
|
|
76
|
-
const
|
|
77
|
-
|
|
150
|
+
const svg = (body: string) => `<svg viewBox="0 0 ${w} ${h}" width="${w}" height="${h}">${title}${body}</svg>`;
|
|
151
|
+
const color = (i: number) => style.colors[i % style.colors.length]!;
|
|
152
|
+
const empty = !series.length || series.every((s) => s.values.every((v) => v === null));
|
|
153
|
+
if (empty) return svg(`<text x="${w / 2}" y="${h / 2}" text-anchor="middle" class="c-muted">—</text>`);
|
|
154
|
+
const tip = (name: string, cat: string, v: string) => `<title>${esc(name)}${cat ? ` · ${esc(cat)}` : ''}: ${esc(v)}</title>`;
|
|
78
155
|
|
|
79
|
-
if (
|
|
80
|
-
const s =
|
|
156
|
+
if (round) {
|
|
157
|
+
const s = series[0]!;
|
|
81
158
|
const items = s.values.map((v, i) => ({ v: Math.max(0, v ?? 0), name: data.categories[i] ?? '' })).filter((x) => x.v > 0);
|
|
82
159
|
const total = items.reduce((a, b) => a + b.v, 0);
|
|
83
160
|
const r = Math.max(10, Math.min(w, h - titleH - legendH) / 2 - 10);
|
|
161
|
+
const inner = type === 'doughnut' ? r * 0.58 : 0;
|
|
84
162
|
const cx = w / 2;
|
|
85
163
|
const cy = titleH + (h - titleH - legendH) / 2;
|
|
86
164
|
let angle = -Math.PI / 2;
|
|
165
|
+
const at = (rad: number, a: number) => `${cx + rad * Math.cos(a)},${cy + rad * Math.sin(a)}`;
|
|
87
166
|
const slices = items
|
|
88
167
|
.map((it, i) => {
|
|
89
168
|
const a = (it.v / total) * Math.PI * 2;
|
|
90
|
-
const
|
|
91
|
-
const y0 = cy + r * Math.sin(angle);
|
|
169
|
+
const a0 = angle;
|
|
92
170
|
angle += a;
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
171
|
+
const large = a > Math.PI ? 1 : 0;
|
|
172
|
+
let path: string;
|
|
173
|
+
if (items.length === 1) {
|
|
174
|
+
path = `M${cx - r},${cy}a${r},${r} 0 1,0 ${2 * r},0a${r},${r} 0 1,0 ${-2 * r},0` + (inner ? `M${cx - inner},${cy}a${inner},${inner} 0 1,1 ${2 * inner},0a${inner},${inner} 0 1,1 ${-2 * inner},0` : '');
|
|
175
|
+
} else if (inner) {
|
|
176
|
+
path = `M${at(r, a0)}A${r},${r} 0 ${large},1 ${at(r, angle)}L${at(inner, angle)}A${inner},${inner} 0 ${large},0 ${at(inner, a0)}Z`;
|
|
177
|
+
} else path = `M${cx},${cy}L${at(r, a0)}A${r},${r} 0 ${large},1 ${at(r, angle)}Z`;
|
|
178
|
+
return `<path d="${path}" fill="${color(i)}" fill-rule="evenodd" stroke="var(--sheet)" stroke-width="2">${tip(it.name, '', `${formatValue(it.v, '#,##0.##').text.replace(/\.$/, '')} (${Math.round((it.v / total) * 100)}%)`)}</path>`;
|
|
97
179
|
})
|
|
98
180
|
.join('');
|
|
99
|
-
|
|
181
|
+
const centre = inner ? `<text x="${cx}" y="${cy + 6}" text-anchor="middle" class="c-total">${esc(tickFormat([total])(total))}</text>` : '';
|
|
182
|
+
return svg(`${slices}${centre}${legend(items.map((it) => it.name), w, h, color)}`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const horizontal = type === 'barH';
|
|
186
|
+
const combo = type === 'combo' && series.length > 1;
|
|
187
|
+
const left = combo ? series.slice(0, 1) : series;
|
|
188
|
+
const right = combo ? series.slice(1) : [];
|
|
189
|
+
const n = data.categories.length;
|
|
190
|
+
const nums = (list: typeof series) => list.flatMap((s) => s.values.filter((v): v is number => v !== null));
|
|
191
|
+
// Stacked columns reach the sum of each category, above and below zero.
|
|
192
|
+
const stackExtent = () => {
|
|
193
|
+
let lo = 0;
|
|
194
|
+
let hi = 0;
|
|
195
|
+
for (let i = 0; i < n; i++) {
|
|
196
|
+
const pos = series.reduce((a, s) => a + Math.max(0, s.values[i] ?? 0), 0);
|
|
197
|
+
const neg = series.reduce((a, s) => a + Math.min(0, s.values[i] ?? 0), 0);
|
|
198
|
+
hi = Math.max(hi, pos);
|
|
199
|
+
lo = Math.min(lo, neg);
|
|
200
|
+
}
|
|
201
|
+
return [lo, hi];
|
|
202
|
+
};
|
|
203
|
+
const [vLo, vHi] = type === 'stacked' ? stackExtent() : [Math.min(0, ...nums(left)), Math.max(0, ...nums(left))];
|
|
204
|
+
const ticks = scatter ? niceTicks(Math.min(...nums(series)), Math.max(...nums(series))) : niceTicks(vLo!, vHi!);
|
|
205
|
+
const fmt = tickFormat(ticks);
|
|
206
|
+
const lo = ticks[0]!;
|
|
207
|
+
const hi = ticks[ticks.length - 1]!;
|
|
208
|
+
const ticks2 = combo ? niceTicks(Math.min(0, ...nums(right)), Math.max(0, ...nums(right))) : [];
|
|
209
|
+
const fmt2 = combo ? tickFormat(ticks2) : fmt;
|
|
210
|
+
|
|
211
|
+
// Horizontal bars: categories down the left, values along the bottom.
|
|
212
|
+
if (horizontal) {
|
|
213
|
+
const labelW = Math.min(140, Math.max(40, ...data.categories.map((c) => textWidth(c) + 10)));
|
|
214
|
+
const padL = labelW + 6;
|
|
215
|
+
const padR = 16;
|
|
216
|
+
const top = titleH + 6;
|
|
217
|
+
const bottom = h - legendH - 22;
|
|
218
|
+
const plotW = Math.max(10, w - padL - padR);
|
|
219
|
+
const band = (bottom - top) / Math.max(1, n);
|
|
220
|
+
const x = (v: number) => padL + ((v - lo) / (hi - lo)) * plotW;
|
|
221
|
+
const k = series.length;
|
|
222
|
+
const barH = Math.min(22, (band * 0.72) / k);
|
|
223
|
+
const grid = ticks.map((t) => `<line x1="${x(t)}" x2="${x(t)}" y1="${top}" y2="${bottom}" class="c-grid"/><text x="${x(t)}" y="${bottom + 15}" text-anchor="middle" class="c-tick">${esc(fmt(t))}</text>`).join('');
|
|
224
|
+
const labels = data.categories.map((c, i) => `<text x="${padL - 8}" y="${top + band * (i + 0.5) + 4}" text-anchor="end" class="c-tick">${esc(c.length > 16 ? `${c.slice(0, 15)}…` : c)}</text>`).join('');
|
|
225
|
+
let marks = '';
|
|
226
|
+
series.forEach((s, si) =>
|
|
227
|
+
s.values.forEach((v, i) => {
|
|
228
|
+
if (v === null) return;
|
|
229
|
+
const yy = top + band * i + band / 2 - (barH * k) / 2 + si * barH;
|
|
230
|
+
marks += `<rect x="${Math.min(x(0), x(v))}" y="${yy + 1}" width="${Math.max(1, Math.abs(x(v) - x(0)))}" height="${Math.max(1, barH - 2)}" rx="${style.radius}" fill="${color(si)}">${tip(s.name, data.categories[i] ?? '', fmt(v))}</rect>`;
|
|
231
|
+
}),
|
|
232
|
+
);
|
|
233
|
+
const axis = `<line x1="${x(0)}" x2="${x(0)}" y1="${top}" y2="${bottom}" class="c-axis"/>`;
|
|
234
|
+
return svg(`${grid}${axis}${marks}${labels}${legendH ? legend(series.map((s) => s.name), w, h, color) : ''}`);
|
|
100
235
|
}
|
|
101
236
|
|
|
102
|
-
const padL =
|
|
103
|
-
const padR =
|
|
237
|
+
const padL = 46;
|
|
238
|
+
const padR = combo ? 46 : 14;
|
|
104
239
|
const top = titleH + 4;
|
|
105
240
|
const bottom = h - legendH - 22;
|
|
106
241
|
const plotW = Math.max(10, w - padL - padR);
|
|
107
242
|
const plotH = Math.max(10, bottom - top);
|
|
108
|
-
const all = data.series.flatMap((s) => s.values.filter((v): v is number => v !== null));
|
|
109
|
-
const ticks = niceTicks(Math.min(0, ...all), Math.max(0, ...all));
|
|
110
|
-
const lo = ticks[0]!;
|
|
111
|
-
const hi = ticks[ticks.length - 1]!;
|
|
112
243
|
const y = (v: number) => bottom - ((v - lo) / (hi - lo)) * plotH;
|
|
113
|
-
const
|
|
114
|
-
const
|
|
244
|
+
const lo2 = ticks2[0] ?? 0;
|
|
245
|
+
const hi2 = ticks2[ticks2.length - 1] ?? 1;
|
|
246
|
+
const y2 = (v: number) => bottom - ((v - lo2) / (hi2 - lo2)) * plotH;
|
|
115
247
|
const band = plotW / Math.max(1, n);
|
|
116
248
|
const grid = ticks.map((t) => `<line x1="${padL}" x2="${w - padR}" y1="${y(t)}" y2="${y(t)}" class="c-grid"/><text x="${padL - 6}" y="${y(t) + 4}" text-anchor="end" class="c-tick">${esc(fmt(t))}</text>`).join('');
|
|
249
|
+
const rightAxis = combo ? ticks2.map((t) => `<text x="${w - padR + 6}" y="${y2(t) + 4}" class="c-tick">${esc(fmt2(t))}</text>`).join('') : '';
|
|
250
|
+
let marks = '';
|
|
251
|
+
let xLabels = '';
|
|
252
|
+
|
|
253
|
+
if (scatter) {
|
|
254
|
+
// x is the first column when it is numbers, else the row's position.
|
|
255
|
+
const xv = xs ?? data.categories.map((_, i) => i + 1);
|
|
256
|
+
const xn = xv.filter((v): v is number => v !== null);
|
|
257
|
+
const xt = niceTicks(Math.min(...xn), Math.max(...xn));
|
|
258
|
+
const xfmt = tickFormat(xt);
|
|
259
|
+
const xx = (v: number) => padL + ((v - xt[0]!) / (xt[xt.length - 1]! - xt[0]!)) * plotW;
|
|
260
|
+
xLabels = xt.map((t) => `<line x1="${xx(t)}" x2="${xx(t)}" y1="${top}" y2="${bottom}" class="c-grid"/><text x="${xx(t)}" y="${bottom + 15}" text-anchor="middle" class="c-tick">${esc(xfmt(t))}</text>`).join('');
|
|
261
|
+
series.forEach((s, si) =>
|
|
262
|
+
s.values.forEach((v, i) => {
|
|
263
|
+
const xi = xv[i];
|
|
264
|
+
if (v === null || xi === null || xi === undefined) return;
|
|
265
|
+
marks += `<circle cx="${xx(xi)}" cy="${y(v)}" r="4" fill="${color(si)}" fill-opacity="0.8">${tip(s.name, xfmt(xi), fmt(v))}</circle>`;
|
|
266
|
+
}),
|
|
267
|
+
);
|
|
268
|
+
return svg(`${grid}${xLabels}${marks}${legendH ? legend(series.map((s) => s.name), w, h, color) : ''}`);
|
|
269
|
+
}
|
|
270
|
+
|
|
117
271
|
const every = Math.max(1, Math.ceil((n * 48) / plotW));
|
|
118
|
-
|
|
272
|
+
xLabels = data.categories
|
|
119
273
|
.map((c, i) => (i % every ? '' : `<text x="${padL + band * (i + 0.5)}" y="${bottom + 15}" text-anchor="middle" class="c-tick">${esc(c.length > 10 ? `${c.slice(0, 9)}…` : c)}</text>`))
|
|
120
274
|
.join('');
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const k =
|
|
124
|
-
const barW = Math.min(
|
|
125
|
-
|
|
275
|
+
|
|
276
|
+
const columns = (list: typeof series, offset: number) => {
|
|
277
|
+
const k = list.length;
|
|
278
|
+
const barW = Math.min(28, (band * 0.72) / k);
|
|
279
|
+
list.forEach((s, si) =>
|
|
126
280
|
s.values.forEach((v, i) => {
|
|
127
281
|
if (v === null) return;
|
|
128
282
|
const x = padL + band * i + band / 2 - (barW * k) / 2 + si * barW;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const pts = s.values.map((v, i) => (v === null ? null : [padL + band * (i + 0.5),
|
|
283
|
+
marks += `<rect x="${x + 1}" y="${y(Math.max(0, v))}" width="${Math.max(1, barW - 2)}" height="${Math.max(1, Math.abs(y(v) - y(0)))}" rx="${style.radius}" fill="${color(si + offset)}">${tip(s.name, data.categories[i] ?? '', fmt(v))}</rect>`;
|
|
284
|
+
}),
|
|
285
|
+
);
|
|
286
|
+
};
|
|
287
|
+
const lines = (list: typeof series, offset: number, yy: (v: number) => number, f: (n: number) => string, fill: boolean) => {
|
|
288
|
+
list.forEach((s, si) => {
|
|
289
|
+
const c = color(si + offset);
|
|
290
|
+
const pts = s.values.map((v, i) => (v === null ? null : ([padL + band * (i + 0.5), yy(v)] as const)));
|
|
137
291
|
const d = pts.reduce((acc, p, i) => (p ? `${acc}${acc && pts[i - 1] ? 'L' : 'M'}${p[0]},${p[1]}` : acc), '');
|
|
138
|
-
|
|
292
|
+
if (fill) {
|
|
293
|
+
const run = pts.filter((p): p is readonly [number, number] => p !== null);
|
|
294
|
+
if (run.length) marks += `<path d="M${run[0]![0]},${yy(Math.max(lo, 0))}${run.map((p) => `L${p[0]},${p[1]}`).join('')}L${run[run.length - 1]![0]},${yy(Math.max(lo, 0))}Z" fill="${c}" fill-opacity="0.16"/>`;
|
|
295
|
+
}
|
|
296
|
+
marks += `<path d="${d}" fill="none" stroke="${c}" stroke-width="2" stroke-linejoin="round"/>`;
|
|
139
297
|
pts.forEach((p, i) => {
|
|
140
|
-
if (p) marks += `<circle cx="${p[0]}" cy="${p[1]}" r="3" fill="${
|
|
298
|
+
if (p) marks += `<circle cx="${p[0]}" cy="${p[1]}" r="3" fill="${c}">${tip(s.name, data.categories[i] ?? '', f(s.values[i]!))}</circle>`;
|
|
141
299
|
});
|
|
142
300
|
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
if (type === 'bar') columns(series, 0);
|
|
304
|
+
else if (type === 'stacked') {
|
|
305
|
+
const k = 1;
|
|
306
|
+
const barW = Math.min(36, band * 0.62 * k);
|
|
307
|
+
for (let i = 0; i < n; i++) {
|
|
308
|
+
let pos = 0;
|
|
309
|
+
let neg = 0;
|
|
310
|
+
series.forEach((s, si) => {
|
|
311
|
+
const v = s.values[i];
|
|
312
|
+
if (v === null || v === undefined || v === 0) return;
|
|
313
|
+
const from = v > 0 ? pos : neg;
|
|
314
|
+
const to = from + v;
|
|
315
|
+
if (v > 0) pos = to;
|
|
316
|
+
else neg = to;
|
|
317
|
+
const x = padL + band * (i + 0.5) - barW / 2;
|
|
318
|
+
marks += `<rect x="${x}" y="${Math.min(y(from), y(to))}" width="${barW}" height="${Math.max(1, Math.abs(y(to) - y(from)))}" fill="${color(si)}">${tip(s.name, data.categories[i] ?? '', fmt(v))}</rect>`;
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
} else if (type === 'combo') {
|
|
322
|
+
columns(left, 0);
|
|
323
|
+
lines(right, 1, combo ? y2 : y, fmt2, false);
|
|
324
|
+
} else lines(series, 0, y, fmt, type === 'area');
|
|
325
|
+
|
|
326
|
+
const zero = `<line x1="${padL}" x2="${w - padR}" y1="${y(Math.max(lo, Math.min(0, hi)))}" y2="${y(Math.max(lo, Math.min(0, hi)))}" class="c-axis"/>`;
|
|
327
|
+
return svg(`${grid}${rightAxis}${zero}${marks}${xLabels}${legendH ? legend(series.map((s) => s.name), w, h, color) : ''}`);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** Wide (CJK) characters take about twice the room of Latin ones at 11px. */
|
|
331
|
+
function textWidth(n: string): number {
|
|
332
|
+
return [...n.slice(0, 16)].reduce((w, ch) => w + (/[ᄀ-ᇿ⺀-가-豈--]/.test(ch) ? 11.5 : 6.5), 0);
|
|
146
333
|
}
|
|
147
334
|
|
|
148
|
-
function legend(names: string[], w: number, h: number): string {
|
|
335
|
+
function legend(names: string[], w: number, h: number, color: (i: number) => string): string {
|
|
149
336
|
const items = names.slice(0, 8);
|
|
150
|
-
// Wide (CJK) characters take about twice the room of Latin ones at 11px.
|
|
151
|
-
const textWidth = (n: string) => [...n.slice(0, 14)].reduce((w, ch) => w + (/[\u1100-\u11ff\u2e80-\ua4cf\uac00-\ud7af\uf900-\ufaff\uff00-\uffef]/.test(ch) ? 11.5 : 6.5), 0);
|
|
152
337
|
const widths = items.map((n) => 26 + textWidth(n));
|
|
153
338
|
const total = widths.reduce((a, b) => a + b, 0);
|
|
154
339
|
let x = Math.max(4, (w - total) / 2);
|
|
155
340
|
return items
|
|
156
341
|
.map((name, i) => {
|
|
157
|
-
const out = `<rect x="${x}" y="${h - 15}" width="9" height="9" rx="2" fill="${
|
|
342
|
+
const out = `<rect x="${x}" y="${h - 15}" width="9" height="9" rx="2" fill="${color(i)}"/><text x="${x + 13}" y="${h - 7}" class="c-tick">${esc(name.length > 14 ? `${name.slice(0, 13)}…` : name)}</text>`;
|
|
158
343
|
x += widths[i]!;
|
|
159
344
|
return out;
|
|
160
345
|
})
|
|
161
346
|
.join('');
|
|
162
347
|
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* A chart as a file of its own — for the Assets folder, a note or another
|
|
351
|
+
* program: the SVG with its namespace, a white background and the colours the
|
|
352
|
+
* page would give it written in, since no stylesheet comes with it.
|
|
353
|
+
*/
|
|
354
|
+
export interface ChartSource {
|
|
355
|
+
sheet: string;
|
|
356
|
+
range: string;
|
|
357
|
+
type: ChartSpec['type'];
|
|
358
|
+
title?: string;
|
|
359
|
+
/** A chart style's id; Default when absent. */
|
|
360
|
+
style?: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** Where a chart file was drawn from, read back from its <metadata>; null for any other SVG. */
|
|
364
|
+
export function chartSourceOf(svg: string): ChartSource | null {
|
|
365
|
+
const m = /<metadata id="open-spreadsheet-chart">([^<]*)<\/metadata>/.exec(svg);
|
|
366
|
+
if (!m) return null;
|
|
367
|
+
try {
|
|
368
|
+
const v = JSON.parse(m[1]!.replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll('&', '&')) as ChartSource;
|
|
369
|
+
return typeof v.sheet === 'string' && typeof v.range === 'string' && CHART_TYPES.includes(v.type) ? v : null;
|
|
370
|
+
} catch {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function chartFile(spec: ChartSpec, data: ChartData, w = 720, h = 405, source?: ChartSource, look: ChartStyle = DEFAULT_STYLE): string {
|
|
376
|
+
const css =
|
|
377
|
+
`<style>text{font-family:${CHART_FONTS[look.font]}}` +
|
|
378
|
+
`.c-title{font-weight:600;font-size:13px;fill:${look.text}}.c-tick{font-size:11px;fill:${look.muted}}.c-muted{font-size:14px;fill:${look.muted}}` +
|
|
379
|
+
`.c-grid{stroke:${look.gridLines ? look.grid : 'none'};stroke-width:1}.c-axis{stroke:${look.muted};stroke-opacity:.6;stroke-width:1}.c-total{font-weight:650;font-size:22px;fill:${look.text}}</style>`;
|
|
380
|
+
return chartSvg(spec, data, w, h, look)
|
|
381
|
+
.replace(/^<svg /, '<svg xmlns="http://www.w3.org/2000/svg" ')
|
|
382
|
+
.replace('>', `>${source ? `<metadata id="open-spreadsheet-chart">${esc(JSON.stringify(source))}</metadata>` : ''}${css}<rect width="100%" height="100%" fill="${look.background}"/>`)
|
|
383
|
+
.replaceAll('var(--sheet)', look.background);
|
|
384
|
+
}
|
package/app/i18n-more.ts
CHANGED
|
@@ -216,6 +216,82 @@ export const zhCN: Dict = {
|
|
|
216
216
|
protectedOn: (r: string) => `已保护 ${r}:取消保护前不能修改。`,
|
|
217
217
|
protectedOff: '已取消保护。',
|
|
218
218
|
protectedRefused: '这个区域受保护。请先取消保护(右键 → 取消保护)。',
|
|
219
|
+
assets: 'Assets',
|
|
220
|
+
assetsHint: '这个工作簿的图表图片与上传的图片;图表从“表格”的工具栏创建。',
|
|
221
|
+
assetsThisBook: '这个工作簿',
|
|
222
|
+
assetsShared: '共享',
|
|
223
|
+
newChartImage: '图表图片',
|
|
224
|
+
newNote: '新建笔记',
|
|
225
|
+
uploadImage: '上传图片',
|
|
226
|
+
noAssets: '还没有内容。',
|
|
227
|
+
saveIn: '保存在',
|
|
228
|
+
noteContextHint: 'Markdown 格式。Agent 处理这个工作簿前会先读这些笔记:数字的含义、来源、要遵守的规则。',
|
|
229
|
+
deleteAssetTitle: (n: string) => `删除“${n}”?`,
|
|
230
|
+
deleteAssetBody: '会移到 assets 的 .trash 文件夹。',
|
|
231
|
+
chartSaved: (n: string) => `已保存到素材:${n}`,
|
|
232
|
+
chartsMoved: (k: number) => `已把 ${k} 个图表移到素材`,
|
|
233
|
+
chartsOnGrid: (k: number) => `单元格上有 ${k} 个图表`,
|
|
234
|
+
moveChartsToAssets: '移到素材',
|
|
235
|
+
close: '关闭',
|
|
236
|
+
viewSheet: '表格',
|
|
237
|
+
viewAssets: '素材',
|
|
238
|
+
viewNotes: '笔记',
|
|
239
|
+
notesTitle: '这个工作簿的笔记',
|
|
240
|
+
noImagesYet: '还没有图片。在“表格”选好数据,点工具栏的图表按钮。',
|
|
241
|
+
noNotesYet: '还没有笔记',
|
|
242
|
+
newChart: '新建图表',
|
|
243
|
+
editChart: '编辑图表',
|
|
244
|
+
chartType: '类型',
|
|
245
|
+
sheetLabel: '工作表',
|
|
246
|
+
rangeLabel: '区域',
|
|
247
|
+
noAssetsYet: '还没有素材',
|
|
248
|
+
notePlaceholder: '开始写,输入 # 变标题、- 变列表…',
|
|
249
|
+
markdownSource: 'Markdown 源码',
|
|
250
|
+
chartBarH: '条形图',
|
|
251
|
+
chartStacked: '堆积柱形图',
|
|
252
|
+
chartArea: '面积图',
|
|
253
|
+
chartDoughnut: '圆环图',
|
|
254
|
+
chartScatter: '散点图',
|
|
255
|
+
chartCombo: '组合图',
|
|
256
|
+
notesRecent: '最近',
|
|
257
|
+
notesFavorites: '收藏',
|
|
258
|
+
notesAll: '全部',
|
|
259
|
+
searchNotes: '搜索笔记',
|
|
260
|
+
favorite: '加入收藏',
|
|
261
|
+
unfavorite: '取消收藏',
|
|
262
|
+
noFavorites: '还没有收藏的笔记',
|
|
263
|
+
noMatches: '找不到匹配的项目',
|
|
264
|
+
justNow: '刚刚',
|
|
265
|
+
minutesAgo: (n: number) => `${n} 分钟前`,
|
|
266
|
+
hoursAgo: (n: number) => `${n} 小时前`,
|
|
267
|
+
home: '首页',
|
|
268
|
+
searchAssets: '搜索素材',
|
|
269
|
+
chartStyles: '图表样式',
|
|
270
|
+
newStyle: '新建样式',
|
|
271
|
+
styleLabel: '样式',
|
|
272
|
+
defaultBadge: '默认',
|
|
273
|
+
makeDefault: '设为默认',
|
|
274
|
+
builtIn: '内置',
|
|
275
|
+
duplicateEdit: '复制后编辑',
|
|
276
|
+
styleColors: '系列颜色',
|
|
277
|
+
styleColorsMore: '其他颜色',
|
|
278
|
+
styleBackground: '背景',
|
|
279
|
+
styleText: '标题',
|
|
280
|
+
styleMuted: '标签',
|
|
281
|
+
styleGrid: '网格',
|
|
282
|
+
styleFont: '字体',
|
|
283
|
+
styleCorners: '柱形圆角',
|
|
284
|
+
styleGridLines: '显示网格线',
|
|
285
|
+
fontSans: '黑体',
|
|
286
|
+
fontSerif: '宋体',
|
|
287
|
+
fontMono: '等宽',
|
|
288
|
+
fontRounded: '圆体',
|
|
289
|
+
addColor: '添加颜色',
|
|
290
|
+
removeColor: '移除最后一个颜色',
|
|
291
|
+
noFavoriteAssets: '还没有收藏的素材',
|
|
292
|
+
followDefault: (n: string) => `跟随默认(${n})`,
|
|
293
|
+
builtinStyle: (id: string) => (({ default: '标准', ocean: '海洋', warm: '暖阳', pastel: '柔和', mono: '黑白', night: '夜间' }) as Record<string, string>)[id] ?? id,
|
|
294
|
+
insertAsset: '插入素材',
|
|
219
295
|
fontSize: '字号',
|
|
220
296
|
fontSizeOther: '其他字号…',
|
|
221
297
|
customSort: '自定义排序…',
|
|
@@ -484,6 +560,82 @@ export const ja: Dict = {
|
|
|
484
560
|
protectedOn: (r: string) => `${r} を保護しました。解除するまで変更できません。`,
|
|
485
561
|
protectedOff: '保護を解除しました。',
|
|
486
562
|
protectedRefused: 'この範囲は保護されています。先に保護を解除してください(右クリック → 範囲の保護を解除)。',
|
|
563
|
+
assets: 'Assets',
|
|
564
|
+
assetsHint: 'このブックのグラフ画像とアップロードした画像。グラフはシートのツールバーから作成します。',
|
|
565
|
+
assetsThisBook: 'このブック',
|
|
566
|
+
assetsShared: '共有',
|
|
567
|
+
newChartImage: 'グラフ画像',
|
|
568
|
+
close: '閉じる',
|
|
569
|
+
newNote: '新しいメモ',
|
|
570
|
+
uploadImage: '画像をアップロード',
|
|
571
|
+
noAssets: 'まだありません。',
|
|
572
|
+
saveIn: '保存先',
|
|
573
|
+
noteContextHint: 'Markdown。エージェントはブックを扱う前にこれらのメモを読みます:数字の意味、出典、守るべきルール。',
|
|
574
|
+
deleteAssetTitle: (n: string) => `「${n}」を削除しますか?`,
|
|
575
|
+
deleteAssetBody: 'assets の .trash フォルダーに移動します。',
|
|
576
|
+
chartSaved: (n: string) => `アセットに保存しました:${n}`,
|
|
577
|
+
chartsMoved: (k: number) => `${k} 個のグラフをアセットに移動しました`,
|
|
578
|
+
chartsOnGrid: (k: number) => `セル上に ${k} 個のグラフがあります`,
|
|
579
|
+
moveChartsToAssets: 'アセットへ移動',
|
|
580
|
+
viewSheet: 'シート',
|
|
581
|
+
viewAssets: 'アセット',
|
|
582
|
+
viewNotes: 'ノート',
|
|
583
|
+
notesTitle: 'このブックのノート',
|
|
584
|
+
noImagesYet: '画像はまだありません。シートでデータを選び、ツールバーのグラフボタンを押してください。',
|
|
585
|
+
noNotesYet: 'ノートはまだありません',
|
|
586
|
+
newChart: '新しいグラフ',
|
|
587
|
+
editChart: 'グラフを編集',
|
|
588
|
+
chartType: '種類',
|
|
589
|
+
sheetLabel: 'シート',
|
|
590
|
+
rangeLabel: '範囲',
|
|
591
|
+
noAssetsYet: 'アセットはまだありません',
|
|
592
|
+
notePlaceholder: '書き始めましょう。# で見出し、- でリスト…',
|
|
593
|
+
markdownSource: 'Markdown ソース',
|
|
594
|
+
chartBarH: '横棒グラフ',
|
|
595
|
+
chartStacked: '積み上げ縦棒',
|
|
596
|
+
chartArea: '面グラフ',
|
|
597
|
+
chartDoughnut: 'ドーナツ',
|
|
598
|
+
chartScatter: '散布図',
|
|
599
|
+
chartCombo: '複合グラフ',
|
|
600
|
+
notesRecent: '最近',
|
|
601
|
+
notesFavorites: 'お気に入り',
|
|
602
|
+
notesAll: 'すべて',
|
|
603
|
+
searchNotes: 'ノートを検索',
|
|
604
|
+
favorite: 'お気に入りに追加',
|
|
605
|
+
unfavorite: 'お気に入りから削除',
|
|
606
|
+
noFavorites: 'お気に入りのノートはまだありません',
|
|
607
|
+
noMatches: '一致する項目はありません',
|
|
608
|
+
justNow: 'たった今',
|
|
609
|
+
minutesAgo: (n: number) => `${n} 分前`,
|
|
610
|
+
hoursAgo: (n: number) => `${n} 時間前`,
|
|
611
|
+
home: 'ホーム',
|
|
612
|
+
searchAssets: '素材を検索',
|
|
613
|
+
chartStyles: 'グラフのスタイル',
|
|
614
|
+
newStyle: '新しいスタイル',
|
|
615
|
+
styleLabel: 'スタイル',
|
|
616
|
+
defaultBadge: '既定',
|
|
617
|
+
makeDefault: '既定にする',
|
|
618
|
+
builtIn: '組み込み',
|
|
619
|
+
duplicateEdit: '複製して編集',
|
|
620
|
+
styleColors: '系列の色',
|
|
621
|
+
styleColorsMore: 'その他の色',
|
|
622
|
+
styleBackground: '背景',
|
|
623
|
+
styleText: 'タイトル',
|
|
624
|
+
styleMuted: 'ラベル',
|
|
625
|
+
styleGrid: '目盛線',
|
|
626
|
+
styleFont: 'フォント',
|
|
627
|
+
styleCorners: '棒の角丸',
|
|
628
|
+
styleGridLines: '目盛線を表示',
|
|
629
|
+
fontSans: 'ゴシック',
|
|
630
|
+
fontSerif: '明朝',
|
|
631
|
+
fontMono: '等幅',
|
|
632
|
+
fontRounded: '丸ゴシック',
|
|
633
|
+
addColor: '色を追加',
|
|
634
|
+
removeColor: '最後の色を削除',
|
|
635
|
+
noFavoriteAssets: 'お気に入りの素材はまだありません',
|
|
636
|
+
followDefault: (n: string) => `既定に従う(${n})`,
|
|
637
|
+
builtinStyle: (id: string) => (({ default: '標準', ocean: 'オーシャン', warm: 'ウォーム', pastel: 'パステル', mono: 'モノクロ', night: 'ナイト' }) as Record<string, string>)[id] ?? id,
|
|
638
|
+
insertAsset: '素材を挿入',
|
|
487
639
|
fontSize: 'フォント サイズ',
|
|
488
640
|
fontSizeOther: 'その他のサイズ…',
|
|
489
641
|
customSort: 'ユーザー設定の並べ替え…',
|
|
@@ -519,7 +671,7 @@ export const ja: Dict = {
|
|
|
519
671
|
splitDone: (n) => `${n} 個のセルを分割しました`,
|
|
520
672
|
pasteTranspose: '行列を入れ替えて貼り付け',
|
|
521
673
|
insertChart: 'グラフを挿入',
|
|
522
|
-
chartBar: '
|
|
674
|
+
chartBar: '縦棒グラフ',
|
|
523
675
|
chartLine: '折れ線グラフ',
|
|
524
676
|
chartPie: '円グラフ',
|
|
525
677
|
chartTitle: 'グラフタイトル…',
|
|
@@ -752,6 +904,82 @@ export const ko: Dict = {
|
|
|
752
904
|
protectedOn: (r: string) => `${r}을(를) 보호했습니다. 해제하기 전에는 변경할 수 없습니다.`,
|
|
753
905
|
protectedOff: '보호를 해제했습니다.',
|
|
754
906
|
protectedRefused: '이 범위는 보호되어 있습니다. 먼저 보호를 해제하세요(오른쪽 클릭 → 범위 보호 해제).',
|
|
907
|
+
assets: 'Assets',
|
|
908
|
+
assetsHint: '이 통합 문서의 차트 이미지와 업로드한 이미지입니다. 차트는 시트의 도구 모음에서 만듭니다.',
|
|
909
|
+
assetsThisBook: '이 통합 문서',
|
|
910
|
+
assetsShared: '공유',
|
|
911
|
+
newChartImage: '차트 이미지',
|
|
912
|
+
close: '닫기',
|
|
913
|
+
newNote: '새 메모',
|
|
914
|
+
uploadImage: '이미지 업로드',
|
|
915
|
+
noAssets: '아직 없습니다.',
|
|
916
|
+
saveIn: '저장 위치',
|
|
917
|
+
noteContextHint: 'Markdown 형식입니다. 에이전트는 통합 문서를 다루기 전에 이 메모를 읽습니다: 숫자의 의미, 출처, 지킬 규칙.',
|
|
918
|
+
deleteAssetTitle: (n: string) => `“${n}”을(를) 삭제할까요?`,
|
|
919
|
+
deleteAssetBody: 'assets의 .trash 폴더로 이동합니다.',
|
|
920
|
+
chartSaved: (n: string) => `에셋에 저장했습니다: ${n}`,
|
|
921
|
+
chartsMoved: (k: number) => `차트 ${k}개를 에셋으로 옮겼습니다`,
|
|
922
|
+
chartsOnGrid: (k: number) => `셀 위에 차트가 ${k}개 있습니다`,
|
|
923
|
+
moveChartsToAssets: '에셋으로 이동',
|
|
924
|
+
viewSheet: '시트',
|
|
925
|
+
viewAssets: '에셋',
|
|
926
|
+
viewNotes: '노트',
|
|
927
|
+
notesTitle: '이 통합 문서의 노트',
|
|
928
|
+
noImagesYet: '아직 이미지가 없습니다. 시트에서 데이터를 선택하고 도구 모음의 차트 버튼을 누르세요.',
|
|
929
|
+
noNotesYet: '아직 노트가 없습니다',
|
|
930
|
+
newChart: '새 차트',
|
|
931
|
+
editChart: '차트 편집',
|
|
932
|
+
chartType: '종류',
|
|
933
|
+
sheetLabel: '시트',
|
|
934
|
+
rangeLabel: '범위',
|
|
935
|
+
noAssetsYet: '아직 에셋이 없습니다',
|
|
936
|
+
notePlaceholder: '작성을 시작하세요. #은 제목, -는 목록…',
|
|
937
|
+
markdownSource: 'Markdown 원본',
|
|
938
|
+
chartBarH: '가로 막대형',
|
|
939
|
+
chartStacked: '누적 세로 막대형',
|
|
940
|
+
chartArea: '영역형',
|
|
941
|
+
chartDoughnut: '도넛형',
|
|
942
|
+
chartScatter: '분산형',
|
|
943
|
+
chartCombo: '콤보',
|
|
944
|
+
notesRecent: '최근',
|
|
945
|
+
notesFavorites: '즐겨찾기',
|
|
946
|
+
notesAll: '전체',
|
|
947
|
+
searchNotes: '노트 검색',
|
|
948
|
+
favorite: '즐겨찾기에 추가',
|
|
949
|
+
unfavorite: '즐겨찾기에서 제거',
|
|
950
|
+
noFavorites: '즐겨찾기한 노트가 없습니다',
|
|
951
|
+
noMatches: '일치하는 항목이 없습니다',
|
|
952
|
+
justNow: '방금',
|
|
953
|
+
minutesAgo: (n: number) => `${n}분 전`,
|
|
954
|
+
hoursAgo: (n: number) => `${n}시간 전`,
|
|
955
|
+
home: '홈',
|
|
956
|
+
searchAssets: '소재 검색',
|
|
957
|
+
chartStyles: '차트 스타일',
|
|
958
|
+
newStyle: '새 스타일',
|
|
959
|
+
styleLabel: '스타일',
|
|
960
|
+
defaultBadge: '기본값',
|
|
961
|
+
makeDefault: '기본값으로 설정',
|
|
962
|
+
builtIn: '기본 제공',
|
|
963
|
+
duplicateEdit: '복제해서 편집',
|
|
964
|
+
styleColors: '계열 색',
|
|
965
|
+
styleColorsMore: '기타 색',
|
|
966
|
+
styleBackground: '배경',
|
|
967
|
+
styleText: '제목',
|
|
968
|
+
styleMuted: '레이블',
|
|
969
|
+
styleGrid: '눈금선',
|
|
970
|
+
styleFont: '글꼴',
|
|
971
|
+
styleCorners: '막대 모서리',
|
|
972
|
+
styleGridLines: '눈금선 표시',
|
|
973
|
+
fontSans: '고딕',
|
|
974
|
+
fontSerif: '명조',
|
|
975
|
+
fontMono: '고정폭',
|
|
976
|
+
fontRounded: '둥근 고딕',
|
|
977
|
+
addColor: '색 추가',
|
|
978
|
+
removeColor: '마지막 색 제거',
|
|
979
|
+
noFavoriteAssets: '즐겨찾기한 소재가 없습니다',
|
|
980
|
+
followDefault: (n: string) => `기본값 따르기 (${n})`,
|
|
981
|
+
builtinStyle: (id: string) => (({ default: '표준', ocean: '오션', warm: '웜', pastel: '파스텔', mono: '모노', night: '나이트' }) as Record<string, string>)[id] ?? id,
|
|
982
|
+
insertAsset: '소재 삽입',
|
|
755
983
|
fontSize: '글꼴 크기',
|
|
756
984
|
fontSizeOther: '다른 크기…',
|
|
757
985
|
customSort: '사용자 지정 정렬…',
|
|
@@ -787,7 +1015,7 @@ export const ko: Dict = {
|
|
|
787
1015
|
splitDone: (n) => `셀 ${n}개를 나눴습니다`,
|
|
788
1016
|
pasteTranspose: '행/열 바꿔 붙여넣기',
|
|
789
1017
|
insertChart: '차트 삽입',
|
|
790
|
-
chartBar: '막대형
|
|
1018
|
+
chartBar: '세로 막대형',
|
|
791
1019
|
chartLine: '꺾은선형 차트',
|
|
792
1020
|
chartPie: '원형 차트',
|
|
793
1021
|
chartTitle: '차트 제목…',
|