Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

dash: pivot field editor and chart editor; pivots open from their tab (#815)

nyblnet90741d6b539e
diff --git a/.github/actions/validate-dash/action.yml b/.github/actions/validate-dash/action.yml
index b4579b8d..0d151266 100644
--- a/.github/actions/validate-dash/action.yml
+++ b/.github/actions/validate-dash/action.yml
@@ -704,3 +704,18 @@ runs:
# bar's entered form, and malformed formulas refused at entry.
shell: bento-step {0}
run: node scripts/test-dash-entryparse.ts
+
+ - name: bento/dash pivot field editor
+ # The editor's spec operations (a grouping field in one area, values
+ # never the same column and function twice, inputs never mutated) and
+ # pivots computed over configured fields — sum, average, distinct, min,
+ # max — with the pivot's own filters through a JSON round trip.
+ shell: bento-step {0}
+ run: node scripts/test-dash-pivotfields.ts
+
+ - name: bento/dash chart from the selection
+ # The selected columns are the series; a line through categories with
+ # no order is refused unless asked; the axis wears the column's format;
+ # series colours follow the column, not the position.
+ shell: bento-step {0}
+ run: node scripts/test-dash-chartbind.ts
diff --git a/.github/workflows/ci-dash.yml b/.github/workflows/ci-dash.yml
index 85f79fe7..12b0dc34 100644
--- a/.github/workflows/ci-dash.yml
+++ b/.github/workflows/ci-dash.yml
@@ -46,6 +46,13 @@ jobs:
run: |
npm ci --prefix dash
npm run build:single --prefix dash
+ - name: The pivot and chart tools finish what they start
+ # The pivot opens from its tab with a field editor (drag and pick),
+ # distinct counts and filters compute and survive a save; the Grand
+ # total is reachable; the chart is of the selection, refuses a line
+ # through Region unless asked, puts £ on its axis and undoes its title;
+ # 3D sits behind a dev flag; the filter checklist shows £4,300.
+ run: node scripts/test-dash-pivotchart-browser.mjs
- name: Every dash field wears the suite's one field look
# Slides' rig, ported: every text field, select and textarea on 17
# surfaces, light and dark, has the 1px --line border, --field fill,
diff --git a/dash/CHANGELOG.md b/dash/CHANGELOG.md
index b3ee1713..9e86df0b 100644
--- a/dash/CHANGELOG.md
+++ b/dash/CHANGELOG.md
@@ -12,6 +12,26 @@ There is no server, so a break here would be permanent.
The release that came out of watching somebody use 0.2.0.
+- **Pivot tables have a field editor, and open like any sheet.** Click a
+ pivot's tab and it shows where the grid was, with its fields in the
+ properties panel: drag a column (or pick it) into Rows, Columns, Values or
+ Filters, choose Sum, Average, Count, Min, Max, Median or Distinct for each
+ value, tick which values a filter keeps, and switch subtotals, grand totals
+ and (blank) groups. Values print in their column's format, so money stays
+ £. The pivot tab used to say "open it from + Pivot" and the Grand total
+ column was cut off at the edge of a side panel.
+- **Chart charts what you selected, and has an editor.** Select the columns
+ first: the numbers become the series and the first text column the
+ categories (it used to chart the first three numeric columns whatever was
+ selected). Click the chart, or its Edit button, and the properties panel
+ edits it: type, title, categories, how rows are summed, legend, and a series
+ list with a colour each. The value axis wears the column's format (£, %).
+ A line through categories with no order (Region) is drawn as bars and says
+ why; "Draw a line anyway" draws it.
+- **3D is off the toolbar.** It is a developer tool for now; a story step that
+ already holds a 3D view still plays it.
+- **The column filter lists values the way the column shows them** — £4,300,
+ not 4300 — and a search for "4,300" finds it.
- **Typing into a spreadsheet cell reads what you meant, and sums add up.**
`15%` is stored as 0.15 and shown as 15%; `$5`, `£1,234` and `€3,50` are
numbers that keep their currency symbol; `(5)` is −5; `2026-03-04` and
@@ -293,7 +313,8 @@ The release that came out of watching somebody use 0.2.0.
a dataset's per-cell formulas, where a sorted view still refers to the right
row.
-- **Escape closes the Story and Pivot panels.**
+- **Escape closes the Story panel.** A pivot is a sheet now, so Escape does
+ not leave it — its tab strip does, as in Excel.
## [0.2.0] — 2026-08-03
diff --git a/dash/src/chart.ts b/dash/src/chart.ts
index 6b0d7581..516baa0b 100644
--- a/dash/src/chart.ts
+++ b/dash/src/chart.ts
@@ -45,6 +45,7 @@ import { CHART_PRESETS, mountChart, type ChartLike } from '../../kernel/src/char
import type { TableSheet } from './model.ts'
import { isErr } from './formula.ts'
import { readCell } from './store.ts'
+import { readPattern } from './format.ts'
import { t } from './i18n.ts'
export interface ChartBinding {
@@ -55,6 +56,107 @@ export interface ChartBinding {
kind: 'bar' | 'line' | 'pie' | 'scatter'
/** group rows by the x value and total the series, rather than one bar per row */
aggregate?: 'sum' | 'avg' | 'count' | 'none'
+ // ADDITIVE, all of them: a binding without these is the chart every earlier
+ // build drew, and an earlier build reading one with them ignores them.
+ /** the chart's title; absent = the generated "Region · Value" heading */
+ title?: string
+ /** show the legend; absent = only when there is more than one series */
+ legend?: boolean
+ /** a colour per series, by column id; absent = the palette, in order */
+ colors?: Record<string, string>
+ /**
+ * The author ASKED for a line through categories that have no order. Absent,
+ * a line over a text axis is refused and drawn as bars (see `lineRefused`).
+ */
+ allowLine?: boolean
+ [extra: string]: unknown
+}
+
+type ColLike = { id: string; type?: string; format?: string; name?: string }
+
+const MEASURE = new Set(['number', 'money', 'percent'])
+const CATEGORY = new Set(['text', 'enum'])
+
+/**
+ * Does this column put its values IN ORDER?
+ *
+ * A line is a claim that the space between two points means something — that
+ * March comes after February and a value between them would sit between them.
+ * Dates and numbers make that claim honestly. Regions do not: North, South, East
+ * in first-seen order is an accident of the data, and a line from North down to
+ * South "trends" between two things that are not on a scale at all. Measured in
+ * the review: the type toggle drew exactly that line, through Region.
+ */
+export const isOrdered = (c: Pick<ColLike, 'type'> | undefined): boolean =>
+ !!c && (c.type === 'date' || MEASURE.has(c.type ?? ''))
+
+/**
+ * A line the chart will NOT draw: kind is line, the category column has no
+ * order, and the author did not say "draw it anyway". Drawn as bars instead,
+ * and the panel says so with a button that sets `allowLine`.
+ */
+export function lineRefused(sheet: TableSheet, bind: ChartBinding): boolean {
+ if (bind.kind !== 'line' || bind.allowLine) return false
+ return !isOrdered(sheet.columns.find((c) => c.id === bind.x))
+}
+
+/**
+ * A binding from what the reader SELECTED — what "Chart the selected columns"
+ * has always promised and, until this, never did (it charted the first three
+ * numeric columns whatever was selected: the review selected Value and got
+ * Value, Weighted and Computed).
+ *
+ * `selected` is the column ids under the selection, in sheet order. Its
+ * measures become the series; its first text column becomes the categories, or
+ * — when the selection holds none, the usual case of "select the numbers" — the
+ * sheet's first text column does. A selection with no measure in it at all asks
+ * for nothing chartable, so the sheet's default stands in rather than an empty
+ * axis.
+ */
+export function bindingFromSelection(sheet: TableSheet, selected: readonly string[]): ChartBinding | null {
+ const cols = selected
+ .map((id) => sheet.columns.find((c) => c.id === id))
+ .filter((c): c is TableSheet['columns'][number] => !!c)
+ const series = cols.filter((c) => MEASURE.has(c.type)).map((c) => c.id)
+ if (!series.length) return defaultBinding(sheet)
+ const cat = cols.find((c) => CATEGORY.has(c.type)) ??
+ sheet.columns.find((c) => CATEGORY.has(c.type))
+ const x = cat?.id ?? cols.find((c) => !series.includes(c.id))?.id ??
+ sheet.columns.find((c) => !series.includes(c.id))?.id ?? series[0]
+ // Grouping by a category is the chart people mean ("Value by Region"); with
+ // no category there is nothing to group by, and every row is its own point.
+ return { x, series, kind: 'bar', aggregate: cat ? 'sum' : 'none' }
+}
+
+/**
+ * The value axis's label pattern, from the columns being charted — so a money
+ * column's axis reads £20,000 and not 20,000, and a percent column's reads 40%
+ * and not 0.4.
+ *
+ * ONLY WHEN EVERY SERIES AGREES. Pounds and percentages on one axis share no
+ * unit, and labelling that axis "£" would put a currency sign on a probability.
+ * Mixed series get the bare numbers, which are at least not wrong.
+ *
+ * `scale` is 100 for a percent axis: percent columns store the FRACTION
+ * (import.ts:281), and charts-lite prints the number it is given.
+ */
+export function axisFormat(
+ sheet: TableSheet, series: readonly string[],
+): { formatter?: string; scale: number; pattern: string; mixed: boolean } {
+ const cols = series.map((id) => sheet.columns.find((c) => c.id === id)).filter(Boolean) as ColLike[]
+ if (!cols.length) return { scale: 1, pattern: '', mixed: false }
+ const key = (c: ColLike): string => `${c.type}|${c.format ?? ''}`
+ if (cols.some((c) => key(c) !== key(cols[0]))) return { scale: 1, pattern: '', mixed: true }
+ const c = cols[0]
+ const p = readPattern(c.format)
+ const pct = p.pct || c.type === 'percent'
+ if (!p.prefix && !p.suffix && !pct) return { scale: 1, pattern: c.format ?? '', mixed: false }
+ return {
+ formatter: `${p.prefix}{value}${p.suffix}${pct && !p.suffix ? '%' : ''}`,
+ scale: pct ? 100 : 1,
+ pattern: c.format ?? (pct ? '0%' : ''),
+ mixed: false,
+ }
}
/**
@@ -172,6 +274,7 @@ export function optionFor(
return {
...CHART_PRESETS.pie(),
color: palette,
+ ...(bind.legend === false ? { legend: undefined } : {}),
series: [{
type: 'pie',
radius: '68%',
@@ -182,20 +285,33 @@ export function optionFor(
}
}
- const base = CHART_PRESETS[bind.kind]?.() ?? CHART_PRESETS.bar()
- return {
+ // A line through unordered categories is REFUSED here, at the one place the
+ // option is built, so every surface that draws a binding (panel, story,
+ // dashboard) refuses it alike rather than one of them forgetting to.
+ const kind = lineRefused(sheet, bind) ? 'bar' : bind.kind
+ const base = CHART_PRESETS[kind]?.() ?? CHART_PRESETS.bar()
+ const ax = axisFormat(sheet, bind.series)
+ const showLegend = bind.legend ?? series.length > 1
+ // Colours are matched to SERIES, by column id — never by position: removing
+ // the first series must not repaint the second in the first one's colour.
+ const colors = bind.series.map((id, i) => bind.colors?.[id] ?? palette[i % palette.length])
+ const option: Record<string, unknown> = {
...base,
- color: palette,
- legend: { bottom: 0, show: series.length > 1 },
+ color: colors,
xAxis: { type: 'category', data: cats },
- yAxis: { type: 'value' },
+ yAxis: { type: 'value', ...(ax.formatter ? { axisLabel: { formatter: ax.formatter } } : {}) },
series: series.map((s) => ({
- type: bind.kind,
+ type: kind,
name: s.name,
- data: s.data,
- ...(bind.kind === 'line' ? { smooth: false, symbolSize: 6 } : {}),
+ data: ax.scale === 1 ? s.data : s.data.map((v) => (v === null ? null : v * ax.scale)),
+ ...(kind === 'line' ? { smooth: false, symbolSize: 6 } : {}),
})),
}
+ // charts-lite reads a PRESENT `legend` as "draw one" and ignores `show`, so
+ // a hidden legend is an absent key — `{show:false}` drew it anyway.
+ if (showLegend) option.legend = { bottom: 0 }
+ else delete option.legend
+ return option
}
/**
@@ -266,6 +382,8 @@ export interface ChartHostOpts extends ChartViewOpts {
* quietly.
*/
onRebind?: () => void
+ /** "Draw a line anyway" — offered beside a refused line (`lineRefused`). */
+ onAllowLine?: () => void
}
/** A line of chrome above or below the plot. Text only — never innerHTML: a
@@ -340,6 +458,13 @@ export function renderChart(
away ? undefined : rebind))
}
+ if (drawable && lineRefused(sheet, live)) {
+ const xName = sheet.columns.find((c) => c.id === live.x)?.name ?? live.x
+ host.append(noteBar(
+ t('Drawn as bars: {col} has no order for a line to follow.', { col: xName }),
+ opts.onAllowLine ? { label: t('Draw a line anyway'), run: opts.onAllowLine } : undefined))
+ }
+
if (!drawable) {
// No plot at all. An axis with no bars is not a lesser version of a chart,
// it is a different and false claim.
diff --git a/dash/src/chartedit.css b/dash/src/chartedit.css
new file mode 100644
index 00000000..5ba69c9e
--- /dev/null
+++ b/dash/src/chartedit.css
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: MIT
+ Copyright (c) 2026 The Bento authors
+ The chart editor's series list, in the properties panel. Slides' series row
+ (.ed-series-row) is the reference: a colour, the name, a remove. */
+
+.dce-series {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 30px;
+ font-size: 12.5px;
+}
+.dce-series-name {
+ flex: 1 1 auto;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.dce-colour { width: 34px; flex: 0 0 auto; }
+.dce-rm {
+ font: inherit;
+ font-size: 11.5px;
+ border: 1px solid transparent;
+ background: transparent;
+ color: var(--muted);
+ border-radius: 6px;
+ cursor: pointer;
+ padding: 1px 6px;
+}
+.dce-rm:hover:not(:disabled) { background: var(--panel); color: var(--ink); }
+.dce-rm:disabled { opacity: .35; cursor: default; }
+.dce-add { width: 100%; margin: 4px 0 2px; }
diff --git a/dash/src/chartedit.ts b/dash/src/chartedit.ts
new file mode 100644
index 00000000..f7381f42
--- /dev/null
+++ b/dash/src/chartedit.ts
@@ -0,0 +1,160 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// The chart editor — in the properties panel while the chart is the thing being
+// worked on, the way slides' panel becomes a chart's when a chart is selected
+// (slides panels.ts `buildChartProps`): Type, then the series list with a colour
+// and a remove each, then what slides calls the axis.
+//
+// THE DIFFERENCE FROM SLIDES IS THE DATA, and it is the whole of dash's chart
+// argument. A slides chart owns a grid of numbers; a dash chart owns COLUMN IDS
+// and reads the numbers from the sheet (chart.ts, top of file). So there is no
+// data grid here, and a series is added by picking a COLUMN, never by typing a
+// value — the chart cannot disagree with the sheet beside it.
+//
+// Every control writes a whole new binding through `set`, which main.ts mirrors
+// into `doc.chart` as one patch: one change, one undo.
+
+import type { TableSheet } from './model.ts'
+import './chartedit.css'
+import type { PanelKit } from './cellprops.ts'
+import { axisFormat, chartHeading, isOrdered, lineRefused, type ChartBinding } from './chart.ts'
+import { t } from './i18n.ts'
+
+const PALETTE = ['#F7A600', '#5B8DEF', '#2FB47C', '#E1616C', '#8B6FD3', '#3FA9B8']
+
+const MEASURE = new Set(['number', 'money', 'percent'])
+
+export interface ChartEditHost {
+ host: HTMLElement
+ kit: PanelKit
+ sheet: TableSheet
+ binding: ChartBinding
+ readOnly: boolean
+ /** write the next binding */
+ set(next: ChartBinding): void
+}
+
+const kindLabel = (k: ChartBinding['kind']): string =>
+ k === 'bar' ? t('Bar') : k === 'line' ? t('Line') : k === 'pie' ? t('Pie') : t('Scatter')
+
+const aggLabel = (a: NonNullable<ChartBinding['aggregate']>): string =>
+ a === 'sum' ? t('Sum') : a === 'avg' ? t('Average') : a === 'count' ? t('Count') : t('None — one point per row')
+
+/** Draw the editor. Rebuilt whole from the binding on every document event. */
+export function buildChartEditor(o: ChartEditHost): void {
+ const { host, kit, sheet } = o
+ const b = o.binding
+ const ro = o.readOnly
+ const nameOf = (id: string): string => sheet.columns.find((c) => c.id === id)?.name ?? id
+ const set = (patch: Partial<ChartBinding>, drop: Array<keyof ChartBinding> = []): void => {
+ if (ro) return
+ const next: ChartBinding = { ...b, series: [...b.series], ...patch }
+ for (const k of drop) delete next[k]
+ o.set(next)
+ }
+ const disable = <E extends HTMLInputElement | HTMLSelectElement>(e: E): E => { e.disabled = ro; return e }
+
+ kit.section(host, t('Chart'))
+ const kinds: Array<ChartBinding['kind']> = ['bar', 'line', 'pie', 'scatter']
+ const type = disable(kit.select(kinds.map((k) => [k, kindLabel(k)] as const), b.kind, (v) => {
+ // Choosing another type forgets a permission given for the line: "draw a
+ // line anyway" was said about a line, and a pie that later becomes a line
+ // again has to be asked again.
+ set({ kind: v as ChartBinding['kind'] }, ['allowLine'])
+ }))
+ type.classList.add('dce-type')
+ kit.row(host, t('Type'), type)
+ if (lineRefused(sheet, b)) {
+ // The ACTION is on the chart itself ("Draw a line anyway", chart.ts), where
+ // the bars it explains are — and where it still is with the panel shut.
+ kit.note(host, t('{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.', { col: nameOf(b.x) }))
+ }
+
+ const title = disable(kit.text(b.title ?? '', (v) => {
+ const s = v.trim()
+ if (s) set({ title: s }); else set({}, ['title'])
+ }))
+ title.placeholder = chartHeading(sheet, { ...b, title: undefined })
+ title.classList.add('dce-title')
+ kit.row(host, t('Title'), title)
+
+ const cats = disable(kit.select(
+ sheet.columns.filter((c) => !b.series.includes(c.id)).map((c) => [c.id, c.name] as const),
+ b.x,
+ (v) => set({ x: v }, ['allowLine'])))
+ cats.classList.add('dce-x')
+ kit.row(host, t('Categories'), cats)
+
+ const aggs: Array<NonNullable<ChartBinding['aggregate']>> = ['sum', 'avg', 'count', 'none']
+ const agg = disable(kit.select(aggs.map((a) => [a, aggLabel(a)] as const), b.aggregate ?? 'sum',
+ (v) => set({ aggregate: v as ChartBinding['aggregate'] })))
+ agg.classList.add('dce-agg')
+ kit.row(host, t('Summarise'), agg)
+
+ const legend = kit.check(b.legend ?? b.series.length > 1, (v) => set({ legend: v }))
+ legend.disabled = ro
+ legend.classList.add('dce-legend')
+ kit.row(host, t('Legend'), legend)
+
+ // --- series -----------------------------------------------------------------
+ kit.section(host, t('Series'))
+ if (b.kind === 'pie' && b.series.length > 1) {
+ kit.note(host, t('A pie shows one series — the first.'))
+ }
+ b.series.forEach((id, i) => {
+ const row = document.createElement('div')
+ row.className = 'dce-series'
+ row.dataset.col = id
+ const name = document.createElement('span')
+ name.className = 'dce-series-name'
+ name.textContent = nameOf(id)
+ const colour = document.createElement('input')
+ colour.type = 'color'
+ colour.className = 'dce-colour'
+ colour.value = b.colors?.[id] ?? PALETTE[i % PALETTE.length]
+ colour.disabled = ro || b.kind === 'pie'
+ colour.title = t('Colour of {name}', { name: nameOf(id) })
+ colour.setAttribute('aria-label', colour.title)
+ colour.addEventListener('change', () => set({ colors: { ...(b.colors ?? {}), [id]: colour.value } }))
+ const rm = document.createElement('button')
+ rm.type = 'button'
+ rm.className = 'dce-rm'
+ rm.textContent = '✕'
+ rm.title = t('Remove {name}', { name: nameOf(id) })
+ rm.setAttribute('aria-label', rm.title)
+ // The last series stays: a chart of no series is an axis with nothing on
+ // it, which reads as a chart of zeroes. Closing the chart is the way out.
+ rm.disabled = ro || b.series.length < 2
+ rm.addEventListener('click', () => {
+ const colors = { ...(b.colors ?? {}) }
+ delete colors[id]
+ const next: Partial<ChartBinding> = { series: b.series.filter((s) => s !== id) }
+ if (Object.keys(colors).length) set({ ...next, colors }); else set(next, ['colors'])
+ })
+ row.append(colour, name, rm)
+ host.append(row)
+ })
+ if (!ro) {
+ const left = sheet.columns.filter((c) => MEASURE.has(c.type) && !b.series.includes(c.id) && c.id !== b.x)
+ if (left.length) {
+ const add = kit.select([['', t('+ Add series')], ...left.map((c) => [c.id, c.name] as const)], '', (v) => {
+ if (v) set({ series: [...b.series, v] })
+ })
+ add.className = 'dce-add'
+ add.setAttribute('aria-label', t('+ Add series'))
+ host.append(add)
+ }
+ }
+
+ // --- axis -------------------------------------------------------------------
+ if (b.kind !== 'pie') {
+ kit.section(host, t('Axis'))
+ const ax = axisFormat(sheet, b.series)
+ kit.readonlyRow(host, t('Values'), ax.mixed
+ ? t('Plain numbers — the series do not share a format')
+ : ax.pattern ? t('{pattern}, from the column', { pattern: ax.pattern }) : t('Plain numbers'))
+ kit.readonlyRow(host, t('Categories'), isOrdered(sheet.columns.find((c) => c.id === b.x))
+ ? t('In order')
+ : t('No order — as they appear in the sheet'))
+ }
+}
diff --git a/dash/src/filter.ts b/dash/src/filter.ts
index 4fa9ce2b..2ca9b851 100644
--- a/dash/src/filter.ts
+++ b/dash/src/filter.ts
@@ -460,6 +460,13 @@ export interface DistinctOpts {
rows?: number[]
/** case-insensitive substring the value must contain */
match?: string
+ /**
+ * How the list SHOWS a value, when that is not how it is stored (a money
+ * column lists £4,300 and stores 4300). A search matches either spelling:
+ * the reader types what they can see, and "4,300" finding nothing beside a
+ * box that says £4,300 is the same two-spellings problem one step later.
+ */
+ display?: (v: unknown) => string
}
/**
@@ -526,7 +533,8 @@ export function distinctValues(
}
if (memo.has(v)) continue
if (memo.size < memoCap) memo.add(v)
- if (needle && !key(v).includes(needle)) continue
+ if (needle && !key(v).includes(needle) &&
+ !(opts.display && key(opts.display(v)).includes(needle))) continue
const k = matchKey(v)
if (seen.has(k)) continue
if (seen.size >= cap) {
diff --git a/dash/src/filterui.ts b/dash/src/filterui.ts
index e0ae155e..5fb40e64 100644
--- a/dash/src/filterui.ts
+++ b/dash/src/filterui.ts
@@ -65,6 +65,7 @@ import type { ColumnType, TableSheet } from './model.ts'
import type { ColumnFilter, Predicate } from './filter.ts'
import { BLANK_KEY, buildOrder, distinctValues, matchKey } from './filter.ts'
import { readCell, type Store } from './store.ts'
+import { listLabel } from './format.ts'
import {
autoFitWidth, setHidden, freezeAt, readFrozen, resizeColumn,
} from './rowcol.ts'
@@ -505,7 +506,9 @@ export function openColumnMenu(o: ColumnMenuOpts): HTMLElement | null {
const k = matchKey(v)
// keyed, not `v === null`: the blank box is the one entry whose label is
// not its value, and BLANK_KEY is the single spelling of which one it is
- const label = k === BLANK_KEY ? t('(Blanks)') : String(v)
+ // AS THE COLUMN SHOWS IT: £4,300 in a money column, never the stored
+ // 4300 (format.ts `listLabel` says why, and why Yes/No stays as stored).
+ const label = k === BLANK_KEY ? t('(Blanks)') : listLabel(v, col)
return `<label class="dfx-item"><input type="checkbox" data-k="${esc(k)}"` +
`${ticked.has(k) ? ' checked' : ''}><span>${esc(label)}</span></label>`
}).join('')
@@ -591,7 +594,7 @@ export function openColumnMenu(o: ColumnMenuOpts): HTMLElement | null {
const repaintList = (): void => {
shown = distinctValues(get, o.colId, rows, LIST_CAP,
- { rows: base ?? undefined, match: query || undefined })
+ { rows: base ?? undefined, match: query || undefined, display: (v) => listLabel(v, col) })
for (const v of shown.values) known.set(matchKey(v), v)
listEl.innerHTML = listHtml()
noteEl.innerHTML = noteHtml()
diff --git a/dash/src/format.ts b/dash/src/format.ts
index b1d76b53..909a88ea 100644
--- a/dash/src/format.ts
+++ b/dash/src/format.ts
@@ -189,6 +189,26 @@ export function formatValue(v: unknown, col: Pick<Column, 'type' | 'format'>): s
return isPct && !p.pct && !p.suffix ? `${out}%` : out
}
+/**
+ * A value as a LIST shows it — a filter checklist, the pivot's filter list.
+ *
+ * A quantity prints the way its column prints it: a money column's box says
+ * £4,300 because the cell above it says £4,300, and a checklist that said 4300
+ * asked the reader to translate between two spellings of one number on one
+ * screen. Everything else prints as stored. `formatValue` is NOT used for those
+ * on purpose: it prints `false` in a Yes/No column as '' — the empty label the
+ * "(Blanks)" box owns — and a list must never offer two boxes that read alike.
+ */
+export function listLabel(v: unknown, col: Pick<Column, 'type' | 'format'> | undefined): string {
+ if (v == null) return ''
+ const t = col?.type
+ if (col && (t === 'number' || t === 'money' || t === 'percent')) {
+ const n = typeof v === 'number' ? v : Number(v)
+ if (Number.isFinite(n) && String(v).trim() !== '') return formatValue(n, col)
+ }
+ return String(v)
+}
+
/** Right-align anything that is a quantity; left-align anything that is a word. */
export const alignFor = (t: ColumnType): 'left' | 'right' =>
t === 'number' || t === 'money' || t === 'percent' ? 'right' : 'left'
diff --git a/dash/src/i18n/de.ts b/dash/src/i18n/de.ts
index 117829e8..822675e8 100644
--- a/dash/src/i18n/de.ts
+++ b/dash/src/i18n/de.ts
@@ -676,7 +676,6 @@ export const de: Catalog = {
"orphaned": "verwaist",
"owner": "Eigentümer",
"pivot": "Pivottabelle",
- "pivot table — open it from + Pivot": "Pivottabelle — über + PivotTable öffnen",
"reads {value}": "enthält {value}",
"row": "Zeile",
"row {n}": "Zeile {n}",
@@ -754,6 +753,52 @@ export const de: Catalog = {
"Copy saved — you are still editing the original": "Kopie gespeichert — Sie bearbeiten weiterhin das Original",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "Die Absturzwiederherstellung ist für diese Arbeitsmappe deaktiviert – sie ist zu groß für eine Sicherungskopie. Speichern Sie häufig.",
"A backup of this workbook for yourself — same workbook, same live session.": "Eine Sicherungskopie für Sie — gleiche Arbeitsmappe, gleiche Live-Sitzung.",
+ "(missing sheet)": "(Blatt fehlt)",
+ "A pie shows one series — the first.": "Ein Kreisdiagramm zeigt nur eine Reihe – die erste.",
+ "Add a field to {area}": "Feld zu {area} hinzufügen",
+ "Add field…": "Feld hinzufügen…",
+ "All": "Alle",
+ "Axis": "Achse",
+ "Categories": "Kategorien",
+ "Choose which values to include": "Auswählen, welche Werte einbezogen werden",
+ "Colour of {name}": "Farbe von {name}",
+ "Drag a field into an area below, or tick it.": "Ziehen Sie ein Feld in einen Bereich unten, oder haken Sie es an.",
+ "Draw a line anyway": "Trotzdem eine Linie zeichnen",
+ "Drawn as bars: {col} has no order for a line to follow.": "Als Balken gezeichnet: {col} hat keine Reihenfolge, der eine Linie folgen könnte.",
+ "Drop a field here": "Feld hier ablegen",
+ "Drop a field here to summarise it": "Feld hier ablegen, um es zusammenzufassen",
+ "Edit": "Bearbeiten",
+ "Edit this chart": "Dieses Diagramm bearbeiten",
+ "Fields": "Felder",
+ "Filters": "Filter",
+ "Grand totals": "Gesamtergebnisse",
+ "How to summarise {name}": "Wie {name} zusammengefasst wird",
+ "In order": "Geordnet",
+ "Legend": "Legende",
+ "Line": "Linie",
+ "No order — as they appear in the sheet": "Ohne Reihenfolge – so, wie sie im Blatt erscheinen",
+ "None — one point per row": "Keine – ein Punkt pro Zeile",
+ "Only the first {n} values are listed.": "Nur die ersten {n} Werte sind aufgeführt.",
+ "Pie": "Kreis",
+ "Pivot table": "PivotTable",
+ "Plain numbers": "Reine Zahlen",
+ "Plain numbers — the series do not share a format": "Reine Zahlen – die Reihen haben kein gemeinsames Format",
+ "Remove {name}": "{name} entfernen",
+ "Scatter": "Streuung",
+ "Series": "Reihen",
+ "Show (blank) groups": "Gruppen (leer) anzeigen",
+ "Source": "Quelle",
+ "Subtotals": "Teilergebnisse",
+ "Summarise": "Zusammenfassen",
+ "The sheet this pivot summarised is not in the workbook any more.": "Das Blatt, das diese PivotTable zusammengefasst hat, ist nicht mehr in der Arbeitsmappe.",
+ "This column is not in {sheet} any more.": "Diese Spalte ist nicht mehr in {sheet}.",
+ "Title": "Titel",
+ "from {sheet}": "aus {sheet}",
+ "pivot table — a summary of another sheet": "PivotTable – eine Zusammenfassung eines anderen Blatts",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} hat keine Reihenfolge, eine Linie zwischen seinen Kategorien würde also einen Trend zeichnen, den es nicht gibt. Als Balken gezeichnet.",
+ "{n} selected": "{n} ausgewählt",
+ "{pattern}, from the column": "{pattern}, aus der Spalte",
+ "+ Add series": "+ Reihe hinzufügen",
"Press Esc to cancel.": "Mit Esc abbrechen.",
"There’s a problem with this formula: a bracket is opened and never closed.": "Mit dieser Formel stimmt etwas nicht: Eine Klammer wird geöffnet und nie geschlossen.",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "Mit dieser Formel stimmt etwas nicht: Sie endet nach „{near}“, wo ein Wert fehlt.",
diff --git a/dash/src/i18n/es.ts b/dash/src/i18n/es.ts
index 24bc377c..2369dc89 100644
--- a/dash/src/i18n/es.ts
+++ b/dash/src/i18n/es.ts
@@ -676,7 +676,6 @@ export const es: Catalog = {
"orphaned": "huérfano",
"owner": "propietario",
"pivot": "tabla dinámica",
- "pivot table — open it from + Pivot": "tabla dinámica: ábrela desde + Tabla dinámica",
"reads {value}": "pone {value}",
"row": "fila",
"row {n}": "fila {n}",
@@ -754,6 +753,52 @@ export const es: Catalog = {
"Copy saved — you are still editing the original": "Copia guardada: sigues editando el original",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "La recuperación tras fallos está desactivada para este libro: es demasiado grande para guardar una copia de seguridad. Guarda a menudo.",
"A backup of this workbook for yourself — same workbook, same live session.": "Una copia de seguridad para ti — mismo libro, misma sesión en vivo.",
+ "(missing sheet)": "(hoja ausente)",
+ "A pie shows one series — the first.": "Un gráfico circular muestra una sola serie: la primera.",
+ "Add a field to {area}": "Añadir un campo a {area}",
+ "Add field…": "Añadir campo…",
+ "All": "Todo",
+ "Axis": "Eje",
+ "Categories": "Categorías",
+ "Choose which values to include": "Elegir qué valores incluir",
+ "Colour of {name}": "Color de {name}",
+ "Drag a field into an area below, or tick it.": "Arrastra un campo a un área de abajo, o márcalo.",
+ "Draw a line anyway": "Dibujar una línea de todos modos",
+ "Drawn as bars: {col} has no order for a line to follow.": "Dibujado como barras: {col} no tiene un orden que una línea pueda seguir.",
+ "Drop a field here": "Suelta un campo aquí",
+ "Drop a field here to summarise it": "Suelta un campo aquí para resumirlo",
+ "Edit": "Editar",
+ "Edit this chart": "Editar este gráfico",
+ "Fields": "Campos",
+ "Filters": "Filtros",
+ "Grand totals": "Totales generales",
+ "How to summarise {name}": "Cómo resumir {name}",
+ "In order": "En orden",
+ "Legend": "Leyenda",
+ "Line": "Líneas",
+ "No order — as they appear in the sheet": "Sin orden: tal como aparecen en la hoja",
+ "None — one point per row": "Ninguno: un punto por fila",
+ "Only the first {n} values are listed.": "Solo se muestran los primeros {n} valores.",
+ "Pie": "Circular",
+ "Pivot table": "Tabla dinámica",
+ "Plain numbers": "Números sin formato",
+ "Plain numbers — the series do not share a format": "Números sin formato: las series no comparten formato",
+ "Remove {name}": "Quitar {name}",
+ "Scatter": "Dispersión",
+ "Series": "Series",
+ "Show (blank) groups": "Mostrar grupos (vacío)",
+ "Source": "Origen",
+ "Subtotals": "Subtotales",
+ "Summarise": "Resumir",
+ "The sheet this pivot summarised is not in the workbook any more.": "La hoja que resumía esta tabla dinámica ya no está en el libro.",
+ "This column is not in {sheet} any more.": "Esta columna ya no está en {sheet}.",
+ "Title": "Título",
+ "from {sheet}": "de {sheet}",
+ "pivot table — a summary of another sheet": "tabla dinámica: un resumen de otra hoja",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} no tiene orden, así que una línea entre sus categorías dibujaría una tendencia que no existe. Dibujado como barras.",
+ "{n} selected": "{n} seleccionados",
+ "{pattern}, from the column": "{pattern}, de la columna",
+ "+ Add series": "+ Añadir serie",
"Press Esc to cancel.": "Pulse Esc para cancelar.",
"There’s a problem with this formula: a bracket is opened and never closed.": "Hay un problema con esta fórmula: se abre un paréntesis que nunca se cierra.",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "Hay un problema con esta fórmula: termina después de «{near}», donde falta un valor.",
diff --git a/dash/src/i18n/fr.ts b/dash/src/i18n/fr.ts
index 337d00e3..aab5ec5c 100644
--- a/dash/src/i18n/fr.ts
+++ b/dash/src/i18n/fr.ts
@@ -676,7 +676,6 @@ export const fr: Catalog = {
"orphaned": "orphelin",
"owner": "propriétaire",
"pivot": "tableau croisé",
- "pivot table — open it from + Pivot": "tableau croisé dynamique — ouvrez-le depuis + Tableau croisé",
"reads {value}": "contient {value}",
"row": "ligne",
"row {n}": "ligne {n}",
@@ -754,6 +753,52 @@ export const fr: Catalog = {
"Copy saved — you are still editing the original": "Copie enregistrée — vous modifiez toujours l'original",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "La récupération après plantage est désactivée pour ce classeur : il est trop volumineux pour en garder une copie de secours. Enregistrez souvent.",
"A backup of this workbook for yourself — same workbook, same live session.": "Une sauvegarde pour vous — même classeur, même session live.",
+ "(missing sheet)": "(feuille manquante)",
+ "A pie shows one series — the first.": "Un camembert n’affiche qu’une série : la première.",
+ "Add a field to {area}": "Ajouter un champ à {area}",
+ "Add field…": "Ajouter un champ…",
+ "All": "Tout",
+ "Axis": "Axe",
+ "Categories": "Catégories",
+ "Choose which values to include": "Choisir les valeurs à inclure",
+ "Colour of {name}": "Couleur de {name}",
+ "Drag a field into an area below, or tick it.": "Faites glisser un champ dans une zone ci-dessous, ou cochez-le.",
+ "Draw a line anyway": "Tracer une ligne quand même",
+ "Drawn as bars: {col} has no order for a line to follow.": "Tracé en barres : {col} n’a pas d’ordre qu’une ligne puisse suivre.",
+ "Drop a field here": "Déposez un champ ici",
+ "Drop a field here to summarise it": "Déposez un champ ici pour le résumer",
+ "Edit": "Modifier",
+ "Edit this chart": "Modifier ce graphique",
+ "Fields": "Champs",
+ "Filters": "Filtres",
+ "Grand totals": "Totaux généraux",
+ "How to summarise {name}": "Comment résumer {name}",
+ "In order": "Ordonnées",
+ "Legend": "Légende",
+ "Line": "Lignes",
+ "No order — as they appear in the sheet": "Sans ordre — dans l’ordre où elles apparaissent dans la feuille",
+ "None — one point per row": "Aucun — un point par ligne",
+ "Only the first {n} values are listed.": "Seules les {n} premières valeurs sont listées.",
+ "Pie": "Secteurs",
+ "Pivot table": "Tableau croisé",
+ "Plain numbers": "Nombres bruts",
+ "Plain numbers — the series do not share a format": "Nombres bruts — les séries n’ont pas le même format",
+ "Remove {name}": "Retirer {name}",
+ "Scatter": "Nuage de points",
+ "Series": "Séries",
+ "Show (blank) groups": "Afficher les groupes (vide)",
+ "Source": "Source",
+ "Subtotals": "Sous-totaux",
+ "Summarise": "Résumer",
+ "The sheet this pivot summarised is not in the workbook any more.": "La feuille que résumait ce tableau croisé n’est plus dans le classeur.",
+ "This column is not in {sheet} any more.": "Cette colonne n’est plus dans {sheet}.",
+ "Title": "Titre",
+ "from {sheet}": "de {sheet}",
+ "pivot table — a summary of another sheet": "tableau croisé — un résumé d’une autre feuille",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} n’a pas d’ordre : une ligne entre ses catégories tracerait une tendance qui n’existe pas. Tracé en barres.",
+ "{n} selected": "{n} sélectionnés",
+ "{pattern}, from the column": "{pattern}, d’après la colonne",
+ "+ Add series": "+ Ajouter une série",
"Press Esc to cancel.": "Appuyez sur Échap pour annuler.",
"There’s a problem with this formula: a bracket is opened and never closed.": "Cette formule pose problème : une parenthèse est ouverte et jamais fermée.",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "Cette formule pose problème : elle s’arrête après « {near} », là où il manque une valeur.",
diff --git a/dash/src/i18n/it.ts b/dash/src/i18n/it.ts
index 9e33fcb8..3b59cd03 100644
--- a/dash/src/i18n/it.ts
+++ b/dash/src/i18n/it.ts
@@ -676,7 +676,6 @@ export const it: Catalog = {
"orphaned": "orfano",
"owner": "proprietario",
"pivot": "tabella pivot",
- "pivot table — open it from + Pivot": "tabella pivot — aprila da + Tabella pivot",
"reads {value}": "dice {value}",
"row": "riga",
"row {n}": "riga {n}",
@@ -754,6 +753,52 @@ export const it: Catalog = {
"Copy saved — you are still editing the original": "Copia salvata: stai ancora modificando l'originale",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "Il ripristino dopo un arresto anomalo è disattivato per questa cartella di lavoro: è troppo grande per conservarne una copia di backup. Salva spesso.",
"A backup of this workbook for yourself — same workbook, same live session.": "Una copia di riserva per te — stessa cartella di lavoro, stessa sessione live.",
+ "(missing sheet)": "(foglio mancante)",
+ "A pie shows one series — the first.": "Un grafico a torta mostra una sola serie: la prima.",
+ "Add a field to {area}": "Aggiungi un campo a {area}",
+ "Add field…": "Aggiungi campo…",
+ "All": "Tutti",
+ "Axis": "Asse",
+ "Categories": "Categorie",
+ "Choose which values to include": "Scegli quali valori includere",
+ "Colour of {name}": "Colore di {name}",
+ "Drag a field into an area below, or tick it.": "Trascina un campo in un’area qui sotto, oppure spuntalo.",
+ "Draw a line anyway": "Disegna comunque una linea",
+ "Drawn as bars: {col} has no order for a line to follow.": "Disegnato a barre: {col} non ha un ordine che una linea possa seguire.",
+ "Drop a field here": "Rilascia qui un campo",
+ "Drop a field here to summarise it": "Rilascia qui un campo per riepilogarlo",
+ "Edit": "Modifica",
+ "Edit this chart": "Modifica questo grafico",
+ "Fields": "Campi",
+ "Filters": "Filtri",
+ "Grand totals": "Totali complessivi",
+ "How to summarise {name}": "Come riepilogare {name}",
+ "In order": "In ordine",
+ "Legend": "Legenda",
+ "Line": "Linee",
+ "No order — as they appear in the sheet": "Senza ordine: come appaiono nel foglio",
+ "None — one point per row": "Nessuno: un punto per riga",
+ "Only the first {n} values are listed.": "Sono elencati solo i primi {n} valori.",
+ "Pie": "Torta",
+ "Pivot table": "Tabella pivot",
+ "Plain numbers": "Numeri semplici",
+ "Plain numbers — the series do not share a format": "Numeri semplici: le serie non condividono un formato",
+ "Remove {name}": "Rimuovi {name}",
+ "Scatter": "Dispersione",
+ "Series": "Serie",
+ "Show (blank) groups": "Mostra i gruppi (vuoto)",
+ "Source": "Origine",
+ "Subtotals": "Subtotali",
+ "Summarise": "Riepiloga",
+ "The sheet this pivot summarised is not in the workbook any more.": "Il foglio riepilogato da questa tabella pivot non è più nella cartella di lavoro.",
+ "This column is not in {sheet} any more.": "Questa colonna non è più in {sheet}.",
+ "Title": "Titolo",
+ "from {sheet}": "da {sheet}",
+ "pivot table — a summary of another sheet": "tabella pivot: un riepilogo di un altro foglio",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} non ha un ordine, quindi una linea tra le sue categorie disegnerebbe una tendenza che non c’è. Disegnato a barre.",
+ "{n} selected": "{n} selezionati",
+ "{pattern}, from the column": "{pattern}, dalla colonna",
+ "+ Add series": "+ Aggiungi serie",
"Press Esc to cancel.": "Premi Esc per annullare.",
"There’s a problem with this formula: a bracket is opened and never closed.": "C’è un problema con questa formula: una parentesi viene aperta e mai chiusa.",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "C’è un problema con questa formula: finisce dopo «{near}», dove manca un valore.",
diff --git a/dash/src/i18n/ja.ts b/dash/src/i18n/ja.ts
index bb0ff65e..b5f8573c 100644
--- a/dash/src/i18n/ja.ts
+++ b/dash/src/i18n/ja.ts
@@ -676,7 +676,6 @@ export const ja: Catalog = {
"orphaned": "孤立",
"owner": "オーナー",
"pivot": "ピボット",
- "pivot table — open it from + Pivot": "ピボットテーブル — + ピボット から開きます",
"reads {value}": "内容は {value}",
"row": "行",
"row {n}": "{n} 行目",
@@ -754,6 +753,52 @@ export const ja: Catalog = {
"Copy saved — you are still editing the original": "コピーを保存しました — 編集中なのは引き続き元のファイルです",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "このブックのクラッシュ復旧はオフです — 大きすぎてバックアップを保存できません。こまめに保存してください。",
"A backup of this workbook for yourself — same workbook, same live session.": "自分用のバックアップ — 同じブック・同じライブセッションです。",
+ "(missing sheet)": "(シートがありません)",
+ "A pie shows one series — the first.": "円グラフは 1 つの系列(最初の系列)だけを表示します。",
+ "Add a field to {area}": "{area} にフィールドを追加",
+ "Add field…": "フィールドを追加…",
+ "All": "すべて",
+ "Axis": "軸",
+ "Categories": "カテゴリ",
+ "Choose which values to include": "含める値を選択",
+ "Colour of {name}": "{name} の色",
+ "Drag a field into an area below, or tick it.": "フィールドを下の領域にドラッグするか、チェックを付けます。",
+ "Draw a line anyway": "それでも線を描く",
+ "Drawn as bars: {col} has no order for a line to follow.": "棒で表示しています: {col} には線がたどる順序がありません。",
+ "Drop a field here": "ここにフィールドをドロップ",
+ "Drop a field here to summarise it": "集計するフィールドをここにドロップ",
+ "Edit": "編集",
+ "Edit this chart": "このグラフを編集",
+ "Fields": "フィールド",
+ "Filters": "フィルター",
+ "Grand totals": "総計",
+ "How to summarise {name}": "{name} の集計方法",
+ "In order": "順序あり",
+ "Legend": "凡例",
+ "Line": "折れ線",
+ "No order — as they appear in the sheet": "順序なし — シートに現れる順",
+ "None — one point per row": "なし — 行ごとに 1 点",
+ "Only the first {n} values are listed.": "最初の {n} 個の値だけを表示しています。",
+ "Pie": "円",
+ "Pivot table": "ピボットテーブル",
+ "Plain numbers": "書式なしの数値",
+ "Plain numbers — the series do not share a format": "書式なしの数値 — 系列の書式が一致しません",
+ "Remove {name}": "{name} を削除",
+ "Scatter": "散布図",
+ "Series": "系列",
+ "Show (blank) groups": "(空白) グループを表示",
+ "Source": "元データ",
+ "Subtotals": "小計",
+ "Summarise": "集計",
+ "The sheet this pivot summarised is not in the workbook any more.": "このピボットの元のシートはもうブックにありません。",
+ "This column is not in {sheet} any more.": "この列はもう {sheet} にありません。",
+ "Title": "タイトル",
+ "from {sheet}": "{sheet} から",
+ "pivot table — a summary of another sheet": "ピボットテーブル — 別のシートの集計",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} には順序がないため、カテゴリ間を結ぶ線は存在しない傾向を描いてしまいます。棒で表示しています。",
+ "{n} selected": "{n} 件を選択",
+ "{pattern}, from the column": "{pattern}(列の書式)",
+ "+ Add series": "+ 系列を追加",
"Press Esc to cancel.": "Esc キーで取り消します。",
"There’s a problem with this formula: a bracket is opened and never closed.": "この数式には問題があります: 括弧が開いたまま閉じられていません。",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "この数式には問題があります: 「{near}」の後で終わっていて、値が足りません。",
diff --git a/dash/src/i18n/packed.ts b/dash/src/i18n/packed.ts
index 292e89f4..e19b35ff 100644
--- a/dash/src/i18n/packed.ts
+++ b/dash/src/i18n/packed.ts
@@ -19,6 +19,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"(Blanks)": ["(空白)","(空白)","(空白)","(En blanco)","(Vides)","(Leer)","(Vuote)","(Vazios)"],
"(Select all)": ["(すべて選択)","(全选)","(全選)","(Seleccionar todo)","(Tout sélectionner)","(Alle auswählen)","(Seleziona tutto)","(Selecionar tudo)"],
"(blank)": ["(空白)","(空白)","(空白)","(en blanco)","(vide)","(leer)","(vuoto)","(vazio)"],
+ "(missing sheet)": ["(シートがありません)","(工作表已缺失)","(工作表已遺失)","(hoja ausente)","(feuille manquante)","(Blatt fehlt)","(foglio mancante)","(folha em falta)"],
"(none — this workbook has no id)": ["(なし — このブックには id がありません)","(无 — 此工作簿没有 id)","(無 — 此活頁簿沒有 id)","(ninguno — este libro no tiene id)","(aucun — ce classeur n’a pas d’id)","(keine — diese Arbeitsmappe hat keine ID)","(nessuno — questa cartella di lavoro non ha id)","(nenhum — esta pasta de trabalho não tem id)"],
"(the document block is empty)": ["(ドキュメントブロックが空です)","(文档块为空)","(文件區塊是空的)","(el bloque del documento está vacío)","(le bloc document est vide)","(der Dokumentblock ist leer)","(il blocco del documento è vuoto)","(o bloco do documento está vazio)"],
"(untitled sheet)": ["(無題のシート)","(未命名工作表)","(未命名工作表)","(hoja sin título)","(feuille sans titre)","(unbenanntes Blatt)","(foglio senza titolo)","(planilha sem título)"],
@@ -40,6 +41,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"A formula column fills every row of a dataset. This is a spreadsheet — type = in a cell instead.": ["数式列はデータセットの全行を埋めます。これはスプレッドシートなので、セルに = を入力してください。","公式列会填充数据集的每一行。这是电子表格 — 请在单元格中输入 =。","公式欄會填滿資料集的每一列。這是試算表 — 請在儲存格中輸入 =。","Una columna de fórmula rellena todas las filas de un conjunto de datos. Esto es una hoja de cálculo: escribe = en una celda.","Une colonne de formule remplit chaque ligne d’un jeu de données. Ceci est une feuille de calcul — saisissez = dans une cellule.","Eine Formelspalte füllt jede Zeile eines Datensatzes. Dies ist ein Tabellenblatt — tippen Sie stattdessen = in eine Zelle.","Una colonna di formula riempie ogni riga di un set di dati. Questo è un foglio di calcolo: digita = in una cella.","Uma coluna de fórmula preenche todas as linhas de um conjunto de dados. Isto é uma planilha — digite = em uma célula."],
"A formula column needs a formula.": ["数式列には数式が必要です。","公式列需要一个公式。","公式欄需要一個公式。","Una columna de fórmula necesita una fórmula.","Une colonne de formule a besoin d’une formule.","Eine Formelspalte braucht eine Formel.","Una colonna di formula ha bisogno di una formula.","Uma coluna de fórmula precisa de uma fórmula."],
"A locked copy for handing out: it opens, it does not edit.": ["配布用のロックされたコピー。開けますが、編集はできません。","用于分发的锁定副本:只能打开,不能编辑。","可分送出去的鎖定副本:只能開啟,不能編輯。","Una copia bloqueada para repartir: se abre, pero no se edita.","Une copie verrouillée à distribuer : elle s’ouvre, elle ne se modifie pas.","Eine gesperrte Kopie zum Weitergeben: sie lässt sich öffnen, aber nicht bearbeiten.","Una copia bloccata da distribuire: si apre, non si modifica.","Uma cópia bloqueada para distribuir: ela abre, mas não edita."],
+ "A pie shows one series — the first.": ["円グラフは 1 つの系列(最初の系列)だけを表示します。","饼图只显示一个系列——第一个。","圓形圖只顯示一個數列——第一個。","Un gráfico circular muestra una sola serie: la primera.","Un camembert n’affiche qu’une série : la première.","Ein Kreisdiagramm zeigt nur eine Reihe – die erste.","Un grafico a torta mostra una sola serie: la prima.","Um gráfico circular mostra uma só série — a primeira."],
"A pie shows one series; the rest are in the legend of the bar view.": ["円グラフは 1 つの系列だけを表示します。残りは棒グラフ表示の凡例にあります。","饼图只显示一个系列;其余系列在柱状视图的图例中。","圓形圖只顯示一個數列;其餘的在長條圖檢視的圖例中。","Un gráfico circular muestra una serie; el resto están en la leyenda de la vista de barras.","Un graphique en secteurs n’affiche qu’une série ; les autres figurent dans la légende de la vue en barres.","Ein Kreisdiagramm zeigt eine Datenreihe; die übrigen stehen in der Legende der Balkenansicht.","Un grafico a torta mostra una sola serie; le altre sono nella legenda della vista a barre.","Uma pizza mostra uma série; as demais ficam na legenda da visão de barras."],
"A pivot summarises a dataset’s columns — this is a spreadsheet.": ["ピボットはデータセットの列を集計します — これはスプレッドシートです。","透视表汇总数据集的列 — 这是电子表格。","樞紐分析彙總資料集的欄 — 這是試算表。","Una tabla dinámica resume las columnas de un conjunto de datos: esto es una hoja de cálculo.","Un tableau croisé résume les colonnes d’un jeu de données — ceci est une feuille de calcul.","Eine Pivot fasst die Spalten eines Datensatzes zusammen — dies ist ein Tabellenblatt.","Una tabella pivot riassume le colonne di un set di dati: questo è un foglio di calcolo.","Uma tabela dinâmica resume as colunas de um conjunto de dados — isto é uma planilha."],
"A pivot summarises a dataset’s columns, and this sheet has none.": ["ピボットはデータセットの列を集計しますが、このシートには列がありません。","透视表汇总数据集的列,而此工作表没有列。","樞紐分析彙總資料集的欄,而此工作表沒有欄。","Una tabla dinámica resume columnas de un conjunto de datos, y esta hoja no tiene ninguna.","Un tableau croisé résume les colonnes d’un jeu de données, et cette feuille n’en a aucune.","Eine Pivot fasst Spalten eines Datensatzes zusammen, und dieses Blatt hat keine.","Una tabella pivot riassume le colonne di un set di dati, e questo foglio non ne ha.","Uma tabela dinâmica resume as colunas de um conjunto de dados, e esta planilha não tem nenhuma."],
@@ -54,6 +56,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"About": ["情報","关于","關於","Acerca de","À propos","Über","Informazioni","Sobre"],
"About this workbook": ["このブックについて","关于此工作簿","關於此活頁簿","Acerca de este libro","À propos de ce classeur","Über diese Arbeitsmappe","Informazioni su questa cartella di lavoro","Sobre esta pasta de trabalho"],
"Add a column": ["列を追加","添加列","新增欄","Añadir una columna","Ajouter une colonne","Spalte hinzufügen","Aggiungi una colonna","Adicionar uma coluna"],
+ "Add a field to {area}": ["{area} にフィールドを追加","向{area}添加字段","新增欄位至{area}","Añadir un campo a {area}","Ajouter un champ à {area}","Feld zu {area} hinzufügen","Aggiungi un campo a {area}","Adicionar um campo a {area}"],
"Add a formula column": ["数式列を追加","添加公式列","新增公式欄","Añadir una columna de fórmula","Ajouter une colonne de formule","Formelspalte hinzufügen","Aggiungi una colonna formula","Adicionar uma coluna de fórmula"],
"Add a row": ["行を追加","添加一行","新增一列","Añadir una fila","Ajouter une ligne","Zeile hinzufügen","Aggiungi una riga","Adicionar uma linha"],
"Add a sheet from a CSV or TSV file": ["CSV または TSV ファイルからシートを追加","从 CSV 或 TSV 文件添加工作表","從 CSV 或 TSV 檔案新增工作表","Añadir una hoja desde un archivo CSV o TSV","Ajouter une feuille depuis un fichier CSV ou TSV","Blatt aus einer CSV- oder TSV-Datei hinzufügen","Aggiungi un foglio da un file CSV o TSV","Adicionar uma planilha de um arquivo CSV ou TSV"],
@@ -61,8 +64,10 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Add a value field to summarise.": ["集計する値フィールドを追加してください。","添加要汇总的值字段。","新增要彙總的值欄位。","Añade un campo de valor para resumir.","Ajoutez un champ de valeurs à synthétiser.","Ein Wertfeld zum Zusammenfassen hinzufügen.","Aggiungi un campo valore da riepilogare.","Adicione um campo de valor para resumir."],
"Add another rule": ["ルールを追加","添加规则","新增規則","Añadir otra regla","Ajouter une règle","Weitere Regel hinzufügen","Aggiungi un’altra regola","Adicionar outra regra"],
"Add column": ["列を追加","添加列","新增欄","Añadir columna","Ajouter la colonne","Spalte hinzufügen","Aggiungi colonna","Adicionar coluna"],
+ "Add field…": ["フィールドを追加…","添加字段…","新增欄位…","Añadir campo…","Ajouter un champ…","Feld hinzufügen…","Aggiungi campo…","Adicionar campo…"],
"Add sheets from an .xlsx workbook": [".xlsx ブックからシートを追加","从 .xlsx 工作簿添加工作表","從 .xlsx 活頁簿新增工作表","Añadir hojas desde un libro .xlsx","Ajouter des feuilles depuis un classeur .xlsx","Blätter aus einer .xlsx-Arbeitsmappe hinzufügen","Aggiungi fogli da una cartella di lavoro .xlsx","Adicionar planilhas de uma pasta .xlsx"],
"Align": ["配置","对齐","對齊","Alineación","Alignement","Ausrichtung","Allineamento","Alinhamento"],
+ "All": ["すべて","全部","全部","Todo","Tout","Alle","Tutti","Tudo"],
"All sheets": ["すべてのシート","所有工作表","所有工作表","Todas las hojas","Toutes les feuilles","Alle Blätter","Tutti i fogli","Todas as planilhas"],
"Allow empty": ["空を許可","允许为空","允許為空","Permitir vacío","Autoriser le vide","Leer zulassen","Consenti vuoto","Permitir vazio"],
"An update is verified before anything is rewritten: the release manifest is signed, and its signature is checked against a key inside this file.": ["更新は、何かが書き換えられる前に検証されます。リリースマニフェストには署名があり、その署名はこのファイルの中の鍵で確認されます。","在改写任何内容之前,更新都会先经过验证:发布清单带有签名,其签名会用此文件内的密钥校验。","改寫任何內容之前都會先驗證更新:發行資訊清單經過簽署,其簽章會以此檔案內的金鑰檢查。","Una actualización se verifica antes de reescribir nada: el manifiesto de la versión va firmado y su firma se comprueba con una clave incluida en este archivo.","Une mise à jour est vérifiée avant toute réécriture : le manifeste de version est signé, et sa signature est contrôlée avec une clé contenue dans ce fichier.","Ein Update wird geprüft, bevor irgendetwas überschrieben wird: das Release-Manifest ist signiert, und seine Signatur wird gegen einen Schlüssel in dieser Datei geprüft.","Un aggiornamento viene verificato prima di riscrivere qualsiasi cosa: il manifesto della release è firmato e la firma viene controllata con una chiave contenuta in questo file.","Uma atualização é verificada antes de qualquer reescrita: o manifesto da versão é assinado, e sua assinatura é conferida com uma chave dentro deste arquivo."],
@@ -75,6 +80,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Author": ["作成者","作者","作者","Autor","Auteur","Autor","Autore","Autor"],
"Auto": ["自動","自动","自動","Automático","Auto","Automatisch","Automatico","Automático"],
"Average": ["平均","平均值","平均值","Promedio","Moyenne","Mittelwert","Media","Média"],
+ "Axis": ["軸","坐标轴","座標軸","Eje","Axe","Achse","Asse","Eixo"],
"Background": ["背景","背景","背景","Fondo","Arrière-plan","Hintergrund","Sfondo","Fundo"],
"Bar": ["棒","柱状","長條","Barras","Barres","Balken","Barre","Barras"],
"Bar colour": ["バーの色","数据条颜色","資料橫條顏色","Color de la barra","Couleur de la barre","Balkenfarbe","Colore della barra","Cor da barra"],
@@ -92,6 +98,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Cancelled — nothing was changed.": ["中止しました — 何も変更されていません。","已取消 — 未做任何更改。","已取消 — 沒有任何變更。","Cancelado: no se ha cambiado nada.","Annulé — rien n’a été modifié.","Abgebrochen — nichts wurde geändert.","Annullato — non è stato modificato nulla.","Cancelado — nada foi alterado."],
"Caption": ["キャプション","说明文字","說明文字","Descripción","Libellé","Beschriftung","Didascalia","Legenda"],
"Capture current view": ["現在のビューを取り込む","捕获当前视图","擷取目前檢視","Capturar la vista actual","Capturer la vue actuelle","Aktuelle Ansicht festhalten","Acquisisci la vista corrente","Capturar a visão atual"],
+ "Categories": ["カテゴリ","类别","類別","Categorías","Catégories","Kategorien","Categorie","Categorias"],
"Category": ["カテゴリ","类别","類別","Categoría","Catégorie","Kategorie","Categoria","Categoria"],
"Cell": ["セル","单元格","儲存格","Celda","Cellule","Zelle","Cella","Célula"],
"Center": ["中央揃え","居中","置中","Centro","Centre","Zentriert","Centro","Centro"],
@@ -105,6 +112,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Checked at launch — you have the newest version ({v}).": ["起動時に確認しました — 最新バージョン ({v}) です。","启动时已检查 — 你使用的是最新版本({v})。","啟動時已檢查 — 你使用的是最新版本({v})。","Comprobado al abrir: tienes la versión más reciente ({v}).","Vérifié au démarrage — vous avez la version la plus récente ({v}).","Beim Start geprüft — Sie haben die neueste Version ({v}).","Controllato all’avvio: hai la versione più recente ({v}).","Verificado na abertura — você tem a versão mais recente ({v})."],
"Checking…": ["確認中…","检查中…","檢查中…","Comprobando…","Vérification…","Prüfe…","Verifica in corso…","Verificando…"],
"Choose a password. There is no way to recover it.": ["パスワードを決めてください。復元する方法はありません。","设置一个密码。它无法找回。","請設定密碼。沒有任何方法可以找回它。","Elige una contraseña. No hay forma de recuperarla.","Choisissez un mot de passe. Il est impossible de le récupérer.","Wähle ein Passwort. Es lässt sich nicht wiederherstellen.","Scegli una password. Non c’è modo di recuperarla.","Escolha uma senha. Não há como recuperá-la."],
+ "Choose which values to include": ["含める値を選択","选择要包含的值","選擇要包含的值","Elegir qué valores incluir","Choisir les valeurs à inclure","Auswählen, welche Werte einbezogen werden","Scegli quali valori includere","Escolher que valores incluir"],
"Clear": ["クリア","清除","清除","Borrar","Effacer","Leeren","Cancella","Limpar"],
"Clear all": ["すべてクリア","全部清除","全部清除","Borrar todo","Tout effacer","Alles löschen","Cancella tutto","Limpar tudo"],
"Clear contents": ["内容をクリア","清除内容","清除內容","Borrar contenido","Effacer le contenu","Inhalte löschen","Cancella contenuto","Limpar conteúdo"],
@@ -120,6 +128,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Close (Esc)": ["閉じる (Esc)","关闭 (Esc)","關閉 (Esc)","Cerrar (Esc)","Fermer (Esc)","Schließen (Esc)","Chiudi (Esc)","Fechar (Esc)"],
"Close find (Esc)": ["検索を閉じる (Esc)","关闭查找 (Esc)","關閉尋找 (Esc)","Cerrar la búsqueda (Esc)","Fermer la recherche (Échap)","Suche schließen (Esc)","Chiudi la ricerca (Esc)","Fechar a busca (Esc)"],
"Close the story editor": ["ストーリーエディターを閉じる","关闭故事编辑器","關閉故事編輯器","Cerrar el editor de historias","Fermer l’éditeur d’histoire","Story-Editor schließen","Chiudi l’editor della storia","Fechar o editor de narrativa"],
+ "Colour of {name}": ["{name} の色","{name}的颜色","{name}的顏色","Color de {name}","Couleur de {name}","Farbe von {name}","Colore di {name}","Cor de {name}"],
"Colour scale": ["カラースケール","色阶","色階","Escala de color","Nuances de couleurs","Farbskala","Scala di colori","Escala de cores"],
"Column": ["列","列","欄","Columna","Colonne","Spalte","Colonna","Coluna"],
"Column name": ["列名","列名","欄名稱","Nombre de la columna","Nom de la colonne","Spaltenname","Nome colonna","Nome da coluna"],
@@ -181,16 +190,23 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Download this workbook as .xlsx": ["このブックを .xlsx でダウンロード","将此工作簿下载为 .xlsx","將此活頁簿下載為 .xlsx","Descargar este libro como .xlsx","Télécharger ce classeur au format .xlsx","Diese Arbeitsmappe als .xlsx herunterladen","Scarica questa cartella di lavoro come .xlsx","Baixar esta pasta de trabalho como .xlsx"],
"Downloaded. Open the new file — this one is unchanged.": ["ダウンロードしました。新しいファイルを開いてください — このファイルは変更されていません。","已下载。请打开新文件 — 当前文件未改动。","已下載。請開啟新檔案 — 目前這個檔案未被更動。","Descargado. Abre el archivo nuevo — este no ha cambiado.","Téléchargé. Ouvrez le nouveau fichier — celui-ci est inchangé.","Heruntergeladen. Öffne die neue Datei — diese hier bleibt unverändert.","Scaricato. Apri il nuovo file — questo resta invariato.","Baixado. Abra o novo arquivo — este permanece inalterado."],
"Downloading and verifying…": ["ダウンロードして検証しています…","正在下载并验证…","下載並驗證中…","Descargando y verificando…","Téléchargement et vérification…","Wird heruntergeladen und geprüft…","Download e verifica in corso…","Baixando e verificando…"],
+ "Drag a field into an area below, or tick it.": ["フィールドを下の領域にドラッグするか、チェックを付けます。","将字段拖到下方区域,或勾选它。","將欄位拖到下方區域,或勾選它。","Arrastra un campo a un área de abajo, o márcalo.","Faites glisser un champ dans une zone ci-dessous, ou cochez-le.","Ziehen Sie ein Feld in einen Bereich unten, oder haken Sie es an.","Trascina un campo in un’area qui sotto, oppure spuntalo.","Arraste um campo para uma área abaixo, ou assinale-o."],
"Drag the small square at the corner of the selection to fill — dash continues 1, 2, 3 and Jan, Feb, Mar, and repeats anything it cannot read as a series.": ["選択範囲の角にある小さな四角をドラッグするとフィルできます — dash は 1, 2, 3 や Jan, Feb, Mar を続け、連続データとして読めないものはそのまま繰り返します。","拖动选区角上的小方块即可填充 — dash 会续写 1、2、3 和 Jan、Feb、Mar,无法识别为序列的内容则重复填充。","拖曳選取範圍角落的小方塊即可填滿 — dash 會接續 1、2、3 和 Jan、Feb、Mar,無法辨識成數列的內容則會重複。","Arrastra el cuadrito de la esquina de la selección para rellenar: dash continúa 1, 2, 3 y ene, feb, mar, y repite todo lo que no puede leer como serie.","Faites glisser le petit carré au coin de la sélection pour recopier — dash poursuit 1, 2, 3 et janv., févr., mars, et répète tout ce qu’il ne peut pas lire comme une série.","Das kleine Quadrat an der Ecke der Auswahl ziehen, um auszufüllen — dash setzt 1, 2, 3 und Jan, Feb, Mär fort und wiederholt alles, was es nicht als Reihe erkennt.","Trascina il quadratino nell’angolo della selezione per riempire — dash continua 1, 2, 3 e gen, feb, mar, e ripete ciò che non riesce a leggere come serie.","Arraste o quadradinho no canto da seleção para preencher — o dash continua 1, 2, 3 e jan, fev, mar, e repete o que não conseguir ler como sequência."],
"Drag to fill the selection down or across": ["ドラッグして選択範囲を下方向または右方向にフィル","拖动以向下或向右填充选定区域","拖曳以向下或向右填滿選取範圍","Arrastra para rellenar la selección hacia abajo o a los lados","Faites glisser pour recopier la sélection vers le bas ou sur le côté","Ziehen, um die Auswahl nach unten oder zur Seite auszufüllen","Trascina per riempire la selezione verso il basso o di lato","Arraste para preencher a seleção para baixo ou para os lados"],
"Drag to resize the column": ["ドラッグして列の幅を変更","拖动以调整列宽","拖曳以調整欄寬","Arrastra para cambiar el ancho de la columna","Faites glisser pour redimensionner la colonne","Ziehen, um die Spaltenbreite zu ändern","Trascina per ridimensionare la colonna","Arraste para redimensionar a coluna"],
"Drag to resize the row": ["ドラッグして行の高さを変更","拖动以调整行高","拖曳以調整列高","Arrastra para cambiar el alto de la fila","Faites glisser pour redimensionner la ligne","Ziehen, um die Zeilenhöhe zu ändern","Trascina per ridimensionare la riga","Arraste para redimensionar a linha"],
"Drag to resize · double-click to reset": ["ドラッグでサイズ変更 · ダブルクリックでリセット","拖动调整大小 · 双击重置","拖曳調整大小 · 連按兩下重設","Arrastra para redimensionar · doble clic para restablecer","Glisser pour redimensionner · double-clic pour réinitialiser","Ziehen zum Anpassen · Doppelklick zum Zurücksetzen","Trascina per ridimensionare · doppio clic per azzerare","Arraste para redimensionar · duplo clique para restaurar"],
"Drag to resize, double-click to fit the widest value": ["ドラッグして幅を変更、ダブルクリックで最も長い値に合わせる","拖动以调整宽度,双击以适应最宽的值","拖曳以調整寬度,按兩下以符合最寬的值","Arrastra para cambiar el ancho; haz doble clic para ajustar al valor más ancho","Faites glisser pour redimensionner, double-cliquez pour ajuster à la valeur la plus large","Ziehen zum Ändern der Breite, Doppelklick für den breitesten Wert","Trascina per ridimensionare, fai doppio clic per adattare al valore più largo","Arraste para redimensionar, duplo clique para ajustar ao valor mais largo"],
+ "Draw a line anyway": ["それでも線を描く","仍然绘制折线","仍然繪製折線","Dibujar una línea de todos modos","Tracer une ligne quand même","Trotzdem eine Linie zeichnen","Disegna comunque una linea","Desenhar uma linha mesmo assim"],
+ "Drawn as bars: {col} has no order for a line to follow.": ["棒で表示しています: {col} には線がたどる順序がありません。","已绘制为柱状:{col} 没有可供折线遵循的顺序。","已繪製為長條:{col} 沒有可供折線依循的順序。","Dibujado como barras: {col} no tiene un orden que una línea pueda seguir.","Tracé en barres : {col} n’a pas d’ordre qu’une ligne puisse suivre.","Als Balken gezeichnet: {col} hat keine Reihenfolge, der eine Linie folgen könnte.","Disegnato a barre: {col} non ha un ordine che una linea possa seguire.","Desenhado como barras: {col} não tem uma ordem que uma linha possa seguir."],
+ "Drop a field here": ["ここにフィールドをドロップ","将字段拖放到此处","將欄位拖放到此處","Suelta un campo aquí","Déposez un champ ici","Feld hier ablegen","Rilascia qui un campo","Largue um campo aqui"],
+ "Drop a field here to summarise it": ["集計するフィールドをここにドロップ","将字段拖放到此处进行汇总","將欄位拖放到此處進行彙總","Suelta un campo aquí para resumirlo","Déposez un champ ici pour le résumer","Feld hier ablegen, um es zusammenzufassen","Rilascia qui un campo per riepilogarlo","Largue um campo aqui para o resumir"],
"Drop to open": ["ドロップして開く","松开以打开","放開以開啟","Suelta para abrir","Déposez pour ouvrir","Zum Öffnen ablegen","Rilascia per aprire","Solte para abrir"],
"Duplicate": ["複製","创建副本","建立副本","Duplicar","Dupliquer","Duplizieren","Duplica","Duplicar"],
"Duplicate values": ["重複する値","重复值","重複的值","Valores duplicados","Valeurs en double","Doppelte Werte","Valori duplicati","Valores duplicados"],
+ "Edit": ["編集","编辑","編輯","Editar","Modifier","Bearbeiten","Modifica","Editar"],
"Edit the active cell, keeping what is in it": ["アクティブセルの内容を残したまま編集する","编辑活动单元格,保留其中的内容","編輯作用儲存格,保留裡面原有的內容","Editar la celda activa conservando su contenido","Modifier la cellule active en conservant son contenu","Die aktive Zelle bearbeiten, ohne den Inhalt zu ersetzen","Modifica la cella attiva mantenendone il contenuto","Editar a célula ativa, mantendo o que há nela"],
+ "Edit this chart": ["このグラフを編集","编辑此图表","編輯此圖表","Editar este gráfico","Modifier ce graphique","Dieses Diagramm bearbeiten","Modifica questo grafico","Editar este gráfico"],
"Encrypts the workbook inside the file. There is no recovery — lose it and the data is gone.": ["ファイルの中のブックを暗号化します。復元する方法はありません — 忘れるとデータは失われます。","加密文件内的工作簿。它无法找回 — 密码丢了,数据也就没了。","將檔案裡的活頁簿加密。沒有任何救回的方法 — 密碼弄丟,資料就沒了。","Cifra el libro dentro del archivo. No hay recuperación posible: si la pierdes, los datos se pierden.","Chiffre le classeur à l’intérieur du fichier. Aucune récupération n’est possible — perdez-le et les données sont perdues.","Verschlüsselt die Arbeitsmappe in der Datei. Es gibt keine Wiederherstellung — geht es verloren, sind die Daten weg.","Cifra la cartella di lavoro dentro il file. Non c’è recupero — se la perdi, i dati sono persi.","Criptografa a pasta de trabalho dentro do arquivo. Não há recuperação — perdeu a senha, perdeu os dados."],
"Enter the password to open this workbook.": ["このブックを開くにはパスワードを入力してください。","输入密码以打开此工作簿。","請輸入密碼以開啟此活頁簿。","Escribe la contraseña para abrir este libro.","Saisissez le mot de passe pour ouvrir ce classeur.","Passwort eingeben, um diese Arbeitsmappe zu öffnen.","Inserisci la password per aprire questa cartella di lavoro.","Digite a senha para abrir esta pasta de trabalho."],
"Entering data": ["データの入力","输入数据","輸入資料","Introducción de datos","Saisie des données","Daten eingeben","Inserimento dati","Inserindo dados"],
@@ -205,6 +221,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Extend to the first column": ["先頭の列まで広げる","扩展到第一列","延伸到第一欄","Ampliar hasta la primera columna","Étendre jusqu’à la première colonne","Bis zur ersten Spalte erweitern","Estendi alla prima colonna","Estender até a primeira coluna"],
"Extend to the last cell of the sheet": ["シートの最終セルまで広げる","扩展到工作表的最后一个单元格","延伸到工作表的最後一個儲存格","Ampliar hasta la última celda de la hoja","Étendre jusqu’à la dernière cellule de la feuille","Bis zur letzten Zelle des Blatts erweitern","Estendi all’ultima cella del foglio","Estender até a última célula da planilha"],
"Extend to the last column": ["最後の列まで広げる","扩展到最后一列","延伸到最後一欄","Ampliar hasta la última columna","Étendre jusqu’à la dernière colonne","Bis zur letzten Spalte erweitern","Estendi all’ultima colonna","Estender até a última coluna"],
+ "Fields": ["フィールド","字段","欄位","Campos","Champs","Felder","Campi","Campos"],
"File": ["ファイル","文件","檔案","Archivo","Fichier","Datei","File","Arquivo"],
"Fill down": ["下方向へコピー","向下填充","向下填滿","Rellenar hacia abajo","Recopier vers le bas","Nach unten ausfüllen","Riempi in basso","Preencher para baixo"],
"Fill the selection down from its top row": ["選択範囲を先頭行から下方向へコピーする","以选区首行向下填充整个选区","從選取範圍的第一列向下填滿","Rellenar la selección hacia abajo desde su primera fila","Recopier la sélection vers le bas depuis sa première ligne","Die Auswahl von ihrer obersten Zeile aus nach unten ausfüllen","Riempi la selezione verso il basso a partire dalla prima riga","Preencher a seleção para baixo a partir da primeira linha"],
@@ -213,6 +230,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Filtered by": ["フィルター条件","筛选依据","篩選依據","Filtrado por","Filtré par","Gefiltert nach","Filtrato per","Filtrado por"],
"Filtering and sorting reorder the rows of a dataset. A spreadsheet has rows of cells, not of records — so there is nothing here to filter by.": ["フィルターと並べ替えはデータセットの行を並べ替えるものです。スプレッドシートの行はレコードではなくセルの並びなので、フィルターの基準になるものがありません。","筛选和排序重排的是数据集的行。电子表格的行是单元格,不是记录,因此这里没有可用于筛选的依据。","篩選與排序重排的是資料集的列。試算表的列是儲存格,不是記錄,因此這裡沒有可用於篩選的依據。","Filtrar y ordenar reordenan las filas de un conjunto de datos. Una hoja de cálculo tiene filas de celdas, no de registros, así que aquí no hay nada por lo que filtrar.","Filtrer et trier réorganisent les lignes d’un jeu de données. Une feuille de calcul a des lignes de cellules, pas d’enregistrements : il n’y a donc rien ici sur quoi filtrer.","Filtern und Sortieren ordnen die Zeilen eines Datensatzes um. Eine Tabelle hat Zeilen aus Zellen, nicht aus Datensätzen — hier gibt es also nichts, wonach gefiltert werden könnte.","Filtrare e ordinare riordinano le righe di un set di dati. Un foglio di calcolo ha righe di celle, non di record: qui non c’è nulla in base a cui filtrare.","Filtrar e ordenar reorganizam as linhas de um conjunto de dados. Uma planilha tem linhas de células, não de registros — então não há nada aqui por que filtrar."],
"Filtering: {what}": ["フィルター: {what}","正在筛选:{what}","正在篩選:{what}","Filtrando: {what}","Filtre : {what}","Filter: {what}","Filtro: {what}","Filtrando: {what}"],
+ "Filters": ["フィルター","筛选","篩選","Filtros","Filtres","Filter","Filtri","Filtros"],
"Find": ["検索","查找","尋找","Buscar","Rechercher","Suchen","Trova","Localizar"],
"Find in all sheets": ["すべてのシートを検索","在所有工作表中查找","在所有工作表中尋找","Buscar en todas las hojas","Rechercher dans toutes les feuilles","In allen Blättern suchen","Trova in tutti i fogli","Localizar em todas as planilhas"],
"Find in the sheet — the grid is windowed, so the browser’s own ⌘F cannot see it all": ["シート内を検索 — グリッドは表示範囲のみを描画するため、ブラウザーの ⌘F では全体を見られません","在工作表中查找 — 网格只渲染可见部分,浏览器自带的 ⌘F 看不到全部","在工作表中尋找 — 格線只繪製可見部分,瀏覽器自身的 ⌘F 看不到全部","Buscar en la hoja: la cuadrícula solo dibuja lo visible, así que el ⌘F del navegador no lo ve todo","Rechercher dans la feuille — la grille n’affiche que le visible, le ⌘F du navigateur n’en voit donc pas la totalité","Im Blatt suchen — das Raster zeichnet nur das Sichtbare, das ⌘F des Browsers sieht daher nicht alles","Trova nel foglio — la griglia disegna solo ciò che è visibile, quindi il ⌘F del browser non vede tutto","Localizar na planilha — a grade é virtualizada, então o ⌘F do navegador não enxerga tudo"],
@@ -238,6 +256,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Go to the previous match": ["前の一致へ移動","转到上一个匹配项","移至上一個相符項","Ir a la coincidencia anterior","Aller à l’occurrence précédente","Zum vorherigen Treffer springen","Vai alla corrispondenza precedente","Ir para a ocorrência anterior"],
"Good to know": ["知っておくと便利","小贴士","小提示","Bueno saber","Bon à savoir","Gut zu wissen","Buono a sapersi","Vale saber"],
"Grand total": ["総計","总计","總計","Total general","Total général","Gesamtergebnis","Totale complessivo","Total geral"],
+ "Grand totals": ["総計","总计","總計","Totales generales","Totaux généraux","Gesamtergebnisse","Totali complessivi","Totais gerais"],
"Hidden": ["非表示","已隐藏","已隱藏","Oculta","Masqué","Ausgeblendet","Nascosta","Oculto"],
"Hidden columns": ["非表示の列","隐藏的列","隱藏的欄","Columnas ocultas","Colonnes masquées","Ausgeblendete Spalten","Colonne nascoste","Colunas ocultas"],
"Hide chart": ["グラフを隠す","隐藏图表","隱藏圖表","Ocultar el gráfico","Masquer le graphique","Diagramm ausblenden","Nascondi grafico","Ocultar o gráfico"],
@@ -252,10 +271,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Highlight duplicate values": ["重複する値を強調表示","突出显示重复值","醒目提示重複的值","Resaltar valores duplicados","Surligner les valeurs en double","Doppelte Werte hervorheben","Evidenzia i valori duplicati","Destacar valores duplicados"],
"How far to search": ["検索する範囲","搜索范围","搜尋範圍","Alcance de la búsqueda","Étendue de la recherche","Suchbereich","Ambito della ricerca","Onde procurar"],
"How many": ["件数","数量","數量","Cuántas","Combien","Wie viele","Quante","Quantos"],
+ "How to summarise {name}": ["{name} の集計方法","如何汇总{name}","如何彙總{name}","Cómo resumir {name}","Comment résumer {name}","Wie {name} zusammengefasst wird","Come riepilogare {name}","Como resumir {name}"],
"Import CSV…": ["CSV を読み込む…","导入 CSV…","匯入 CSV…","Importar CSV…","Importer un CSV…","CSV importieren…","Importa CSV…","Importar CSV…"],
"Import Excel…": ["Excel を読み込む…","导入 Excel…","匯入 Excel…","Importar de Excel…","Importer depuis Excel…","Excel importieren…","Importa Excel…","Importar Excel…"],
"Import and export CSV and Excel files": ["CSV と Excel ファイルの読み込みと書き出し","导入和导出 CSV 与 Excel 文件","匯入與匯出 CSV 和 Excel 檔案","Importar y exportar archivos CSV y Excel","Importer et exporter des fichiers CSV et Excel","CSV- und Excel-Dateien importieren und exportieren","Importa ed esporta file CSV ed Excel","Importar e exportar arquivos CSV e Excel"],
"Imported {n} sheet(s) from “{name}”.": ["「{name}」から {n} 個のシートを読み込みました。","已从“{name}”导入 {n} 个工作表。","已從「{name}」匯入 {n} 張工作表。","Se han importado {n} hoja(s) de “{name}”.","{n} feuille(s) importée(s) depuis « {name} ».","{n} Blatt/Blätter aus „{name}“ importiert.","Importati {n} fogli da “{name}”.","{n} planilha(s) importada(s) de “{name}”."],
+ "In order": ["順序あり","有顺序","有順序","En orden","Ordonnées","Geordnet","In ordine","Por ordem"],
"In-cell dropdown": ["セル内のドロップダウン","单元格内下拉列表","儲存格內下拉式清單","Desplegable en la celda","Liste déroulante dans la cellule","Auswahlliste in der Zelle","Elenco a discesa nella cella","Lista suspensa na célula"],
"Infer a type for each column and add a dataset sheet. The spreadsheet keeps these cells — the dataset is a copy of them.": ["各列の型を推定してデータセットのシートを追加します。スプレッドシートのセルはそのまま残り、データセットはそのコピーです。","为每列推断类型并添加一个数据集工作表。电子表格保留这些单元格 — 数据集是它们的副本。","為每欄推斷型別並新增一個資料集工作表。試算表保留這些儲存格 — 資料集是它們的副本。","Deduce un tipo para cada columna y añade una hoja de conjunto de datos. La hoja de cálculo conserva estas celdas: el conjunto de datos es una copia de ellas.","Déduit un type par colonne et ajoute une feuille de jeu de données. La feuille de calcul conserve ces cellules — le jeu de données en est une copie.","Leitet für jede Spalte einen Typ ab und fügt ein Datensatzblatt hinzu. Das Tabellenblatt behält diese Zellen — der Datensatz ist eine Kopie davon.","Deduce un tipo per ogni colonna e aggiunge un foglio set di dati. Il foglio di calcolo mantiene queste celle: il set di dati ne è una copia.","Inferir um tipo para cada coluna e adicionar uma planilha de conjunto de dados. A planilha mantém estas células — o conjunto de dados é uma cópia delas."],
"Insert": ["挿入","插入","插入","Insertar","Insérer","Einfügen","Inserisci","Inserir"],
@@ -285,7 +306,9 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Leave the bounds empty to scale from this column’s own data. Set them and two columns can be coloured on one scale, and compared.": ["範囲を空にすると、この列のデータから目盛りを決めます。指定すると、2 つの列を同じ目盛りで色分けして比較できます。","留空则按本列自身的数据确定标度;填写后,两列可以用同一标度着色并互相比较。","留空則依本欄自身的資料決定刻度;填入後,兩欄可以用同一刻度上色並互相比較。","Deja los límites vacíos para escalar con los datos de esta columna. Fíjalos y dos columnas podrán colorearse en la misma escala, y compararse.","Laissez les bornes vides pour utiliser les données de cette colonne. Fixez-les et deux colonnes peuvent être colorées sur la même échelle, donc comparées.","Grenzen leer lassen, dann skaliert die Spalte nach ihren eigenen Daten. Gesetzt lassen sich zwei Spalten auf derselben Skala einfärben und vergleichen.","Lascia i limiti vuoti per scalare sui dati di questa colonna. Impostandoli, due colonne si colorano sulla stessa scala e si possono confrontare.","Deixe os limites vazios para escalar pelos dados da própria coluna. Defina-os e duas colunas podem ser coloridas numa mesma escala, e comparadas."],
"Leave the text colour alone": ["文字色は変更しない","保持文字颜色不变","保持文字顏色不變","No tocar el color del texto","Ne pas toucher à la couleur du texte","Textfarbe unverändert lassen","Non toccare il colore del testo","Não alterar a cor do texto"],
"Left": ["左揃え","左对齐","靠左","Izquierda","Gauche","Links","Sinistra","Esquerda"],
+ "Legend": ["凡例","图例","圖例","Leyenda","Légende","Legende","Legenda","Legenda"],
"Light": ["ライト","浅色","淺色","Claro","Clair","Hell","Chiaro","Claro"],
+ "Line": ["折れ線","折线","折線","Líneas","Lignes","Linie","Linee","Linhas"],
"List": ["リスト","列表","清單","Lista","Liste","Liste","Elenco","Lista"],
"Lowest": ["最小値","最低值","最低值","Mínimo","Minimum","Niedrigster Wert","Minimo","Menor"],
"Lowest values": ["下位から","最低的若干项","最低的若干項","Los más bajos","Les plus basses","Die niedrigsten","I più bassi","Menores valores"],
@@ -338,6 +361,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"No formatting": ["書式なし","无格式","無格式","Sin formato","Aucune mise en forme","Keine Formatierung","Nessuna formattazione","Sem formatação"],
"No matches": ["一致なし","无匹配项","無相符項","Sin coincidencias","Aucune occurrence","Keine Treffer","Nessuna corrispondenza","Nenhuma ocorrência"],
"No numeric values in this column for the current selection.": ["現在の選択範囲では、この列に数値がありません。","在当前选择下,此列没有数值。","在目前的選取範圍中,此欄沒有數值。","No hay valores numéricos en esta columna para la selección actual.","Aucune valeur numérique dans cette colonne pour la sélection actuelle.","Keine numerischen Werte in dieser Spalte für die aktuelle Auswahl.","Nessun valore numerico in questa colonna per la selezione corrente.","Nenhum valor numérico nesta coluna para a seleção atual."],
+ "No order — as they appear in the sheet": ["順序なし — シートに現れる順","无顺序——按其在工作表中出现的次序","無順序——依其在工作表中出現的次序","Sin orden: tal como aparecen en la hoja","Sans ordre — dans l’ordre où elles apparaissent dans la feuille","Ohne Reihenfolge – so, wie sie im Blatt erscheinen","Senza ordine: come appaiono nel foglio","Sem ordem — tal como aparecem na folha"],
"No page header": ["ページヘッダーなし","不要页眉","不要頁首","Sin encabezado de página","Aucun en-tête de page","Keine Seitenkopfzeile","Nessuna intestazione di pagina","Sem cabeçalho de página"],
"No rows match the current selection.": ["現在の選択条件に一致する行はありません。","没有行符合当前选择。","沒有符合目前選取範圍的列。","Ninguna fila coincide con la selección actual.","Aucune ligne ne correspond à la sélection actuelle.","Keine Zeilen passen zur aktuellen Auswahl.","Nessuna riga corrisponde alla selezione corrente.","Nenhuma linha corresponde à seleção atual."],
"No rows to total — the filter leaves none showing.": ["合計する行がありません — フィルターで 1 行も表示されていません。","没有可合计的行——筛选后没有任何行显示。","沒有可合計的列——篩選後沒有任何列顯示。","No hay filas que sumar: el filtro no deja ninguna a la vista.","Aucune ligne à totaliser — le filtre n’en laisse aucune visible.","Keine Zeilen zum Summieren – der Filter lässt keine sichtbar.","Nessuna riga da totalizzare: il filtro non ne lascia visibile nessuna.","Nenhuma linha para totalizar — o filtro não deixa nenhuma visível."],
@@ -347,6 +371,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"No total": ["集計なし","无汇总","無合計","Sin total","Aucun total","Keine Summe","Nessun totale","Sem total"],
"No versions kept yet — they accumulate as you edit.": ["保存されたバージョンはまだありません — 編集するにつれて増えていきます。","尚未保留任何版本 — 版本会随着编辑逐步积累。","尚未保留任何版本 — 版本會隨著編輯逐漸累積。","Todavía no se guarda ninguna versión: se van acumulando a medida que editas.","Aucune version conservée pour l’instant — elles s’accumulent au fil des modifications.","Noch keine Versionen vorhanden — sie sammeln sich beim Bearbeiten an.","Ancora nessuna versione conservata — si accumulano man mano che modifichi.","Ainda não há versões guardadas — elas se acumulam conforme você edita."],
"None": ["なし","无","無","Ninguno","Aucune","Keine","Nessuno","Nenhum"],
+ "None — one point per row": ["なし — 行ごとに 1 点","无——每行一个点","無——每列一個點","Ninguno: un punto por fila","Aucun — un point par ligne","Keine – ein Punkt pro Zeile","Nessuno: un punto per riga","Nenhum — um ponto por linha"],
"Normal — 12mm": ["標準 — 12mm","常规 — 12mm","標準 — 12mm","Normal — 12 mm","Normales — 12 mm","Normal — 12 mm","Normali — 12 mm","Normais — 12 mm"],
"Not a number — left out of totals, and a formula that reads it gives #VALUE!": ["数値ではありません — 合計から除外され、これを参照する数式は #VALUE! になります","不是数字 — 未计入合计,读取它的公式会得到 #VALUE!","不是數字 — 未計入合計,讀取它的公式會得到 #VALUE!","No es un número: queda fuera de los totales, y una fórmula que lo lea da #VALUE!","Pas un nombre — exclu des totaux, et une formule qui le lit donne #VALUE!","Keine Zahl — aus den Summen ausgenommen, und eine Formel, die sie liest, ergibt #VALUE!","Non è un numero — escluso dai totali, e una formula che lo legge dà #VALUE!","Não é um número — fica fora dos totais, e uma fórmula que o lê dá #VALUE!"],
"Not set": ["未設定","未设置","未設定","Sin definir","Non défini","Nicht festgelegt","Non impostato","Não definido"],
@@ -368,6 +393,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"One of: {list}": ["次のいずれか: {list}","以下之一:{list}","以下之一:{list}","Uno de: {list}","L’un de : {list}","Eines von: {list}","Uno tra: {list}","Um destes: {list}"],
"Only English so far.": ["今のところ英語のみです。","目前仅有英语。","目前只有英文。","Por ahora solo en inglés.","Uniquement en anglais pour l’instant.","Bisher nur Englisch.","Per ora solo inglese.","Somente em inglês por enquanto."],
"Only the first {n} cells of this selection will be changed.": ["この選択範囲のうち先頭 {n} セルのみが変更されます。","仅更改此选定区域中的前 {n} 个单元格。","僅變更此選取範圍中的前 {n} 個儲存格。","Solo se cambiarán las primeras {n} celdas de esta selección.","Seules les {n} premières cellules de cette sélection seront modifiées.","Nur die ersten {n} Zellen dieser Auswahl werden geändert.","Verranno modificate solo le prime {n} celle di questa selezione.","Apenas as primeiras {n} células desta seleção serão alteradas."],
+ "Only the first {n} values are listed.": ["最初の {n} 個の値だけを表示しています。","仅列出前 {n} 个值。","僅列出前 {n} 個值。","Solo se muestran los primeros {n} valores.","Seules les {n} premières valeurs sont listées.","Nur die ersten {n} Werte sind aufgeführt.","Sono elencati solo i primi {n} valori.","Só os primeiros {n} valores estão listados."],
"Only the first {n} values fit this list. Tick the ones to keep, search to reach the rest, or use a condition below.": ["このリストに収まるのは最初の {n} 件だけです。残したい値にチェックを入れるか、検索で残りを探すか、下の条件を使ってください。","此列表只能容纳前 {n} 个值。勾选要保留的值,用搜索找到其余的值,或使用下方的条件。","此清單只能容納前 {n} 個值。勾選要保留的值,用搜尋找到其餘的值,或使用下方的條件。","En esta lista solo caben los primeros {n} valores. Marca los que quieras conservar, busca para llegar al resto o usa una condición más abajo.","Cette liste ne contient que les {n} premières valeurs. Cochez celles à conserver, cherchez pour atteindre les autres, ou utilisez un critère ci-dessous.","In diese Liste passen nur die ersten {n} Werte. Haken Sie die zu behaltenden an, suchen Sie nach den übrigen, oder nutzen Sie unten eine Bedingung.","In questo elenco stanno solo i primi {n} valori. Spunta quelli da mantenere, cerca per raggiungere gli altri oppure usa una condizione qui sotto.","Apenas os primeiros {n} valores cabem nesta lista. Marque os que quer manter, busque para alcançar os demais, ou use uma condição abaixo."],
"Open": ["開く","打开","開啟","Abrir","Ouvrir","Öffnen","Apri","Abrir"],
"Open \"{name}\" as a spreadsheet": ["「{name}」をスプレッドシートとして開く","以电子表格方式打开“{name}”","以試算表方式開啟「{name}」","Abrir «{name}» como hoja de cálculo","Ouvrir « {name} » comme feuille de calcul","„{name}“ als Tabellenblatt öffnen","Apri «{name}» come foglio di calcolo","Abrir “{name}” como planilha"],
@@ -391,7 +417,11 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Paste special…": ["形式を選択して貼り付け…","选择性粘贴…","選擇性貼上…","Pegado especial…","Collage spécial…","Inhalte einfügen…","Incolla speciale…","Colar especial…"],
"Pattern": ["書式パターン","格式代码","格式代碼","Patrón","Motif","Muster","Modello","Padrão"],
"Percent": ["パーセント","百分比","百分比","Porcentaje","Pourcentage","Prozent","Percentuale","Porcentagem"],
+ "Pie": ["円","饼图","圓形","Circular","Secteurs","Kreis","Torta","Circular"],
"Pivot": ["ピボット","数据透视表","樞紐分析表","Tabla dinámica","Tableau croisé","PivotTable","Tabella pivot","Tabela dinâmica"],
+ "Pivot table": ["ピボットテーブル","数据透视表","樞紐分析表","Tabla dinámica","Tableau croisé","PivotTable","Tabella pivot","Tabela dinâmica"],
+ "Plain numbers": ["書式なしの数値","纯数字","純數字","Números sin formato","Nombres bruts","Reine Zahlen","Numeri semplici","Números simples"],
+ "Plain numbers — the series do not share a format": ["書式なしの数値 — 系列の書式が一致しません","纯数字——各系列的格式不一致","純數字——各數列的格式不一致","Números sin formato: las series no comparten formato","Nombres bruts — les séries n’ont pas le même format","Reine Zahlen – die Reihen haben kein gemeinsames Format","Numeri semplici: le serie non condividono un formato","Números simples — as séries não partilham um formato"],
"Plot three numeric columns in 3D": ["3 つの数値列を 3D でプロットする","以 3D 绘制三个数值列","以 3D 繪製三個數值欄","Representar tres columnas numéricas en 3D","Représenter trois colonnes numériques en 3D","Drei numerische Spalten in 3D darstellen","Rappresenta tre colonne numeriche in 3D","Plotar três colunas numéricas em 3D"],
"Portrait": ["縦","纵向","直向","Vertical","Portrait","Hochformat","Verticale","Retrato"],
"Present ▸": ["プレゼン ▸","演示 ▸","放映 ▸","Presentar ▸","Présenter ▸","Präsentieren ▸","Presenta ▸","Apresentar ▸"],
@@ -418,6 +448,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Remove the password? The next save writes the workbook in the clear.": ["パスワードを削除しますか?次回の保存で、ブックは暗号化されずに書き込まれます。","移除密码?下次保存会以明文写入工作簿。","要移除密碼嗎?下次儲存會以明文寫入活頁簿。","¿Quitar la contraseña? El próximo guardado escribirá el libro sin cifrar.","Supprimer le mot de passe ? Le prochain enregistrement écrira le classeur en clair.","Das Passwort entfernen? Beim nächsten Speichern wird die Arbeitsmappe unverschlüsselt geschrieben.","Rimuovere la password? Il prossimo salvataggio scriverà la cartella di lavoro in chiaro.","Remover a senha? O próximo salvamento grava a pasta de trabalho sem criptografia."],
"Remove this device from the session": ["このデバイスをセッションから削除","将此设备移出会话","將此裝置移出工作階段","Quitar este dispositivo de la sesión","Retirer cet appareil de la session","Dieses Gerät aus der Sitzung entfernen","Rimuovi questo dispositivo dalla sessione","Remover este dispositivo da sessão"],
"Remove this filter": ["このフィルターを削除","移除此筛选","移除此篩選","Quitar este filtro","Supprimer ce filtre","Diesen Filter entfernen","Rimuovi questo filtro","Remover este filtro"],
+ "Remove {name}": ["{name} を削除","移除{name}","移除{name}","Quitar {name}","Retirer {name}","{name} entfernen","Rimuovi {name}","Remover {name}"],
"Rename": ["名前を変更","重命名","重新命名","Cambiar nombre","Renommer","Umbenennen","Rinomina","Renomear"],
"Reopen": ["再オープン","重新打开","重新開啟","Reabrir","Rouvrir","Wieder öffnen","Riapri","Reabrir"],
"Replace": ["置換","替换","取代","Reemplazar","Remplacer","Ersetzen","Sostituisci","Substituir"],
@@ -460,6 +491,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Saved to the file — automatic saving is working again.": ["ファイルに保存しました — 自動保存が再び機能しています。","已保存到文件 — 自动保存恢复正常。","已儲存到檔案 — 自動儲存恢復正常。","Guardado en el archivo — el guardado automático vuelve a funcionar.","Enregistré dans le fichier — la sauvegarde automatique fonctionne à nouveau.","In die Datei gespeichert — das automatische Speichern funktioniert wieder.","Salvato sul file — il salvataggio automatico funziona di nuovo.","Gravado no arquivo — o salvamento automático voltou a funcionar."],
"Saved to {name}": ["{name} に保存しました","已保存到 {name}","已儲存至 {name}","Guardado en {name}","Enregistré dans {name}","In {name} gespeichert","Salvato in {name}","Salvo em {name}"],
"Saving will take a moment.": ["保存には少し時間がかかります。","保存需要一点时间。","儲存需要一點時間。","Guardar llevará un momento.","L’enregistrement prendra un instant.","Das Speichern dauert einen Moment.","Il salvataggio richiederà un momento.","O salvamento vai levar um instante."],
+ "Scatter": ["散布図","散点","散佈","Dispersión","Nuage de points","Streuung","Dispersione","Dispersão"],
"Search the values on screen, or the formulas behind them": ["画面上の値を検索するか、その背後の数式を検索します","搜索屏幕上的值,或其背后的公式","搜尋畫面上的值,或其背後的公式","Busca los valores en pantalla, o las fórmulas que hay detrás","Rechercher les valeurs affichées, ou les formules qui les produisent","Die angezeigten Werte durchsuchen oder die Formeln dahinter","Cerca i valori a schermo, o le formule che li producono","Buscar nos valores em tela, ou nas fórmulas por trás deles"],
"Search these values": ["これらの値を検索","搜索这些值","搜尋這些值","Buscar en estos valores","Rechercher parmi ces valeurs","Diese Werte durchsuchen","Cerca tra questi valori","Buscar nestes valores"],
"Select a cell to format it.": ["書式を設定するセルを選択してください。","请选择一个单元格以设置格式。","請選擇一個儲存格以設定格式。","Selecciona una celda para darle formato.","Sélectionnez une cellule pour la mettre en forme.","Wählen Sie eine Zelle aus, um sie zu formatieren.","Seleziona una cella per formattarla.","Selecione uma célula para formatá-la."],
@@ -471,6 +503,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Select the whole sheet": ["シート全体を選択する","选中整个工作表","選取整張工作表","Seleccionar toda la hoja","Sélectionner toute la feuille","Das ganze Blatt auswählen","Seleziona l’intero foglio","Selecionar a planilha inteira"],
"Selecting": ["選択","选择","選取","Selección","Sélection","Auswählen","Selezione","Seleção"],
"Selection": ["選択範囲","选定区域","選取範圍","Selección","Sélection","Auswahl","Selezione","Seleção"],
+ "Series": ["系列","系列","數列","Series","Séries","Reihen","Serie","Séries"],
"Set a password…": ["パスワードを設定…","设置密码…","設定密碼…","Establecer una contraseña…","Définir un mot de passe…","Passwort festlegen…","Imposta una password…","Definir uma senha…"],
"Settings": ["設定","设置","設定","Ajustes","Réglages","Einstellungen","Impostazioni","Configurações"],
"Settings — language, appearance and updates": ["設定 — 言語、外観、アップデート","设置 — 语言、外观和更新","設定 — 語言、外觀與更新","Ajustes: idioma, apariencia y actualizaciones","Réglages — langue, apparence et mises à jour","Einstellungen — Sprache, Erscheinungsbild und Updates","Impostazioni — lingua, aspetto e aggiornamenti","Configurações — idioma, aparência e atualizações"],
@@ -478,6 +511,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Sheet": ["シート","工作表","工作表","Hoja","Feuille","Blatt","Foglio","Planilha"],
"Sheet name, workbook and date on every page": ["すべてのページにシート名・ブック名・日付","每页都带工作表名、工作簿和日期","每頁都帶工作表名稱、活頁簿和日期","Nombre de la hoja, libro y fecha en cada página","Nom de la feuille, classeur et date sur chaque page","Blattname, Arbeitsmappe und Datum auf jeder Seite","Nome del foglio, cartella e data su ogni pagina","Nome da planilha, pasta de trabalho e data em cada página"],
"Sheets": ["シート一覧","工作表","工作表","Hojas","Feuilles","Blätter","Fogli","Planilhas"],
+ "Show (blank) groups": ["(空白) グループを表示","显示(空白)分组","顯示(空白)群組","Mostrar grupos (vacío)","Afficher les groupes (vide)","Gruppen (leer) anzeigen","Mostra i gruppi (vuoto)","Mostrar grupos (vazio)"],
"Show or hide the dashboard": ["ダッシュボードの表示/非表示","显示或隐藏仪表板","顯示或隱藏儀表板","Mostrar u ocultar el panel","Afficher ou masquer le tableau de bord","Das Dashboard ein- oder ausblenden","Mostra o nascondi la dashboard","Mostrar ou ocultar o painel"],
"Show or hide the properties panel": ["プロパティパネルの表示/非表示","显示或隐藏属性面板","顯示或隱藏屬性面板","Mostrar u ocultar el panel de propiedades","Afficher ou masquer le panneau des propriétés","Die Eigenschaftenleiste ein- oder ausblenden","Mostra o nascondi il pannello delle proprietà","Mostrar ou ocultar o painel de propriedades"],
"Show or hide the sheet tabs": ["シートタブの表示/ 非表示","显示或隐藏工作表标签","顯示或隱藏工作表索引標籤","Mostrar u ocultar las pestañas de hojas","Afficher ou masquer les onglets de feuilles","Blattregister ein- oder ausblenden","Mostra o nascondi le schede dei fogli","Mostrar ou ocultar as abas de planilha"],
@@ -494,6 +528,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Sort and filter…": ["並べ替えとフィルター…","排序和筛选…","排序與篩選…","Ordenar y filtrar…","Trier et filtrer…","Sortieren und filtern…","Ordina e filtra…","Ordenar e filtrar…"],
"Sorted by {cols}": ["{cols} で並べ替え","按 {cols} 排序","依 {cols} 排序","Ordenado por {cols}","Trié par {cols}","Sortiert nach {cols}","Ordinato per {cols}","Ordenado por {cols}"],
"Sorting and filtering are not changes to the data, so undo cannot take them back — clear them from the column’s ▾ menu. Nothing was undone; press undo again to undo the last change to the data.": ["並べ替えと絞り込みはデータへの変更ではないため、元に戻すでは取り消せません — 列の ▾ メニューから解除してください。何も元に戻していません。データへの最後の変更を元に戻すには、もう一度押してください。","排序和筛选不是对数据的更改,因此撤销无法取消它们 — 请从列的 ▾ 菜单中清除。这次没有撤销任何内容;再按一次撤销,可撤销对数据的最后一次更改。","排序和篩選不是對資料的變更,因此還原無法取消它們 — 請從欄的 ▾ 選單中清除。這次沒有還原任何內容;再按一次還原,可還原對資料的最後一次變更。","Ordenar y filtrar no son cambios en los datos, así que deshacer no puede revertirlos: quítalos desde el menú ▾ de la columna. No se ha deshecho nada; pulsa deshacer otra vez para deshacer el último cambio en los datos.","Trier et filtrer ne sont pas des modifications des données : annuler ne peut donc pas les reprendre — retirez-les depuis le menu ▾ de la colonne. Rien n’a été annulé ; appuyez de nouveau sur annuler pour annuler la dernière modification des données.","Sortieren und Filtern sind keine Änderungen an den Daten, also kann Rückgängig sie nicht zurücknehmen — entfernen Sie sie im ▾-Menü der Spalte. Es wurde nichts rückgängig gemacht; drücken Sie erneut Rückgängig, um die letzte Änderung an den Daten zurückzunehmen.","Ordinare e filtrare non sono modifiche ai dati, quindi annulla non può riprenderli: rimuovili dal menu ▾ della colonna. Non è stato annullato nulla; premi annulla di nuovo per annullare l’ultima modifica ai dati.","Ordenar e filtrar não são alterações nos dados, então desfazer não os reverte — limpe-os no menu ▾ da coluna. Nada foi desfeito; pressione desfazer de novo para reverter a última alteração nos dados."],
+ "Source": ["元データ","来源","來源","Origen","Source","Quelle","Origine","Origem"],
"Split": ["分割","拆分","拆分","Dividir","Diviser","Teilen","Dividi","Dividir"],
"Split into columns": ["列に分割","拆分为多列","拆分為多欄","Dividir en columnas","Diviser en colonnes","In Spalten teilen","Dividi in colonne","Dividir em colunas"],
"Split into columns…": ["列に分割…","拆分为多列…","拆分為多欄…","Dividir en columnas…","Diviser en colonnes…","In Spalten teilen…","Dividi in colonne…","Dividir em colunas…"],
@@ -504,7 +539,9 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Stop sharing": ["共有を停止","停止共享","停止共用","Dejar de compartir","Arrêter le partage","Freigabe beenden","Interrompi condivisione","Parar de compartilhar"],
"Story": ["ストーリー","故事","故事","Historia","Récit","Datenstory","Storia","Narrativa"],
"Subject": ["件名","主题","主旨","Asunto","Sujet","Thema","Oggetto","Assunto"],
+ "Subtotals": ["小計","小计","小計","Subtotales","Sous-totaux","Teilergebnisse","Subtotali","Subtotais"],
"Sum": ["合計","求和","總和","Suma","Somme","Summe","Somma","Soma"],
+ "Summarise": ["集計","汇总","彙總","Resumir","Résumer","Zusammenfassen","Riepiloga","Resumir"],
"Summarise this sheet as a pivot table": ["このシートをピボットテーブルで集計する","将此工作表汇总为数据透视表","將此工作表彙總成樞紐分析表","Resumir esta hoja como tabla dinámica","Synthétiser cette feuille en tableau croisé dynamique","Dieses Blatt als PivotTable zusammenfassen","Riepiloga questo foglio come tabella pivot","Resumir esta planilha como tabela dinâmica"],
"Symbol": ["記号","符号","符號","Símbolo","Symbole","Symbol","Simbolo","Símbolo"],
"Take it elsewhere": ["外に持ち出す","把内容带走","把內容帶走","Llévatelo a otra parte","Emportez-le ailleurs","Woanders weitermachen","Portalo altrove","Levar para outro lugar"],
@@ -534,6 +571,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"The rest of the interface catches up the next time this file is opened.": ["画面の残りの部分は、このファイルを次に開いたときに切り替わります。","界面其余部分将在下次打开此文件时同步。","介面其餘部分會在下次開啟此檔案時跟上。","El resto de la interfaz se pone al día la próxima vez que se abra este archivo.","Le reste de l’interface suivra à la prochaine ouverture de ce fichier.","Der Rest der Oberfläche zieht beim nächsten Öffnen dieser Datei nach.","Il resto dell’interfaccia si adegua alla prossima apertura di questo file.","O restante da interface se atualiza na próxima vez que este arquivo for aberto."],
"The row of + cells under the last row adds a row: click it and type. The + past the last column header adds a column — a column needs a name first, so it asks for one.": ["最終行の下にある + の行が行を追加します。クリックして入力してください。最後の列ヘッダーの先にある + は列を追加します。列には先に名前が必要なので、名前を尋ねます。","最后一行下方那一行 + 单元格用于添加行:点击它并输入即可。最后一个列标题右侧的 + 用于添加列——列需要先有名称,因此会先询问名称。","最後一列下方那一列 + 儲存格用於新增列:點按它並輸入即可。最後一個欄標題右側的 + 用於新增欄——欄需要先有名稱,因此會先詢問名稱。","La fila de celdas + bajo la última fila añade una fila: haz clic y escribe. El + más allá de la última cabecera de columna añade una columna; una columna necesita un nombre primero, así que lo pide.","La rangée de cellules + sous la dernière ligne ajoute une ligne : cliquez et tapez. Le + au-delà du dernier en-tête de colonne ajoute une colonne — une colonne a d’abord besoin d’un nom, il en demande donc un.","Die Reihe aus +-Zellen unter der letzten Zeile fügt eine Zeile hinzu: anklicken und tippen. Das + hinter dem letzten Spaltenkopf fügt eine Spalte hinzu — eine Spalte braucht zuerst einen Namen, also wird danach gefragt.","La riga di celle + sotto l’ultima riga aggiunge una riga: fai clic e scrivi. Il + oltre l’ultima intestazione di colonna aggiunge una colonna: una colonna ha prima bisogno di un nome, quindi lo chiede.","A linha de células + abaixo da última linha adiciona uma linha: clique nela e digite. O + após o último cabeçalho de coluna adiciona uma coluna — uma coluna precisa de nome antes, então ele pede um."],
"The sheet on screen": ["表示中のシート","屏幕上的工作表","螢幕上的工作表","La hoja en pantalla","La feuille à l’écran","Das Blatt auf dem Bildschirm","Il foglio a schermo","A planilha em tela"],
+ "The sheet this pivot summarised is not in the workbook any more.": ["このピボットの元のシートはもうブックにありません。","此数据透视表汇总的工作表已不在工作簿中。","此樞紐分析表彙總的工作表已不在活頁簿中。","La hoja que resumía esta tabla dinámica ya no está en el libro.","La feuille que résumait ce tableau croisé n’est plus dans le classeur.","Das Blatt, das diese PivotTable zusammengefasst hat, ist nicht mehr in der Arbeitsmappe.","Il foglio riepilogato da questa tabella pivot non è più nella cartella di lavoro.","A folha que esta tabela dinâmica resumia já não está no livro."],
"The spreadsheet keeps these cells. Formulas pointing into the range still work, and the dataset is a copy taken now.": ["スプレッドシートのセルはそのまま残ります。範囲を参照している数式は引き続き機能し、データセットは今この時点のコピーです。","电子表格保留这些单元格。指向该区域的公式仍然有效,数据集是此刻取得的副本。","試算表保留這些儲存格。指向該範圍的公式仍然有效,資料集是此刻取得的副本。","La hoja de cálculo conserva estas celdas. Las fórmulas que apuntan al rango siguen funcionando, y el conjunto de datos es una copia tomada ahora.","La feuille de calcul conserve ces cellules. Les formules qui pointent vers la plage fonctionnent toujours, et le jeu de données est une copie prise maintenant.","Das Tabellenblatt behält diese Zellen. Formeln, die in den Bereich zeigen, funktionieren weiter, und der Datensatz ist eine jetzt genommene Kopie.","Il foglio di calcolo mantiene queste celle. Le formule che puntano all’intervallo continuano a funzionare, e il set di dati è una copia presa ora.","A planilha mantém estas células. Fórmulas que apontam para o intervalo continuam funcionando, e o conjunto de dados é uma cópia feita agora."],
"The update was refused: {why}": ["更新は拒否されました: {why}","更新被拒绝:{why}","更新遭到拒絕:{why}","La actualización ha sido rechazada: {why}","La mise à jour a été refusée : {why}","Das Update wurde abgelehnt: {why}","L’aggiornamento è stato rifiutato: {why}","A atualização foi recusada: {why}"],
"The values in the rows the other columns’ filters leave showing.": ["他の列のフィルターが残した行に含まれる値です。","这些是其他列的筛选所保留的行中出现的值。","這些是其他欄的篩選所保留的列中出現的值。","Los valores que hay en las filas que dejan a la vista los filtros de las otras columnas.","Les valeurs présentes dans les lignes que les filtres des autres colonnes laissent affichées.","Die Werte in den Zeilen, die die Filter der anderen Spalten übrig lassen.","I valori presenti nelle righe che i filtri delle altre colonne lasciano visibili.","Os valores das linhas que os filtros das outras colunas deixam visíveis."],
@@ -561,6 +599,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"This chart was drawn from {cols}, and {sheet} does not have {n} of them any more.": ["このグラフは {cols} から作成されましたが、{sheet} にはそのうち {n} 個がありません。","此图表由 {cols} 绘制,而 {sheet} 中已缺少其中 {n} 个。","此圖表由 {cols} 繪製,而 {sheet} 中已缺少其中 {n} 個。","Este gráfico se dibujó a partir de {cols}, y {sheet} ya no tiene {n} de ellas.","Ce graphique a été tracé à partir de {cols}, et {sheet} n’en a plus {n}.","Dieses Diagramm entstand aus {cols}, und {sheet} hat {n} davon nicht mehr.","Questo grafico è stato tracciato da {cols}, e {sheet} non ne ha più {n}.","Este gráfico foi feito a partir de {cols}, e {sheet} não tem mais {n} delas."],
"This choice could not be saved — site data is blocked or full — so it holds for this tab and will be forgotten when you reload.": ["この選択は保存できませんでした(サイトデータがブロックされているか、容量がいっぱいです)。このタブでは有効ですが、再読み込みすると失われます。","此选择无法保存——站点数据被阻止或已满——因此它仅在此标签页中有效,重新加载后将会丢失。","此選擇無法儲存——網站資料遭到封鎖或已滿——因此僅在此分頁中有效,重新載入後將會遺失。","Esta elección no se pudo guardar —los datos del sitio están bloqueados o llenos—, así que solo se aplica a esta pestaña y se olvidará al recargar.","Ce choix n’a pas pu être enregistré — les données du site sont bloquées ou saturées — il ne vaut donc que pour cet onglet et sera oublié au rechargement.","Diese Auswahl konnte nicht gespeichert werden – Websitedaten sind blockiert oder voll –, sie gilt daher nur für diesen Tab und geht beim Neuladen verloren.","Questa scelta non è stata salvata — i dati del sito sono bloccati o pieni — quindi vale solo per questa scheda e andrà persa al ricaricamento.","Esta escolha não pôde ser salva — os dados do site estão bloqueados ou cheios — então ela vale para esta aba e será esquecida ao recarregar."],
"This column": ["この列","此列","此欄","Esta columna","Cette colonne","Diese Spalte","Questa colonna","Esta coluna"],
+ "This column is not in {sheet} any more.": ["この列はもう {sheet} にありません。","此列已不在 {sheet} 中。","此欄已不在 {sheet} 中。","Esta columna ya no está en {sheet}.","Cette colonne n’est plus dans {sheet}.","Diese Spalte ist nicht mehr in {sheet}.","Questa colonna non è più in {sheet}.","Esta coluna já não está em {sheet}."],
"This column is {type}, so its values print exactly as they are stored and this pattern changes nothing. Set the type to Number, Money or Percent for it to apply.": ["この列は {type} なので、値は保存されているとおりに表示され、この書式は何も変えません。適用するには型を数値・通貨・パーセントのいずれかにしてください。","此列是{type},因此其值按存储的原样显示,这个格式不起任何作用。要让它生效,请将类型设为数字、货币或百分比。","此欄是{type},因此其值按儲存的原樣顯示,這個格式不起任何作用。要讓它生效,請將型別設為數值、貨幣或百分比。","Esta columna es {type}, así que sus valores se muestran tal como están guardados y este patrón no cambia nada. Cambia el tipo a Número, Moneda o Porcentaje para que se aplique.","Cette colonne est de type {type} : ses valeurs s’affichent telles qu’elles sont stockées et ce format ne change rien. Passez le type à Numérique, Monétaire ou Pourcentage pour qu’il s’applique.","Diese Spalte ist {type}, ihre Werte werden also genau so ausgegeben, wie sie gespeichert sind, und dieses Muster ändert nichts. Setzen Sie den Typ auf Zahl, Währung oder Prozent, damit es greift.","Questa colonna è {type}, quindi i suoi valori vengono mostrati esattamente come sono memorizzati e questo formato non cambia nulla. Imposta il tipo su Numero, Valuta o Percentuale perché venga applicato.","Esta coluna é {type}, então seus valores aparecem exatamente como estão armazenados e este padrão não muda nada. Defina o tipo como Número, Monetário ou Porcentagem para que ele valha."],
"This dataset has no columns": ["このデータセットには列がありません","此数据集没有列","此資料集沒有欄","Este conjunto de datos no tiene columnas","Ce jeu de données n’a aucune colonne","Dieser Datensatz hat keine Spalten","Questo set di dati non ha colonne","Este conjunto de dados não tem colunas"],
"This dataset has no rows": ["このデータセットには行がありません","此数据集没有行","此資料集沒有列","Este conjunto de datos no tiene filas","Ce jeu de données n’a aucune ligne","Dieser Datensatz hat keine Zeilen","Questo set di dati non ha righe","Este conjunto de dados não tem linhas"],
@@ -604,6 +643,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Thousands separator": ["桁区切り","千位分隔符","千分位符號","Separador de miles","Séparateur de milliers","Tausendertrennzeichen","Separatore delle migliaia","Separador de milhares"],
"Ties are included: the top 1 of 10, 10, 9 is both tens, because highlighting one of two equal cells claims a difference the data does not have.": ["同順位も含みます。10, 10, 9 の「上位 1 件」は 2 つの 10 です。等しい 2 つのセルの片方だけを強調表示すると、データにない差があるように見えてしまうからです。","并列一并计入:10、10、9 的“最高 1 项”是两个 10——只突出显示两个相等单元格中的一个,等于宣称数据里存在并不存在的差异。","並列一併計入:10、10、9 的「最高 1 項」是兩個 10——只醒目提示兩個相等儲存格中的一個,等於宣稱資料裡存在並不存在的差異。","Los empates se incluyen: el «1 más alto» de 10, 10, 9 son los dos dieces, porque resaltar solo una de dos celdas iguales afirma una diferencia que los datos no tienen.","Les ex æquo sont inclus : le « premier » de 10, 10, 9 donne les deux dix, car surligner une seule de deux cellules égales affirmerait un écart absent des données.","Gleichstände zählen mit: die „obersten 1“ von 10, 10, 9 sind beide Zehner, denn nur eine von zwei gleichen Zellen hervorzuheben behauptet einen Unterschied, den die Daten nicht haben.","I pari merito sono inclusi: il «primo» di 10, 10, 9 sono entrambi i dieci, perché evidenziare una sola di due celle uguali afferma una differenza che i dati non hanno.","Empates entram: o 1 maior de 10, 10, 9 são os dois dez, porque destacar uma de duas células iguais afirma uma diferença que os dados não têm."],
"Time": ["時刻","时间","時間","Hora","Heure","Uhrzeit","Ora","Hora"],
+ "Title": ["タイトル","标题","標題","Título","Titre","Titel","Titolo","Título"],
"Top": ["上","上","上","Arriba","Haut","Oben","Alto","Superior"],
"Top or bottom": ["上位・下位","最高或最低","最高或最低","Más altos o más bajos","Extrêmes hauts ou bas","Oberste oder unterste","Più alti o più bassi","Primeiros ou últimos"],
"Top {n}": ["上位 {n} 件","最高 {n} 项","最高 {n} 項","Primeros {n}","{n} premiers","Obere {n}","Primi {n}","Primeiros {n}"],
@@ -682,6 +722,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"ends with": ["次で終わる","结尾为","結尾為","termina por","se termine par","endet mit","finisce con","termina com"],
"equal to": ["次の値に等しい","等于","等於","igual a","égal à","gleich","uguale a","igual a"],
"from the data": ["データから","取自数据","取自資料","de los datos","d’après les données","aus den Daten","dai dati","a partir dos dados"],
+ "from {sheet}": ["{sheet} から","来自 {sheet}","來自 {sheet}","de {sheet}","de {sheet}","aus {sheet}","da {sheet}","de {sheet}"],
"greater than": ["次の値より大きい","大于","大於","mayor que","supérieur à","größer als","maggiore di","maior que"],
"greater than or equal to": ["次の値以上","大于或等于","大於或等於","mayor o igual que","supérieur ou égal à","größer oder gleich","maggiore o uguale a","maior ou igual a"],
"is empty": ["空である","为空","為空白","está vacía","est vide","ist leer","è vuota","está vazio"],
@@ -707,7 +748,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"orphaned": ["孤立","孤立","已孤立","huérfano","orphelin","verwaist","orfano","órfão"],
"owner": ["オーナー","所有者","擁有者","propietario","propriétaire","Eigentümer","proprietario","proprietário"],
"pivot": ["ピボット","数据透视表","樞紐分析表","tabla dinámica","tableau croisé","Pivottabelle","tabella pivot","dinâmica"],
- "pivot table — open it from + Pivot": ["ピボットテーブル — + ピボット から開きます","数据透视表 — 从“+ 数据透视表”打开","樞紐分析表 — 請從「+ 樞紐分析表」開啟","tabla dinámica: ábrela desde + Tabla dinámica","tableau croisé dynamique — ouvrez-le depuis + Tableau croisé","Pivottabelle — über + PivotTable öffnen","tabella pivot — aprila da + Tabella pivot","tabela dinâmica — abra em + Dinâmica"],
+ "pivot table — a summary of another sheet": ["ピボットテーブル — 別のシートの集計","数据透视表——另一个工作表的汇总","樞紐分析表——另一個工作表的彙總","tabla dinámica: un resumen de otra hoja","tableau croisé — un résumé d’une autre feuille","PivotTable – eine Zusammenfassung eines anderen Blatts","tabella pivot: un riepilogo di un altro foglio","tabela dinâmica — um resumo de outra folha"],
"reads {value}": ["内容は {value}","内容为 {value}","內容為 {value}","pone {value}","contient {value}","enthält {value}","dice {value}","diz {value}"],
"row": ["行","行","列","fila","ligne","Zeile","riga","linha"],
"row {n}": ["{n} 行目","第 {n} 行","第 {n} 列","fila {n}","ligne {n}","Zeile {n}","riga {n}","linha {n}"],
@@ -725,6 +766,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"vs": ["対","对比","對比","frente a","en fonction de","gegenüber","vs","vs"],
"your name": ["あなたの名前","你的名字","你的名字","tu nombre","votre nom","Ihr Name","il tuo nome","seu nome"],
"{cols} holds formulas on single cells that do not repeat down the column, so the new row is empty there. An imported formula stays on the cell it arrived on; give the column a formula and every new row fills itself.": ["{cols} には列全体で繰り返されない単一セルの数式があるため、新しい行はそこが空です。読み込まれた数式は届いたセルにとどまります。列に数式を設定すれば、すべての新しい行が自動的に埋まります。","{cols} 中的公式只存在于单个单元格,并未沿列重复,因此新行在那里是空的。导入的公式留在它到达的单元格上;为该列设置公式,每一个新行都会自动填充。","{cols} 中的公式只存在於單一儲存格,並未沿欄重複,因此新列在那裡是空的。匯入的公式留在它到達的儲存格上;為該欄設定公式,每一個新列都會自動填滿。","{cols} tiene fórmulas en celdas sueltas que no se repiten a lo largo de la columna, así que la fila nueva está vacía ahí. Una fórmula importada se queda en la celda a la que llegó; dele una fórmula a la columna y cada fila nueva se rellenará sola.","{cols} contient des formules sur des cellules isolées qui ne se répètent pas le long de la colonne : la nouvelle ligne y est donc vide. Une formule importée reste sur la cellule où elle est arrivée ; donnez une formule à la colonne et chaque nouvelle ligne se remplira d’elle-même.","{cols} enthält Formeln in einzelnen Zellen, die sich in der Spalte nicht wiederholen, daher bleibt die neue Zeile dort leer. Eine importierte Formel bleibt in der Zelle, in der sie angekommen ist; geben Sie der Spalte eine Formel, und jede neue Zeile füllt sich von selbst.","{cols} contiene formule su singole celle che non si ripetono lungo la colonna, quindi la nuova riga lì è vuota. Una formula importata resta sulla cella su cui è arrivata; dai una formula alla colonna e ogni nuova riga si riempirà da sola.","{cols} contém fórmulas em células isoladas que não se repetem pela coluna, então a nova linha fica vazia ali. Uma fórmula importada permanece na célula em que chegou; dê uma fórmula à coluna e cada linha nova se preenche sozinha."],
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": ["{col} には順序がないため、カテゴリ間を結ぶ線は存在しない傾向を描いてしまいます。棒で表示しています。","{col} 没有顺序,在其类别之间连线会画出并不存在的趋势。已绘制为柱状。","{col} 沒有順序,在其類別之間連線會畫出並不存在的趨勢。已繪製為長條。","{col} no tiene orden, así que una línea entre sus categorías dibujaría una tendencia que no existe. Dibujado como barras.","{col} n’a pas d’ordre : une ligne entre ses catégories tracerait une tendance qui n’existe pas. Tracé en barres.","{col} hat keine Reihenfolge, eine Linie zwischen seinen Kategorien würde also einen Trend zeichnen, den es nicht gibt. Als Balken gezeichnet.","{col} non ha un ordine, quindi una linea tra le sue categorie disegnerebbe una tendenza che non c’è. Disegnato a barre.","{col} não tem ordem, por isso uma linha entre as suas categorias desenharia uma tendência que não existe. Desenhado como barras."],
"{i} of {n}": ["{n} 件中 {i} 件目","第 {i} 个,共 {n} 个","第 {i} 個,共 {n} 個","{i} de {n}","{i} sur {n}","{i} von {n}","{i} di {n}","{i} de {n}"],
"{kind} sheet — not editable in this build": ["{kind} シート — このビルドでは編集できません","{kind} 工作表 — 当前版本无法编辑","{kind} 工作表 — 這個版本無法編輯","hoja de tipo {kind}: no editable en esta versión","feuille {kind} — non modifiable dans cette version","{kind}-Blatt — in diesem Build nicht bearbeitbar","foglio {kind} — non modificabile in questa build","planilha do tipo {kind} — não editável nesta versão"],
"{k} of {n} rows": ["{n} 行中 {k} 行","{n} 行中的 {k} 行","{n} 列中的 {k} 列","{k} de {n} filas","{k} lignes sur {n}","{k} von {n} Zeilen","{k} di {n} righe","{k} de {n} linhas"],
@@ -748,6 +790,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"{n} of {all} rows — a filter is hiding the rest.": ["{all} 行中 {n} 行 — 残りはフィルターで非表示です。","{all} 行中的 {n} 行 — 其余被筛选器隐藏。","{all} 列中的 {n} 列 — 其餘被篩選器隱藏。","{n} de {all} filas: un filtro oculta el resto.","{n} lignes sur {all} — un filtre masque les autres.","{n} von {all} Zeilen — ein Filter verbirgt den Rest.","{n} di {all} righe — un filtro nasconde il resto.","{n} de {all} linhas — um filtro está ocultando as demais."],
"{n} replaced": ["{n} 件を置換しました","已替换 {n} 处","已取代 {n} 處","{n} reemplazadas","{n} remplacée(s)","{n} ersetzt","{n} sostituite","{n} substituída(s)"],
"{n} rows": ["{n} 行","{n} 行","{n} 列","{n} filas","{n} lignes","{n} Zeilen","{n} righe","{n} linhas"],
+ "{n} selected": ["{n} 件を選択","已选 {n} 项","已選 {n} 項","{n} seleccionados","{n} sélectionnés","{n} ausgewählt","{n} selezionati","{n} selecionados"],
"{n} sheet(s) are not datasets and are not in the .xlsx: {names}.": ["{n} 件のシートはデータセットではないため .xlsx に含まれていません: {names}。","有 {n} 个工作表不是数据集,未包含在 .xlsx 中:{names}。","有 {n} 個工作表不是資料集,未包含在 .xlsx 中:{names}。","{n} hoja(s) no son conjuntos de datos y no están en el .xlsx: {names}.","{n} feuille(s) ne sont pas des jeux de données et ne figurent pas dans le .xlsx : {names}.","{n} Blatt/Blätter sind keine Datensätze und nicht in der .xlsx enthalten: {names}.","{n} foglio/i non sono set di dati e non sono nel file .xlsx: {names}.","{n} planilha(s) não são conjuntos de dados e não estão no .xlsx: {names}."],
"{n} source rows": ["元データ {n} 行","{n} 个源数据行","{n} 列來源資料","{n} filas de origen","{n} lignes sources","{n} Quellzeilen","{n} righe di origine","{n} linhas de origem"],
"{n} value(s) are not numbers and were not counted": ["{n} 個の値は数値ではないため集計されませんでした","有 {n} 个值不是数字,未计入","有 {n} 個值不是數字,未列入計算","{n} valor(es) no son números y no se han contado","{n} valeur(s) ne sont pas des nombres et n’ont pas été comptées","{n} Wert(e) sind keine Zahlen und wurden nicht gezählt","{n} valori non sono numeri e non sono stati conteggiati","{n} valor(es) não são números e não foram contados"],
@@ -759,6 +802,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"{n}h ago": ["{n}時間前","{n} 小时前","{n} 小時前","hace {n} h","il y a {n} h","vor {n} Std","{n} h fa","há {n}h"],
"{n}m ago": ["{n}分前","{n} 分钟前","{n} 分鐘前","hace {n} min","il y a {n} min","vor {n} Min","{n} min fa","há {n}min"],
"{open} open of {all} comment(s) — click to list them, ⌘⌥M to add one": ["{all} 件のコメントのうち {open} 件が未解決 — クリックで一覧、⌘⌥M で追加","{all} 条评论中有 {open} 条未解决 — 点击查看列表,⌘⌥M 添加评论","{all} 則註解中有 {open} 則未解決 — 點一下可列出,⌘⌥M 可新增","{open} de {all} comentario(s) abiertos: haz clic para verlos, ⌘⌥M para añadir uno","{open} commentaire(s) ouvert(s) sur {all} — cliquez pour les lister, ⌘⌥M pour en ajouter un","{open} von {all} Kommentar(en) offen — zum Auflisten klicken, ⌘⌥M zum Hinzufügen","{open} commenti aperti su {all} — fai clic per elencarli, ⌘⌥M per aggiungerne uno","{open} em aberto de {all} comentário(s) — clique para listá-los, ⌘⌥M para adicionar um"],
+ "{pattern}, from the column": ["{pattern}(列の書式)","{pattern},来自该列","{pattern},來自該欄","{pattern}, de la columna","{pattern}, d’après la colonne","{pattern}, aus der Spalte","{pattern}, dalla colonna","{pattern}, da coluna"],
"{rows} row(s) across {sheets} sheet(s) · about {pages} page(s)": ["{sheets} シート・{rows} 行 · 約 {pages} ページ","{sheets} 个工作表共 {rows} 行 · 约 {pages} 页","{sheets} 個工作表共 {rows} 列 · 約 {pages} 頁","{rows} fila(s) en {sheets} hoja(s) · unas {pages} página(s)","{rows} ligne(s) sur {sheets} feuille(s) · environ {pages} page(s)","{rows} Zeile(n) in {sheets} Blatt/Blättern · etwa {pages} Seite(n)","{rows} riga/e su {sheets} foglio/i · circa {pages} pagina/e","{rows} linha(s) em {sheets} planilha(s) · cerca de {pages} página(s)"],
"{sheet} no longer has {cols}, so it is not drawn.": ["{sheet} には {cols} がなくなったため、描画されません。","{sheet} 中已没有 {cols},因此未绘制。","{sheet} 中已沒有 {cols},因此未繪製。","{sheet} ya no tiene {cols}, así que no se dibuja.","{sheet} n’a plus {cols} : ce n’est donc pas tracé.","{sheet} hat {cols} nicht mehr, daher wird es nicht gezeichnet.","{sheet} non ha più {cols}, quindi non viene disegnato.","{sheet} não tem mais {cols}, então não é desenhado."],
"{size} of a {budget} budget": ["上限 {budget} のうち {size}","{budget} 预算中的 {size}","{budget} 預算中的 {size}","{size} de un presupuesto de {budget}","{size} sur un budget de {budget}","{size} von einem Budget von {budget}","{size} su un budget di {budget}","{size} de um limite de {budget}"],
@@ -776,5 +820,6 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"“{name}” is password-protected. Open it directly to unlock it.": ["「{name}」はパスワードで保護されています。ロックを解除するには直接開いてください。","“{name}”有密码保护。请直接打开它以解锁。","「{name}」有密碼保護。請直接開啟它來解鎖。","“{name}” está protegido con contraseña. Ábrelo directamente para desbloquearlo.","« {name} » est protégé par mot de passe. Ouvrez-le directement pour le déverrouiller.","„{name}“ ist passwortgeschützt. Zum Entsperren direkt öffnen.","“{name}” è protetto da password. Aprilo direttamente per sbloccarlo.","“{name}” é protegido por senha. Abra-o diretamente para desbloqueá-lo."],
"“{name}” is the older Excel format. Open it in Excel and save it as .xlsx, and dash will read it.": ["「{name}」は古い形式の Excel ファイルです。Excel で開いて .xlsx で保存すれば、dash が読み取れます。","“{name}”是旧版 Excel 格式。请在 Excel 中打开并另存为 .xlsx,dash 就能读取。","「{name}」是舊版的 Excel 格式。請在 Excel 中開啟並另存為 .xlsx,dash 就能讀取。","“{name}” tiene el formato antiguo de Excel. Ábrelo en Excel y guárdalo como .xlsx, y dash podrá leerlo.","« {name} » est à l’ancien format Excel. Ouvrez-le dans Excel et enregistrez-le en .xlsx, et dash pourra le lire.","„{name}“ hat das ältere Excel-Format. In Excel öffnen und als .xlsx speichern, dann kann dash sie lesen.","“{name}” è nel vecchio formato Excel. Aprilo in Excel e salvalo come .xlsx, e dash lo leggerà.","“{name}” está no formato antigo do Excel. Abra-o no Excel e salve como .xlsx, e o dash conseguirá lê-lo."],
"…or cut at character positions": ["…または文字位置で区切る","…或按字符位置切分","…或按字元位置切分","…o cortar en posiciones de carácter","…ou couper à des positions de caractère","…oder an Zeichenpositionen schneiden","…oppure taglia a posizioni di carattere","…ou cortar em posições de caractere"],
+ "+ Add series": ["+ 系列を追加","+ 添加系列","+ 新增數列","+ Añadir serie","+ Ajouter une série","+ Reihe hinzufügen","+ Aggiungi serie","+ Adicionar série"],
"+ Comment on the selected cell": ["+ 選択したセルにコメント","+ 为所选单元格添加评论","+ 為選取的儲存格加註解","+ Comentar la celda seleccionada","+ Commenter la cellule sélectionnée","+ Kommentar zur ausgewählten Zelle","+ Commenta la cella selezionata","+ Comentar na célula selecionada"],
}
diff --git a/dash/src/i18n/pt.ts b/dash/src/i18n/pt.ts
index fe2c8ae2..49c1ef8a 100644
--- a/dash/src/i18n/pt.ts
+++ b/dash/src/i18n/pt.ts
@@ -686,7 +686,6 @@ export const pt: Catalog = {
"orphaned": "órfão",
"owner": "proprietário",
"pivot": "dinâmica",
- "pivot table — open it from + Pivot": "tabela dinâmica — abra em + Dinâmica",
"reads {value}": "diz {value}",
"row": "linha",
"row {n}": "linha {n}",
@@ -767,6 +766,52 @@ export const pt: Catalog = {
"Copy saved — you are still editing the original": "Cópia salva — você continua editando o original",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "A recuperação de falhas está desativada para esta pasta de trabalho: ela é grande demais para manter uma cópia de segurança. Salve com frequência.",
"A backup of this workbook for yourself — same workbook, same live session.": "Um backup desta pasta de trabalho para você — mesma pasta de trabalho, mesma sessão ao vivo.",
+ "(missing sheet)": "(folha em falta)",
+ "A pie shows one series — the first.": "Um gráfico circular mostra uma só série — a primeira.",
+ "Add a field to {area}": "Adicionar um campo a {area}",
+ "Add field…": "Adicionar campo…",
+ "All": "Tudo",
+ "Axis": "Eixo",
+ "Categories": "Categorias",
+ "Choose which values to include": "Escolher que valores incluir",
+ "Colour of {name}": "Cor de {name}",
+ "Drag a field into an area below, or tick it.": "Arraste um campo para uma área abaixo, ou assinale-o.",
+ "Draw a line anyway": "Desenhar uma linha mesmo assim",
+ "Drawn as bars: {col} has no order for a line to follow.": "Desenhado como barras: {col} não tem uma ordem que uma linha possa seguir.",
+ "Drop a field here": "Largue um campo aqui",
+ "Drop a field here to summarise it": "Largue um campo aqui para o resumir",
+ "Edit": "Editar",
+ "Edit this chart": "Editar este gráfico",
+ "Fields": "Campos",
+ "Filters": "Filtros",
+ "Grand totals": "Totais gerais",
+ "How to summarise {name}": "Como resumir {name}",
+ "In order": "Por ordem",
+ "Legend": "Legenda",
+ "Line": "Linhas",
+ "No order — as they appear in the sheet": "Sem ordem — tal como aparecem na folha",
+ "None — one point per row": "Nenhum — um ponto por linha",
+ "Only the first {n} values are listed.": "Só os primeiros {n} valores estão listados.",
+ "Pie": "Circular",
+ "Pivot table": "Tabela dinâmica",
+ "Plain numbers": "Números simples",
+ "Plain numbers — the series do not share a format": "Números simples — as séries não partilham um formato",
+ "Remove {name}": "Remover {name}",
+ "Scatter": "Dispersão",
+ "Series": "Séries",
+ "Show (blank) groups": "Mostrar grupos (vazio)",
+ "Source": "Origem",
+ "Subtotals": "Subtotais",
+ "Summarise": "Resumir",
+ "The sheet this pivot summarised is not in the workbook any more.": "A folha que esta tabela dinâmica resumia já não está no livro.",
+ "This column is not in {sheet} any more.": "Esta coluna já não está em {sheet}.",
+ "Title": "Título",
+ "from {sheet}": "de {sheet}",
+ "pivot table — a summary of another sheet": "tabela dinâmica — um resumo de outra folha",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} não tem ordem, por isso uma linha entre as suas categorias desenharia uma tendência que não existe. Desenhado como barras.",
+ "{n} selected": "{n} selecionados",
+ "{pattern}, from the column": "{pattern}, da coluna",
+ "+ Add series": "+ Adicionar série",
"Press Esc to cancel.": "Pressione Esc para cancelar.",
"There’s a problem with this formula: a bracket is opened and never closed.": "Há um problema com esta fórmula: um parêntese é aberto e nunca fechado.",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "Há um problema com esta fórmula: termina depois de «{near}», onde falta um valor.",
diff --git a/dash/src/i18n/zh-Hans.ts b/dash/src/i18n/zh-Hans.ts
index 16ea864d..dd8d8a6c 100644
--- a/dash/src/i18n/zh-Hans.ts
+++ b/dash/src/i18n/zh-Hans.ts
@@ -676,7 +676,6 @@ export const zhHans: Catalog = {
"orphaned": "孤立",
"owner": "所有者",
"pivot": "数据透视表",
- "pivot table — open it from + Pivot": "数据透视表 — 从“+ 数据透视表”打开",
"reads {value}": "内容为 {value}",
"row": "行",
"row {n}": "第 {n} 行",
@@ -754,6 +753,52 @@ export const zhHans: Catalog = {
"Copy saved — you are still editing the original": "副本已保存 — 你仍在编辑原文件",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "此工作簿的崩溃恢复已关闭 — 文件太大,无法保留备份。请经常保存。",
"A backup of this workbook for yourself — same workbook, same live session.": "自己留存的备份 — 同一个工作簿、同一个实时会话。",
+ "(missing sheet)": "(工作表已缺失)",
+ "A pie shows one series — the first.": "饼图只显示一个系列——第一个。",
+ "Add a field to {area}": "向{area}添加字段",
+ "Add field…": "添加字段…",
+ "All": "全部",
+ "Axis": "坐标轴",
+ "Categories": "类别",
+ "Choose which values to include": "选择要包含的值",
+ "Colour of {name}": "{name}的颜色",
+ "Drag a field into an area below, or tick it.": "将字段拖到下方区域,或勾选它。",
+ "Draw a line anyway": "仍然绘制折线",
+ "Drawn as bars: {col} has no order for a line to follow.": "已绘制为柱状:{col} 没有可供折线遵循的顺序。",
+ "Drop a field here": "将字段拖放到此处",
+ "Drop a field here to summarise it": "将字段拖放到此处进行汇总",
+ "Edit": "编辑",
+ "Edit this chart": "编辑此图表",
+ "Fields": "字段",
+ "Filters": "筛选",
+ "Grand totals": "总计",
+ "How to summarise {name}": "如何汇总{name}",
+ "In order": "有顺序",
+ "Legend": "图例",
+ "Line": "折线",
+ "No order — as they appear in the sheet": "无顺序——按其在工作表中出现的次序",
+ "None — one point per row": "无——每行一个点",
+ "Only the first {n} values are listed.": "仅列出前 {n} 个值。",
+ "Pie": "饼图",
+ "Pivot table": "数据透视表",
+ "Plain numbers": "纯数字",
+ "Plain numbers — the series do not share a format": "纯数字——各系列的格式不一致",
+ "Remove {name}": "移除{name}",
+ "Scatter": "散点",
+ "Series": "系列",
+ "Show (blank) groups": "显示(空白)分组",
+ "Source": "来源",
+ "Subtotals": "小计",
+ "Summarise": "汇总",
+ "The sheet this pivot summarised is not in the workbook any more.": "此数据透视表汇总的工作表已不在工作簿中。",
+ "This column is not in {sheet} any more.": "此列已不在 {sheet} 中。",
+ "Title": "标题",
+ "from {sheet}": "来自 {sheet}",
+ "pivot table — a summary of another sheet": "数据透视表——另一个工作表的汇总",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} 没有顺序,在其类别之间连线会画出并不存在的趋势。已绘制为柱状。",
+ "{n} selected": "已选 {n} 项",
+ "{pattern}, from the column": "{pattern},来自该列",
+ "+ Add series": "+ 添加系列",
"Press Esc to cancel.": "按 Esc 取消。",
"There’s a problem with this formula: a bracket is opened and never closed.": "此公式有问题:有一个括号打开后没有闭合。",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "此公式有问题:它在“{near}”之后就结束了,缺少一个值。",
diff --git a/dash/src/i18n/zh-Hant.ts b/dash/src/i18n/zh-Hant.ts
index 03b08a13..50e6cc34 100644
--- a/dash/src/i18n/zh-Hant.ts
+++ b/dash/src/i18n/zh-Hant.ts
@@ -676,7 +676,6 @@ export const zhHant: Catalog = {
"orphaned": "已孤立",
"owner": "擁有者",
"pivot": "樞紐分析表",
- "pivot table — open it from + Pivot": "樞紐分析表 — 請從「+ 樞紐分析表」開啟",
"reads {value}": "內容為 {value}",
"row": "列",
"row {n}": "第 {n} 列",
@@ -754,6 +753,52 @@ export const zhHant: Catalog = {
"Copy saved — you are still editing the original": "副本已儲存 — 你仍在編輯原始檔案",
"Crash recovery is off for this workbook — it’s too large to keep a backup copy. Save often.": "此活頁簿的當機復原已關閉 — 檔案太大,無法保留備份。請經常儲存。",
"A backup of this workbook for yourself — same workbook, same live session.": "自己留存的備份 — 同一個活頁簿、同一個即時會話。",
+ "(missing sheet)": "(工作表已遺失)",
+ "A pie shows one series — the first.": "圓形圖只顯示一個數列——第一個。",
+ "Add a field to {area}": "新增欄位至{area}",
+ "Add field…": "新增欄位…",
+ "All": "全部",
+ "Axis": "座標軸",
+ "Categories": "類別",
+ "Choose which values to include": "選擇要包含的值",
+ "Colour of {name}": "{name}的顏色",
+ "Drag a field into an area below, or tick it.": "將欄位拖到下方區域,或勾選它。",
+ "Draw a line anyway": "仍然繪製折線",
+ "Drawn as bars: {col} has no order for a line to follow.": "已繪製為長條:{col} 沒有可供折線依循的順序。",
+ "Drop a field here": "將欄位拖放到此處",
+ "Drop a field here to summarise it": "將欄位拖放到此處進行彙總",
+ "Edit": "編輯",
+ "Edit this chart": "編輯此圖表",
+ "Fields": "欄位",
+ "Filters": "篩選",
+ "Grand totals": "總計",
+ "How to summarise {name}": "如何彙總{name}",
+ "In order": "有順序",
+ "Legend": "圖例",
+ "Line": "折線",
+ "No order — as they appear in the sheet": "無順序——依其在工作表中出現的次序",
+ "None — one point per row": "無——每列一個點",
+ "Only the first {n} values are listed.": "僅列出前 {n} 個值。",
+ "Pie": "圓形",
+ "Pivot table": "樞紐分析表",
+ "Plain numbers": "純數字",
+ "Plain numbers — the series do not share a format": "純數字——各數列的格式不一致",
+ "Remove {name}": "移除{name}",
+ "Scatter": "散佈",
+ "Series": "數列",
+ "Show (blank) groups": "顯示(空白)群組",
+ "Source": "來源",
+ "Subtotals": "小計",
+ "Summarise": "彙總",
+ "The sheet this pivot summarised is not in the workbook any more.": "此樞紐分析表彙總的工作表已不在活頁簿中。",
+ "This column is not in {sheet} any more.": "此欄已不在 {sheet} 中。",
+ "Title": "標題",
+ "from {sheet}": "來自 {sheet}",
+ "pivot table — a summary of another sheet": "樞紐分析表——另一個工作表的彙總",
+ "{col} has no order, so a line between its categories would draw a trend that is not there. Drawn as bars.": "{col} 沒有順序,在其類別之間連線會畫出並不存在的趨勢。已繪製為長條。",
+ "{n} selected": "已選 {n} 項",
+ "{pattern}, from the column": "{pattern},來自該欄",
+ "+ Add series": "+ 新增數列",
"Press Esc to cancel.": "按 Esc 取消。",
"There’s a problem with this formula: a bracket is opened and never closed.": "此公式有問題:有一個括號開啟後沒有關閉。",
"There’s a problem with this formula: it ends after “{near}”, where a value is missing.": "此公式有問題:它在「{near}」之後就結束了,缺少一個值。",
diff --git a/dash/src/main.ts b/dash/src/main.ts
index 1fb72a4f..03c89233 100644
--- a/dash/src/main.ts
+++ b/dash/src/main.ts
@@ -35,7 +35,7 @@ import { FileWriteBack } from './writeback.ts'
import { APP_VERSION } from '../../kernel/src/update.ts'
import { mountAbout, openAbout, rememberVersion, checkAtLaunch } from './about.ts'
import { runSql, sqlRows } from './sql.ts'
-import { mountPanels, type Panels } from './panels.ts'
+import { mountPanels, KIT, type Panels } from './panels.ts'
import { installStory, closeStoryEditor } from './story.ts'
import { Dashboard } from './dashboard.ts'
import { SyncSession } from './sync/session.ts'
@@ -43,7 +43,8 @@ import { mountPeople } from './sync/people.ts'
import { ridBase, ridBlockFor, docForExport } from './model.ts'
import { setRidBlock } from './rowcol.ts'
import { importXlsx, installNames, exportXlsx, xlsxFileName } from './xlsx.ts'
-import { runPivot, mountPivot, defaultPivot, newPivotSheet, type PivotSpec } from './pivot.ts'
+import { runPivot, mountPivot, defaultPivot, newPivotSheet, isPivotSheet, readPivotSpec, type PivotSheet, type PivotSpec } from './pivot.ts'
+import { buildPivotFields } from './pivotfields.ts'
import { buildSheetPreview } from './preview.ts'
import { installPrint, openPrintDialog } from './print.ts'
import './ask.css'
@@ -64,6 +65,7 @@ import {
// can never be imported at all. See the block above `ACTIONS` for the rest.
import {
ACTIONS, ACTION_IDS, actionReason, mintSheetId, mintSheetName, type ActionId,
+ type SheetViews,
} from './tabs.ts'
// The bridge between the two kinds of sheet — pure, and tested with no DOM in
// `scripts/test-dash-promote.ts`. Everything below is the gesture; every
@@ -103,7 +105,10 @@ import {
import { planTableSplit, planCanvasSplit, type SplitSpec } from './tocolumns.ts'
import { importDelimited } from './import.ts'
import { TYPE_LABEL } from './format.ts'
-import { defaultBinding, renderChart, chartHeading, missingColumns, type ChartBinding } from './chart.ts'
+import {
+ defaultBinding, bindingFromSelection, renderChart, chartHeading, missingColumns, type ChartBinding,
+} from './chart.ts'
+import { buildChartEditor } from './chartedit.ts'
import { readCell } from './store.ts'
import { hiddenSet } from './rowcol.ts'
import { FUNCTIONS, dependencies, recalc } from './formula.ts'
@@ -155,6 +160,12 @@ const ICON = {
} as const
/** A top-bar button: icon + collapsible label, the one shape the bar can shrink. */
+/** The developer flag that shows the 3D tool. Read once at boot, never throws. */
+const DEV_3D_KEY = 'bento-dash-dev-3d'
+const dev3d = (): boolean => {
+ try { return localStorage.getItem(DEV_3D_KEY) === 'on' } catch { return false }
+}
+
const barBtn = (act: string, icon: string, label: string, tip: string, extra = ''): string =>
`<button class="dx-btn${extra}" data-act="${act}" title="${esc(tip)}">${icon}<span>${esc(label)}</span></button>`
@@ -446,6 +457,13 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
`<div class="dx-findings" hidden></div>` +
`<div class="dx-body"><div class="dx-grid"></div>` +
`<div class="dx-dash" hidden></div>` +
+ // THE PIVOT SHEET, drawn where the grid was. A pivot is a sheet with a tab,
+ // so opening it has to look like opening a sheet — not like a side panel
+ // beside some other sheet, which is where it used to live and where its
+ // Grand total column ran off the edge of a 400px pane.
+ `<div class="dx-pivotview" hidden><div class="dx-pivotview-head">` +
+ `<span class="dx-pivotview-title"></span><span class="dx-pivotview-src"></span></div>` +
+ `<div class="dx-pivotview-body"></div></div>` +
`<div class="dx-chart" hidden><div class="dx-chart-head">` +
`<span class="dx-chart-title"></span>` +
`<button class="dx-btn dx-chart-kind">${t('Bar')}</button>` +
@@ -454,6 +472,17 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
`<footer class="dx-status"><span class="dx-status-view"></span>` +
`<span class="dx-status-sum"></span></footer>`
+ // 3D IS A DEVELOPER TOOL UNTIL IT EARNS A PLACE. Unlabelled blocks with the
+ // camera inside a cube is not something any peer leads with, and a toolbar
+ // button is a promise. Off by default, per viewer, never in the document:
+ // `localStorage['bento-dash-dev-3d'] = 'on'` brings the button back. viz3d.ts
+ // stays, and a story step that already holds a 3D view still plays it.
+ if (!dev3d()) {
+ const b3 = app.querySelector<HTMLElement>('[data-act="viz3d"]')!
+ b3.hidden = true
+ b3.style.display = 'none'
+ }
+
const titleEl = app.querySelector<HTMLInputElement>('.dx-title')!
const dirtyEl = app.querySelector<HTMLElement>('.dx-dirty')!
const findingsEl = app.querySelector<HTMLElement>('.dx-findings')!
@@ -489,9 +518,17 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// Both read the same string from the same table, so a reader who clicks
// anyway is told exactly what the tooltip said rather than something new.
+ /**
+ * The pivot sheet shown in place of the grid, or null. Declared here, above
+ * `shownSheet`, because while a pivot is up IT is the sheet on screen: every
+ * toolbar gate reads the kind through `shownSheet`, and a Chart button lit
+ * over a pivot would chart the dataset hidden underneath it.
+ */
+ let pivotShown: string | null = null
+
/** The sheet on screen, whatever its kind — `grid.sheet` narrows and throws. */
const shownSheet = (): Sheet | undefined =>
- store.doc.sheets.find((s) => s.id === grid.showingId())
+ store.doc.sheets.find((s) => s.id === (pivotShown ?? grid.showingId()))
/** Its kind, or `''` when the grid points at nothing that is still there. */
const shownKind = (): string =>
@@ -815,7 +852,11 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// keyboard: the grid owns the key set when nothing else has focus
document.addEventListener('keydown', (e) => {
const t = e.target as HTMLElement | null
- if (t && (t.tagName === 'INPUT' || t.isContentEditable)) return
+ if (t && (t.tagName === 'INPUT' || t.tagName === 'SELECT' || t.isContentEditable)) return
+ // THE GRID IS HIDDEN UNDER A PIVOT, and a key that reached it would type
+ // into a cell nobody can see. Only history passes: ⌘Z after moving a field
+ // is the undo of that move, and the grid's key map is the one route to it.
+ if (pivotShown && !(keyToAction(e)?.kind === 'undo' || keyToAction(e)?.kind === 'redo')) return
// A bare printable key REPLACES the selected cell — the most-used gesture
// in a spreadsheet, and the one that makes a grid feel like one. It has to
// be tried before keyToAction, which returns null for printable keys
@@ -924,8 +965,16 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// to its own sheet and only needs the shown one to say so.
const shown = shownSheet()
const shownId = shown?.id ?? ''
- chartTitle.textContent = chartHeading(sheet, binding, shownId)
- kindBtn.textContent = binding.kind[0].toUpperCase() + binding.kind.slice(1)
+ // The author's title when there is one — but the sheet is still named when
+ // it is not the one on screen, which is a warning and not a caption.
+ chartTitle.textContent = binding.title
+ ? (shownId && shownId !== sheet.id ? `${sheet.name} · ${binding.title}` : binding.title)
+ : chartHeading(sheet, binding, shownId)
+ // The 2D chart's controls live in the panel now (chartedit.ts), so the
+ // head's button opens them. It used to CYCLE the type, Bar → Line → Pie,
+ // which drew a line through Region on the second click.
+ kindBtn.textContent = t('Edit')
+ kindBtn.title = t('Edit this chart')
teardown = renderChart(chartBody, sheet, binding,
// the grid's freshly computed formula columns, so the chart shows the
// numbers on screen rather than the raw columns underneath them — but
@@ -942,6 +991,7 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// reader cannot see (measured: £97,050 beside a £69,050 footer).
rows: store.order[sheet.id] ?? null,
showing: shown && shown.id !== sheet.id ? { id: shown.id, name: shown.name } : null,
+ onAllowLine: store.readOnly ? undefined : () => setBinding({ ...binding!, allowLine: true }),
onRebind: () => {
// "Chart this sheet instead" — and the sheet it would rebind to can be
// a spreadsheet, which has no columns to bind. Same guard, same
@@ -981,7 +1031,18 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
else if (!want && binding) {
teardown?.(); teardown = null
binding = null; chartSheetId = null; chartEl.hidden = true
- } else drawChart()
+ unEditChart()
+ } else {
+ // THE DOCUMENT CHANGED THE CHART — an undo of a title, a colour, a series.
+ // The live copy follows it, or ⌘Z moved the file and left the plot and the
+ // editor showing the edit that was just taken back.
+ if (want && binding && typeof want.sheet === 'string' && want.binding &&
+ JSON.stringify(want) !== JSON.stringify({ sheet: chartSheetId, binding })) {
+ binding = structuredClone(want.binding)
+ chartSheetId = want.sheet
+ }
+ drawChart()
+ }
}
store.on('doc', syncChartPanel)
// FILTERING AND SORTING ARE VIEW STATE: `store.view()` emits `view` and never
@@ -995,31 +1056,79 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
return
}
if (!binding) return
- binding.kind = KINDS[(KINDS.indexOf(binding.kind) + 1) % KINDS.length]
+ editChart(true)
+ })
+
+ // --- the chart editor (chartedit.ts), in the properties panel ---------------
+ //
+ // THE CHART IS AN OBJECT YOU SELECT. Clicking it (or Edit, or making it) hands
+ // the panel to its editor; clicking back into the grid hands the panel back to
+ // the cell. Slides does the same by element type, and it is why the editor
+ // can live in the panel the reader already knows instead of a third pane.
+ /** Replace the binding, keep the file and the plot in step. */
+ const setBinding = (next: ChartBinding): void => {
+ binding = next
rememberChart()
drawChart()
- })
+ // `rememberChart` commits, and the commit rebuilds the panel; a read-only
+ // workbook commits nothing, so the panel is asked directly.
+ if (store.readOnly) panels?.refresh()
+ }
+ const chartEditor = {
+ key: 'chart',
+ build: (host: HTMLElement, kit: typeof KIT): void => {
+ const sheet = chartSheet()
+ if (!binding || !sheet) return
+ buildChartEditor({ host, kit, sheet, binding, readOnly: store.readOnly, set: setBinding })
+ },
+ }
+ /** Give the panel to the chart editor — and, asked from a button, open it. */
+ const editChart = (reveal = false): void => {
+ if (!binding || chartEl.hidden || !panels) return
+ panels.setOverride(chartEditor)
+ if (reveal) panels.reveal(t('Chart'))
+ }
+ const unEditChart = (): void => {
+ if (panels?.override() === 'chart') panels.setOverride(null)
+ }
+ // On the plot, not the head's buttons: ✕ closes, and a close must not first
+ // pull the panel over to an editor for a chart that is about to go.
+ chartBody.addEventListener('pointerdown', () => { if (binding && !viz) editChart() })
+ // Back to the grid, back to the cell. CAPTURE, so it lands before the grid's
+ // own handlers repaint the selection the panel is about to describe.
+ app.querySelector<HTMLElement>('.dx-grid')!.addEventListener('pointerdown', unEditChart, true)
app.querySelector('.dx-chart-close')!.addEventListener('click', () => {
chartEl.hidden = true
// Closing the panel is closing the chart — the document should not keep a
// chart the reader has just dismissed and would not see on reopening.
binding = null; chartSheetId = null
rememberChart()
- clearPivot()
+ unEditChart()
teardown?.(); teardown = null
vizDown?.(); vizDown = null; viz = null; vizSheetId = null
})
app.querySelector('[data-act="chart"]')!.addEventListener('click', () => {
const sheet = dataset('chart')
if (!sheet) return
- clearPivot()
vizDown?.(); vizDown = null; viz = null; vizSheetId = null
- binding = defaultBinding(sheet)
+ // THE SELECTION, as the tooltip has always said ("Chart the selected
+ // columns"): its measures are the series, its first text column the
+ // categories. A selection with nothing numeric in it falls back to the
+ // sheet's own default rather than an empty axis.
+ const vis = grid.visibleColumns()
+ const at = new Set<number>()
+ for (const r of grid.sel.ranges()) {
+ const box = normalize(r)
+ for (let c = box.left; c <= box.right; c++) at.add(c)
+ }
+ const picked = [...at].sort((a, b) => a - b).map((i) => vis[i]?.id).filter((id): id is string => !!id)
+ binding = bindingFromSelection(sheet, picked)
chartSheetId = sheet.id
if (!binding) { showFindings(findingsEl, [{ message: t('This sheet has no numeric column to chart yet.') }]); return }
chartEl.hidden = false
rememberChart()
drawChart()
+ editChart()
})
/**
* REOPEN THE CHART THE FILE WAS SAVED WITH.
@@ -1108,7 +1217,7 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
app.querySelector('[data-act="viz3d"]')!.addEventListener('click', () => {
const sheet = dataset('viz3d')
if (!sheet) return
- clearPivot()
+ unEditChart()
viz = defaultViz3d(sheet)
if (!viz) {
showFindings(findingsEl, [{ message: t('This sheet needs at least three numeric columns, or a latitude and longitude, to plot in 3D.') }])
@@ -1123,7 +1232,16 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// Sheets on the left, properties on the right — the suite's shared chrome.
// AFTER grid.onSelectionChange is set: mountPanels CHAINS that callback
// rather than replacing it, so the formula bar and status bar keep working.
- panels = mountPanels({ store, grid, body: app.querySelector<HTMLElement>('.dx-body')! })
+ // The pivot's door into the tab strip. LATE-BOUND: the open/close verbs are
+ // declared further down, beside the pivot view they drive, and nothing calls
+ // these until a tab is clicked.
+ const views: SheetViews = {
+ showing: () => pivotShown,
+ canOpen: (s) => isPivotSheet(s),
+ open: (s) => openPivot(s.id),
+ close: () => closePivot(),
+ }
+ panels = mountPanels({ store, grid, body: app.querySelector<HTMLElement>('.dx-body')!, views })
// Comments. AFTER mountPanels, which chains grid.onSheetChange.
@@ -1140,33 +1258,107 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// quarter" is an argument about what the data means, somebody built it, and
// "look at the pivot on sheet 3" has to name something that exists in the
// file. The sheet stores the SPEC and never the numbers.
- let pivotSpec: PivotSpec | null = null
+ //
+ // IT OPENS LIKE A SHEET. Its tab shows it where the grid was, and the
+ // properties panel becomes its field editor (pivotfields.ts) — Excel's
+ // PivotTable Fields pane, in the place dash's panel already is. Which pivot is
+ // up is VIEW state, exactly as which tab is up is: nothing about opening one
+ // is written to the file.
+ const pivotEl = app.querySelector<HTMLElement>('.dx-pivotview')!
+ const pivotBody = app.querySelector<HTMLElement>('.dx-pivotview-body')!
+ const gridEl = app.querySelector<HTMLElement>('.dx-grid')!
let pivotDown: (() => void) | null = null
- const drawPivot = (): void => {
- if (!pivotSpec || chartEl.hidden) return
- pivotDown?.(); teardown?.(); teardown = null
- const src = store.doc.sheets.find((sh) => sh.id === pivotSpec!.from)
- if (!src || src.kind !== 'table') return
- chartTitle.textContent = `${t('Pivot')} · ${src.name}`
- // A pivot has no chart KIND, so the Bar/Line toggle beside the title is a
- // control that does nothing to what is on screen. Hidden here and restored
- // by the chart path below.
- kindBtn.hidden = true
- // `grid.computed` IS KEYED BY COLUMN ID AND BELONGS TO THE SHOWN SHEET, so
- // handing it to a pivot pinned to another one summarises this sheet's
- // formulas under that sheet's column names — the mistake `drawChart` names
- // in its own comment. Off the source sheet (a spreadsheet tab included),
- // recompute the source's own values instead.
- const computed = src.id === grid.showingId()
+ const pivotSheet = (): PivotSheet | null => {
+ const s = store.doc.sheets.find((x) => x.id === pivotShown)
+ return s && isPivotSheet(s) ? s : null
+ }
+ const pivotSource = (spec: PivotSpec): TableSheet | null => {
+ const s = store.doc.sheets.find((x) => x.id === spec.from)
+ return s && s.kind === 'table' ? s : null
+ }
+ // `grid.computed` IS KEYED BY COLUMN ID AND BELONGS TO THE SHOWN SHEET — and
+ // under a pivot the grid is hidden on whatever sheet it was last on, which is
+ // only sometimes the source. Off the source, recompute the source's own.
+ const sourceComputed = (src: TableSheet): Map<string, unknown[]> =>
+ src.id === grid.showingId()
? (grid.computed as Map<string, unknown[]>)
: (recalc(src, store.doc.modified).values as Map<string, unknown[]>)
- pivotDown = mountPivot(chartBody, runPivot(src, pivotSpec, { computed }), { sheet: src, computed })
+ const drawPivot = (): void => {
+ const ps = pivotSheet()
+ if (!ps) return
+ const spec = readPivotSpec(ps)!
+ const src = pivotSource(spec)
+ pivotDown?.(); pivotDown = null
+ app.querySelector<HTMLElement>('.dx-pivotview-title')!.textContent = ps.name
+ const srcEl = app.querySelector<HTMLElement>('.dx-pivotview-src')!
+ if (!src) {
+ srcEl.textContent = ''
+ pivotBody.textContent = ''
+ const p = document.createElement('p')
+ p.className = 'dxp-empty'
+ p.textContent = t('The sheet this pivot summarised is not in the workbook any more.')
+ pivotBody.append(p)
+ return
+ }
+ srcEl.textContent = t('from {sheet}', { sheet: src.name })
+ const computed = sourceComputed(src)
+ pivotDown = mountPivot(pivotBody, runPivot(src, spec, { computed }), { sheet: src, computed })
+ }
+ const pivotFields = {
+ key: 'pivot',
+ build: (host: HTMLElement, kit: typeof KIT): void => {
+ const ps = pivotSheet()
+ if (!ps) return
+ const src = pivotSource(readPivotSpec(ps)!)
+ buildPivotFields({
+ host, kit, sheet: ps, source: src,
+ computed: src ? sourceComputed(src) : undefined,
+ readOnly: store.readOnly,
+ // ONE PATCH PER EDIT, so a press of undo takes back exactly the field
+ // that moved. `setSheet` replaces the sheet whole; its inverse is the
+ // sheet as it was.
+ commit: (spec) => {
+ const cur = pivotSheet()
+ if (!cur || store.readOnly) return
+ store.commit({ op: 'setSheet', id: cur.id, sheet: { ...cur, pivot: spec } as never })
+ },
+ })
+ },
}
- const clearPivot = (): void => {
- pivotDown?.(); pivotDown = null; pivotSpec = null
- kindBtn.hidden = false
+ const openPivot = (id: string): boolean => {
+ const s = store.doc.sheets.find((x) => x.id === id)
+ if (!s || !isPivotSheet(s)) return false
+ pivotShown = id
+ gridEl.hidden = true
+ dashEl.hidden = true
+ pivotEl.hidden = false
+ drawPivot()
+ panels?.setOverride(pivotFields)
+ gateActions(true)
+ syncBridge()
+ views.onChange?.()
+ return true
+ }
+ const closePivot = (): void => {
+ if (!pivotShown) return
+ pivotShown = null
+ pivotDown?.(); pivotDown = null
+ pivotEl.hidden = true
+ gridEl.hidden = false
+ if (panels?.override() === 'pivot') panels.setOverride(null)
+ gateActions(true)
+ syncBridge()
+ views.onChange?.()
}
- store.on('doc', () => { if (pivotSpec) drawPivot() })
+ // THE DOCUMENT CAN TAKE THE PIVOT AWAY: a delete, an undo of the Pivot button
+ // that made it, a collaborator, About's restore. The view closes rather than
+ // keeping the last numbers it drew on screen.
+ store.on('doc', () => {
+ if (!pivotShown) return
+ if (!pivotSheet()) closePivot()
+ else drawPivot()
+ })
+ store.on('view', () => { if (pivotShown) drawPivot() })
// REGISTERED AFTER ALL THREE PANELS EXIST, and that is not tidiness: this
// closure calls `drawPivot`, a `const` declared above, and a sheet switch
@@ -1182,7 +1374,9 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// hook they corrected themselves only at the next keystroke.
grid.onSheetChange = (id) => {
chartAfterSheetChange?.(id)
- drawChart(); draw3d(); drawPivot()
+ // The grid moved to a sheet, so the grid is what is on screen now.
+ closePivot()
+ drawChart(); draw3d()
gateActions()
}
// AND ON `doc`, because a sheet switch is not the only way the kind under the
@@ -1227,15 +1421,15 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
// A PATCH, not replaceDoc: creating a pivot used to clear the undo stack,
// so every edit you could previously take back vanished the moment you
// asked for a summary of them.
+ // Placed RIGHT AFTER its source, where a reader looks for it, rather than
+ // at the far end of the strip.
const id = `pivot-${Math.floor(Date.now() % 1e8).toString(36)}`
+ const at = store.doc.sheets.findIndex((s) => s.id === from.id) + 1
store.commit({
- op: 'setSheet', id,
- sheet: newPivotSheet(id, `${from.name} — ${t('pivot')}`, spec),
+ op: 'setSheet', id, at,
+ sheet: newPivotSheet(id, mintSheetName(store.doc, `${from.name} — ${t('pivot')}`), spec),
} as never)
- binding = null; viz = null; vizDown?.(); vizDown = null; vizSheetId = null
- pivotSpec = spec
- chartEl.hidden = false
- drawPivot()
+ openPivot(id)
})
// --- the dashboard. The LAYOUT is document data (doc.views); the SELECTION
@@ -1247,6 +1441,8 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
dash.computed = () => grid.computed as Map<string, unknown[]>
app.querySelector('[data-act="dashboard"]')!.addEventListener('click', () => {
const show = dashEl.hidden
+ // The dashboard takes the centre, so a pivot that had it gives it back.
+ if (show) closePivot()
dashEl.hidden = !show
app.querySelector<HTMLElement>('.dx-grid')!.hidden = show
if (show) dash.render()
@@ -1283,25 +1479,22 @@ function boot(doc: DashDoc, repaired: number, frozen?: 'policy' | 'version', sav
computed: (id) => (id === grid.showingId() ? (grid.computed as Map<string, unknown[]>) : undefined),
})
- // ESCAPE CLOSES THE STORY AND PIVOT PANELS (review 4.8), as it closes every
- // other dismissable surface in dash. One Escape closes ONE thing: anything
- // that already claimed this key (a menu, a dialog, Find, a cell editor, the
- // grid's copy marks) prevented or stopped it, and a dropdown still open is
+ // ESCAPE CLOSES THE STORY PANEL (review 4.8), as it closes every other
+ // dismissable surface in dash. One Escape closes ONE thing: anything that
+ // already claimed this key (a menu, a dialog, Find, a cell editor, the grid's
+ // copy marks) prevented or stopped it, and a dropdown still open is
// shutMenus' to close. Registered before shutMenus' listener for that check.
- // The story first, then the pivot: the story editor floats above the panel.
+ // NOT THE PIVOT: 4.8 was also about the Pivot side panel, which is gone — a
+ // pivot is a sheet with a tab, and as in Excel you leave a sheet by its tab,
+ // never with Escape.
document.addEventListener('keydown', (e) => {
if (e.key !== 'Escape' || e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey) return
if (document.querySelector('.dx-dd.open, .dx-pop, .dx-ask-back, .dx-tab-menu, .ds-overlay')) return
const tgt = e.target as HTMLElement | null
const inStory = !!tgt?.closest?.('.ds-editor')
- const inPivot = !!pivotSpec && !!tgt && chartEl.contains(tgt)
// a field elsewhere (the formula bar, a panel input) keeps its own Escape
- if (!inStory && !inPivot && tgt && (tgt.tagName === 'INPUT' || tgt.tagName === 'TEXTAREA' || tgt.tagName === 'SELECT' || tgt.isContentEditable)) return
- if (closeStoryEditor()) { e.preventDefault(); if (inStory) grid.focusGrid(); return }
- if (pivotSpec && !chartEl.hidden) {
- e.preventDefault()
- app.querySelector<HTMLElement>('.dx-chart-close')?.click()
- }
+ if (!inStory && tgt && (tgt.tagName === 'INPUT' || tgt.tagName === 'TEXTAREA' || tgt.tagName === 'SELECT' || tgt.isContentEditable)) return
+ if (closeStoryEditor()) { e.preventDefault(); if (inStory) grid.focusGrid() }
})
const notes: Notice[] = []
diff --git a/dash/src/panels.ts b/dash/src/panels.ts
index be029472..785690a4 100644
--- a/dash/src/panels.ts
+++ b/dash/src/panels.ts
@@ -44,7 +44,7 @@ import {
buildValidationSection, canvasEntryAt, canvasRulePatch, canvasRules, columnRule,
countViolations, columnRulePatch, boxRef, type DataRule,
} from './datavalid.ts'
-import { mountTabs, renameSheetPatches } from './tabs.ts'
+import { mountTabs, renameSheetPatches, type SheetViews } from './tabs.ts'
import { inferComputedType, retypePatch } from './computedtype.ts'
import { buildCondFmtSection, condFmtPatch, readCondFmt } from './condfmtui.ts'
import { toast } from './saveui.ts'
@@ -164,6 +164,23 @@ export interface PanelsHost {
grid: Grid
/** the `.dx-body` element — panels wrap whatever is already inside it */
body: HTMLElement
+ /** sheets shown in place of the grid (a pivot) — handed on to the tab strip */
+ views?: SheetViews
+}
+
+/**
+ * Something other than the grid's selection that owns the panel for now — a
+ * pivot's field editor while the pivot is up, a chart's editor while the chart
+ * is being worked on. Slides' panel does the same thing by element type: select
+ * a chart and the panel is the chart's.
+ *
+ * `build` draws into the panel with the same row builders every section uses,
+ * and is called again on every document event, so it reads the document fresh
+ * each time rather than holding onto what it drew.
+ */
+export interface PanelOverride {
+ key: string
+ build(host: HTMLElement, kit: PanelKit): void
}
export interface Panels {
@@ -181,6 +198,10 @@ export interface Panels {
* which boots with the panel shut, by design.
*/
reveal(title: string): void
+ /** Hand the panel to something other than the grid, or give it back (null). */
+ setOverride(o: PanelOverride | null): void
+ /** Who has the panel, or null for the grid. */
+ override(): string | null
}
export function mountPanels(host: PanelsHost): Panels {
@@ -222,7 +243,7 @@ export function mountPanels(host: PanelsHost): Panels {
// the other half of that move is wired; the alternative (a second call in
// main.ts) mounts the strip TWICE if this line is ever forgotten, which is
// exactly the shape of bug two people editing one screen produce.
- mountTabs({ store, grid, body })
+ mountTabs({ store, grid, body, views: host.views })
// --- widths and collapse, both remembered ---------------------------------
@@ -365,8 +386,15 @@ export function mountPanels(host: PanelsHost): Panels {
// --- the properties panel -------------------------------------------------
+ let owner: PanelOverride | null = null
+
function renderProps(): void {
right.textContent = ''
+ if (owner) {
+ owner.build(right, KIT)
+ applyAccordion(right)
+ return
+ }
const sheet = currentSheet()
if (!sheet) {
// A SPREADSHEET IS NOT A MISSING TABLE, and it is not an EMPTY panel
@@ -942,7 +970,13 @@ export function mountPanels(host: PanelsHost): Panels {
}
}
- return { toggle, refresh: () => render(true), reveal }
+ function setOverride(o: PanelOverride | null): void {
+ if ((owner?.key ?? null) === (o?.key ?? null) && owner === o) return
+ owner = o
+ render(true)
+ }
+
+ return { toggle, refresh: () => render(true), reveal, setOverride, override: () => owner?.key ?? null }
}
// --- a popover, placed against a rect ---------------------------------------
diff --git a/dash/src/pivot.ts b/dash/src/pivot.ts
index f1d60c42..71019228 100644
--- a/dash/src/pivot.ts
+++ b/dash/src/pivot.ts
@@ -75,9 +75,9 @@
// The engine half is pure and runs in node; the DOM half is at the bottom.
import './pivot.css'
-import type { Column, ColumnData, Sheet, TableSheet } from './model.ts'
+import type { Column, ColumnData, Sheet, StoredPredicate, TableSheet } from './model.ts'
import { readCell } from './store.ts'
-import { buildOrder, isBlank, type ColumnFilter, type Get } from './filter.ts'
+import { buildOrder, isBlank, type ColumnFilter, type Get, type Predicate } from './filter.ts'
import { formatValue } from './format.ts'
import { t } from './i18n.ts'
@@ -94,6 +94,63 @@ export const AGG_LABEL: Record<AggFn, string> = {
median: 'Median', countDistinct: 'Distinct',
}
+/**
+ * One entry in the pivot's Filters area, in the form that survives JSON. `pred`
+ * absent = "(All)". `pred` may also be a live filter.ts `Predicate` (a `Set`
+ * checklist) for a caller that built one in memory — `liveFilters` reads both.
+ */
+export interface PivotFilter {
+ col: string
+ pred?: StoredPredicate | Predicate
+ [extra: string]: unknown
+}
+
+/**
+ * Stored filters → the live ones `buildOrder` evaluates.
+ *
+ * Entries with no predicate are the "(All)" case and drop out; a predicate op
+ * this build cannot evaluate drops out too — KEPT in the document by the spread
+ * in `readPivotSpec`, refused here, the additive rule `toPredicate` in story.ts
+ * follows. A copy of that bridge rather than an import of it, because story.ts
+ * is a DOM module and this half of the file runs in node.
+ */
+export function liveFilters(filters: readonly PivotFilter[] | undefined): ColumnFilter[] {
+ const out: ColumnFilter[] = []
+ for (const f of filters ?? []) {
+ if (!isObj(f) || typeof f.col !== 'string' || !isObj(f.pred)) continue
+ const p = f.pred as Record<string, unknown>
+ switch (p.op) {
+ case 'isOneOf': {
+ const set = p.set instanceof Set ? p.set
+ : new Set(Array.isArray(p.values) ? p.values : [])
+ out.push({ col: f.col, pred: { op: 'isOneOf', set } })
+ break
+ }
+ case 'equals': case 'notEquals': case 'greater': case 'less':
+ case 'greaterOrEqual': case 'lessOrEqual':
+ out.push({ col: f.col, pred: { op: p.op, v: p.v } as Predicate })
+ break
+ case 'contains': case 'notContains': case 'startsWith': case 'endsWith':
+ out.push({ col: f.col, pred: { op: p.op, v: String(p.v ?? '') } as Predicate })
+ break
+ case 'between':
+ out.push({ col: f.col, pred: { op: 'between', lo: p.lo, hi: p.hi } })
+ break
+ case 'isBlank': case 'notBlank':
+ out.push({ col: f.col, pred: { op: p.op } })
+ break
+ case 'topN': case 'bottomN': {
+ const n = Number(p.n)
+ if (Number.isFinite(n)) out.push({ col: f.col, pred: { op: p.op, n } })
+ break
+ }
+ default:
+ break
+ }
+ }
+ return out
+}
+
export interface PivotValue {
/** source column id */
col: string
@@ -118,8 +175,20 @@ export interface PivotSpec {
/** column fields, outermost first */
cols: string[]
values: PivotValue[]
- /** the pivot's OWN filters — document state, unlike the grid's (filter.ts:3) */
- filters?: ColumnFilter[]
+ /**
+ * The pivot's OWN filters — document state, unlike the grid's (filter.ts:3).
+ *
+ * STORED IN THE JSON SPELLING (`PivotFilter`): a checklist is `values`, an
+ * array, because filter.ts's live `Set` serializes as `{}` and would come back
+ * from the file matching NOTHING — model.ts's `StoredFilter` rule, and the
+ * spelling a story step already uses. A live `ColumnFilter` is accepted too,
+ * so a caller holding one need not convert it.
+ *
+ * An entry with NO `pred` is a field sitting in the editor's Filters area with
+ * every value allowed — Excel's "(All)". It filters nothing, and it is kept so
+ * the field stays where the author put it.
+ */
+ filters?: PivotFilter[]
/** default true */
subtotals?: boolean
/** default true */
@@ -594,12 +663,23 @@ export function runPivot(sheet: TableSheet, spec: PivotSpec, opts: PivotOpts = {
// The pivot's OWN filters, through filter.ts — one implementation of "less
// than 10", not two. `topN` works here too, and ranks the whole source.
let rows: number[]
- if (spec.filters?.length) {
+ // Filters on a column that is gone are dropped and REPORTED, like a row or a
+ // column field: filtering on nothing would admit no rows at all, and a pivot
+ // of nothing beside a sentence that does not say why is the empty-axis lie.
+ const filters = liveFilters(spec.filters).filter((f) => {
+ if (has(f.col)) return true
+ findings.push({
+ kind: 'missing-column',
+ detail: `the filter field "${f.col}" names a column this sheet no longer has, so it is not filtering`,
+ })
+ return false
+ })
+ if (filters.length) {
const get: Get = (c, row) => {
const cv = comp(c)
return cv ? cv[row] ?? null : readCell(col(c), row)
}
- rows = buildOrder(n, get, spec.filters, [])
+ rows = buildOrder(n, get, filters, [])
} else {
rows = Array.from({ length: n }, (_, i) => i)
}
@@ -1109,7 +1189,11 @@ export function mountPivot(host: HTMLElement, res: PivotResult, opts: PivotViewO
td.title = t('no rows')
} else {
td.title = t('{n} source rows').replace('{n}', String(cell.rows))
- if (cell.skipped) {
+ // A COUNT reads every value, number or not — "Count of Owner" counts
+ // names, and marking each of its cells "values are not numbers and were
+ // not counted" says the opposite of what happened. Only the functions
+ // that do arithmetic can be short.
+ if (cell.skipped && c.value.fn !== 'count' && c.value.fn !== 'countDistinct') {
// Never folded into the number and never hidden: this is `Column.failed`
// (model.ts:87) at the aggregate level.
td.classList.add('dxp-skipped')
diff --git a/dash/src/pivotfields.css b/dash/src/pivotfields.css
new file mode 100644
index 00000000..88fef556
--- /dev/null
+++ b/dash/src/pivotfields.css
@@ -0,0 +1,161 @@
+/* SPDX-License-Identifier: MIT
+ Copyright (c) 2026 The Bento authors
+ The pivot field editor, in the properties panel. Co-located with
+ pivotfields.ts. Tokens come from styles.css and panels.css and are never
+ redefined here; fields wear THE FIELD (styles.css) with no class to remember. */
+
+.dpf-list {
+ display: flex;
+ flex-direction: column;
+ max-height: 220px;
+ overflow: auto;
+ border: 1px solid var(--line);
+ border-radius: var(--dp-radius, 6px);
+ background: var(--field);
+ margin: 0 0 4px;
+}
+
+.dpf-field {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 26px;
+ padding: 0 8px;
+ font-size: 12.5px;
+ cursor: grab;
+ border-bottom: 1px solid var(--grid-line, var(--line));
+}
+.dpf-field:last-child { border-bottom: 0; }
+.dpf-field:hover { background: var(--hover, var(--panel)); }
+.dpf-field input { margin: 0; flex: 0 0 auto; accent-color: var(--ink); }
+.dpf-field-name {
+ flex: 1 1 auto;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.dpf-used .dpf-field-name { font-weight: 600; }
+.dpf-field-type {
+ flex: 0 0 auto;
+ font-size: 10.5px;
+ color: var(--muted);
+ text-transform: uppercase;
+ letter-spacing: .03em;
+}
+
+/* An area: a drop zone that holds chips, then an "Add field…" picker. */
+.dpf-well {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ min-height: 34px;
+ padding: 4px;
+ border: 1px dashed var(--line-strong);
+ border-radius: var(--dp-radius, 6px);
+ margin: 0 0 4px;
+}
+.dpf-over,
+.dpf-list.dpf-over {
+ border-color: var(--accent-ink);
+ background: color-mix(in srgb, var(--accent) 10%, transparent);
+}
+.dpf-empty {
+ font-size: 11.5px;
+ color: var(--muted);
+ padding: 2px 4px;
+}
+
+.dpf-chip {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 6px;
+ min-height: 26px;
+ padding: 0 4px 0 8px;
+ font-size: 12.5px;
+ border: 1px solid var(--line);
+ border-radius: var(--dp-radius, 6px);
+ background: var(--surface, var(--bg));
+ cursor: grab;
+}
+.dpf-chip.dpf-missing { border-color: var(--accent); }
+.dpf-chip-name {
+ flex: 1 1 auto;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.dpf-of { color: var(--muted); flex: 0 0 auto; }
+.dpf-agg { flex: 0 0 auto; width: auto; max-width: 110px; }
+.dpf-add { width: 100%; }
+
+.dpf-x,
+.dpf-filter-btn {
+ font: inherit;
+ font-size: 11.5px;
+ border: 1px solid transparent;
+ background: transparent;
+ color: var(--muted);
+ border-radius: var(--dp-radius, 6px);
+ cursor: pointer;
+ padding: 1px 6px;
+ flex: 0 0 auto;
+}
+.dpf-filter-btn { border-color: var(--line); color: var(--ink-2, var(--ink)); }
+.dpf-x:hover,
+.dpf-filter-btn:hover { background: var(--panel); color: var(--ink); }
+
+.dpf-check {
+ flex: 1 0 100%;
+ display: flex;
+ flex-direction: column;
+ max-height: 180px;
+ overflow: auto;
+ margin: 2px 0 4px;
+ padding-top: 4px;
+ border-top: 1px solid var(--line);
+ cursor: default;
+}
+.dpf-check-item {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ min-height: 22px;
+ font-variant-numeric: tabular-nums;
+ cursor: pointer;
+}
+.dpf-check-item input { margin: 0; accent-color: var(--ink); }
+.dpf-check-all { font-weight: 600; }
+.dpf-note { color: var(--muted); font-size: 11px; padding: 2px 0; }
+
+/* ————— the pivot SHEET: the pivot drawn where the grid was ————— */
+.dx-pivotview {
+ flex: 1 1 auto;
+ min-width: 0;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ padding: 10px 12px;
+ background: var(--bg);
+ overflow: hidden;
+}
+.dx-pivotview[hidden] { display: none; }
+.dx-pivotview-head {
+ display: flex;
+ align-items: baseline;
+ gap: 10px;
+ padding: 0 2px 8px;
+ flex: 0 0 auto;
+}
+.dx-pivotview-title { font-weight: 650; font-size: 14px; }
+.dx-pivotview-src { color: var(--muted); font-size: 12px; }
+.dx-pivotview-body {
+ flex: 1 1 auto;
+ min-height: 0;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+}
+.dx-pivotview-body > .dxp { flex: 1 1 auto; }
diff --git a/dash/src/pivotfields.ts b/dash/src/pivotfields.ts
new file mode 100644
index 00000000..7080a612
--- /dev/null
+++ b/dash/src/pivotfields.ts
@@ -0,0 +1,562 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// The pivot's field editor — rows, columns, values and filters, the way every
+// peer lays them out (Excel's PivotTable Fields, Sheets' pivot editor, Numbers'
+// Pivot Options): the source's columns in a list, four areas under it, a field
+// dragged or picked into an area.
+//
+// A PIVOT THAT CAN ONLY BE GUESSED IS NOT A PIVOT. `defaultPivot` picks Region ×
+// Owner, sum of Value, and until this file existed that guess was the whole of
+// what a pivot could be: no way to group by Stage, to count rather than sum, or
+// to leave out the lost deals. A summary whose question somebody else chose is
+// a chart of the wrong thing.
+//
+// EVERY EDIT IS A SPEC, AND THE SPEC IS THE DOCUMENT. The operations at the top
+// of this file are pure functions from one `PivotSpec` to the next — no DOM, so
+// `scripts/test-dash-pivotfields.ts` holds them to the rules a drag gesture is
+// easy to get wrong:
+//
+// 1. A GROUPING FIELD IS IN ONE PLACE. Region in Rows AND Columns is a
+// diagonal of one-cell groups; Region in Rows and Filters disagrees with
+// itself. Moving a field between those three areas MOVES it.
+// 2. VALUES ARE NOT GROUPING. "Count of Region" beside Region in Rows is a
+// legitimate question, and so is Sum and Average of Value side by side —
+// so Values may repeat a column, but never the same column AND function
+// twice (two identical columns of numbers read as a rendering bug).
+// 3. THE FILTERS AREA STORES THE JSON SPELLING. A checklist is `values`, an
+// array; filter.ts's `Set` serializes as `{}` and would reopen matching
+// nothing (model.ts `StoredFilter`).
+// 4. AN EDIT NEVER MUTATES ITS INPUT. The spec it is handed is the one inside
+// `store.doc`; mutating it in place is a change the undo stack never saw.
+
+import './pivotfields.css'
+import type { Column, TableSheet } from './model.ts'
+import type { PanelKit } from './cellprops.ts'
+import {
+ AGG_FNS, isPivotSheet, readPivotSpec,
+ type AggFn, type PivotFilter, type PivotSheet, type PivotSpec, type PivotValue,
+} from './pivot.ts'
+import { distinctValues, matchKey, BLANK_KEY } from './filter.ts'
+import { readCell } from './store.ts'
+import { listLabel, TYPE_LABEL } from './format.ts'
+import { t } from './i18n.ts'
+
+// --- the operations ---------------------------------------------------------
+
+export type Area = 'filters' | 'cols' | 'rows' | 'values'
+
+const isMeasure = (c: Pick<Column, 'type'> | undefined): boolean =>
+ !!c && (c.type === 'number' || c.type === 'money' || c.type === 'percent')
+
+/**
+ * What a field means when it lands in Values with no function chosen. A
+ * measure is summed — that is the question asked of a money column nine times
+ * in ten. Anything else is COUNTED, because a sum of text is not a number and
+ * printing an empty column under "Sum of Region" is a broken pivot, not an
+ * answer.
+ */
+export const defaultAgg = (c: Pick<Column, 'type'> | undefined): AggFn =>
+ isMeasure(c) ? 'sum' : 'count'
+
+const clone = (spec: PivotSpec): PivotSpec => ({
+ ...spec,
+ rows: [...spec.rows],
+ cols: [...spec.cols],
+ values: spec.values.map((v) => ({ ...v })),
+ ...(spec.filters ? { filters: spec.filters.map((f) => ({ ...f })) } : {}),
+})
+
+/** The filter-area columns, in order. */
+export const filterCols = (spec: PivotSpec): string[] =>
+ (spec.filters ?? []).filter((f) => f && typeof f.col === 'string').map((f) => f.col)
+
+/** Which areas hold this column. */
+export function fieldAreas(spec: PivotSpec, col: string): Area[] {
+ const out: Area[] = []
+ if (filterCols(spec).includes(col)) out.push('filters')
+ if (spec.cols.includes(col)) out.push('cols')
+ if (spec.rows.includes(col)) out.push('rows')
+ if (spec.values.some((v) => v.col === col)) out.push('values')
+ return out
+}
+
+/** Take a column out of every GROUPING area (Values untouched). */
+function ungroup(s: PivotSpec, col: string): void {
+ s.rows = s.rows.filter((c) => c !== col)
+ s.cols = s.cols.filter((c) => c !== col)
+ if (s.filters) {
+ s.filters = s.filters.filter((f) => f.col !== col)
+ if (!s.filters.length) delete s.filters
+ }
+}
+
+const clampAt = (at: number | undefined, len: number): number =>
+ at === undefined || !Number.isFinite(at) ? len : Math.max(0, Math.min(len, Math.floor(at)))
+
+/**
+ * Put a column into an area, at a position (default: the end).
+ *
+ * Into a grouping area it MOVES — out of the other two first (rule 1) — and a
+ * filter it carried along with it is dropped: a checklist on Region was a
+ * statement about which regions to admit, and Region becoming a row field is
+ * the author asking to see them all. Into Values it is ADDED with `fn` (or the
+ * column's default), unless that exact column-and-function is already there
+ * (rule 2), in which case the spec comes back unchanged.
+ */
+export function addField(
+ spec: PivotSpec, col: string, area: Area,
+ opts: { at?: number; fn?: AggFn; column?: Pick<Column, 'type'> } = {},
+): PivotSpec {
+ const s = clone(spec)
+ if (area === 'values') {
+ const fn = opts.fn ?? defaultAgg(opts.column)
+ if (s.values.some((v) => v.col === col && v.fn === fn)) return spec
+ s.values.splice(clampAt(opts.at, s.values.length), 0, { col, fn })
+ return s
+ }
+ // Re-inserting into the SAME area at a later index: the index was measured
+ // with the field still in the list, so it shifts by one once it is taken out.
+ let at = opts.at
+ const list = area === 'filters' ? filterCols(s) : s[area]
+ const was = list.indexOf(col)
+ if (was >= 0 && at !== undefined && at > was) at -= 1
+ ungroup(s, col)
+ if (area === 'filters') {
+ const fs = s.filters ?? []
+ fs.splice(clampAt(at, fs.length), 0, { col })
+ s.filters = fs
+ } else {
+ s[area].splice(clampAt(at, s[area].length), 0, col)
+ }
+ return s
+}
+
+/** Take the `index`th entry out of an area. Out of range is a no-op. */
+export function removeField(spec: PivotSpec, area: Area, index: number): PivotSpec {
+ const s = clone(spec)
+ if (area === 'values') {
+ if (!s.values[index]) return spec
+ s.values.splice(index, 1)
+ } else if (area === 'filters') {
+ if (!s.filters?.[index]) return spec
+ s.filters.splice(index, 1)
+ if (!s.filters.length) delete s.filters
+ } else {
+ if (index < 0 || index >= s[area].length) return spec
+ s[area].splice(index, 1)
+ }
+ return s
+}
+
+/**
+ * Drag from one area to another (or within one).
+ *
+ * Within an area it is a reorder — and a Values entry keeps its function and
+ * its name through one. Across areas it is a remove then an add, so every rule
+ * `addField` keeps is kept here too; a value dragged into Rows stops being a
+ * value, and a row field dragged into Values becomes its default aggregate.
+ */
+export function moveField(
+ spec: PivotSpec,
+ from: { area: Area; index: number },
+ to: { area: Area; index?: number },
+ column?: Pick<Column, 'type'>,
+): PivotSpec {
+ const col = entryCol(spec, from.area, from.index)
+ if (col === null) return spec
+ if (from.area === to.area) {
+ const s = clone(spec)
+ if (from.area === 'values') {
+ const [v] = s.values.splice(from.index, 1)
+ let at = clampAt(to.index, s.values.length + 1)
+ if (at > from.index) at -= 1
+ s.values.splice(Math.min(at, s.values.length), 0, v)
+ return s
+ }
+ if (from.area === 'filters') {
+ const fs = s.filters!
+ const [f] = fs.splice(from.index, 1)
+ let at = clampAt(to.index, fs.length + 1)
+ if (at > from.index) at -= 1
+ fs.splice(Math.min(at, fs.length), 0, f)
+ return s
+ }
+ return addField(spec, col, to.area, { at: to.index })
+ }
+ const out = removeField(spec, from.area, from.index)
+ return addField(out, col, to.area, { at: to.index, column })
+}
+
+function entryCol(spec: PivotSpec, area: Area, index: number): string | null {
+ if (area === 'values') return spec.values[index]?.col ?? null
+ if (area === 'filters') return filterCols(spec)[index] ?? null
+ return spec[area][index] ?? null
+}
+
+/**
+ * Change a value's aggregate. A switch that would make it identical to another
+ * value already in the list is refused (spec unchanged), for rule 2.
+ */
+export function setAgg(spec: PivotSpec, index: number, fn: AggFn): PivotSpec {
+ const v = spec.values[index]
+ if (!v || v.fn === fn) return spec
+ if (spec.values.some((w, i) => i !== index && w.col === v.col && w.fn === fn)) return spec
+ const s = clone(spec)
+ s.values[index] = { ...s.values[index], fn }
+ return s
+}
+
+/**
+ * Set which values of a Filters-area column are admitted. `null` is "(All)":
+ * the field stays in the area and filters nothing. A column not yet in the area
+ * is added to it. `null` in `values` is the "(Blanks)" box.
+ */
+export function setFilterValues(spec: PivotSpec, col: string, values: unknown[] | null): PivotSpec {
+ const s = filterCols(spec).includes(col) ? clone(spec) : addField(spec, col, 'filters')
+ s.filters = (s.filters ?? []).map((f) => {
+ if (f.col !== col) return f
+ const next: PivotFilter = { ...f }
+ if (values === null) delete next.pred
+ else next.pred = { op: 'isOneOf', values: [...values] }
+ return next
+ })
+ return s
+}
+
+/**
+ * The tick in the field list. Ticked → it leaves every area. Unticked → a
+ * measure goes to Values (summed), anything else to Rows — Excel's rule, and
+ * the one that makes ticking three boxes produce a pivot somebody wanted.
+ */
+export function toggleField(spec: PivotSpec, col: string, column?: Pick<Column, 'type'>): PivotSpec {
+ if (fieldAreas(spec, col).length) {
+ const s = clone(spec)
+ ungroup(s, col)
+ s.values = s.values.filter((v) => v.col !== col)
+ return s
+ }
+ return addField(spec, col, isMeasure(column) ? 'values' : 'rows', { column })
+}
+
+// --- the editor -------------------------------------------------------------
+
+/** Display labels for the aggregate menu. LITERAL t() calls, so the i18n rig
+ * sees every one (cellprops.ts `kindLabel` says why). */
+const aggLabel = (fn: AggFn): string =>
+ fn === 'sum' ? t('Sum')
+ : fn === 'avg' ? t('Average')
+ : fn === 'count' ? t('Count')
+ : fn === 'min' ? t('Min')
+ : fn === 'max' ? t('Max')
+ : fn === 'median' ? t('Median')
+ : t('Distinct')
+
+const areaLabel = (a: Area): string =>
+ a === 'filters' ? t('Filters') : a === 'cols' ? t('Columns') : a === 'rows' ? t('Rows') : t('Values')
+
+const AREAS: readonly Area[] = ['filters', 'cols', 'rows', 'values']
+
+/** The MIME type of a field being dragged — custom, so a drag of some other
+ * text from elsewhere on the page is never mistaken for a field. */
+const DRAG_TYPE = 'application/x-bento-dash-pivot-field'
+
+interface DragPayload { col: string; area?: Area; index?: number }
+
+/** How many values a filter checklist lists before it says it stopped. */
+const FILTER_CAP = 300
+
+export interface PivotFieldsHost {
+ host: HTMLElement
+ kit: PanelKit
+ /** the pivot sheet being edited */
+ sheet: PivotSheet
+ /** its source dataset, or null when that sheet is gone */
+ source: TableSheet | null
+ /** the source's computed columns, for the filter checklist */
+ computed?: Map<string, unknown[]>
+ readOnly: boolean
+ /** write the next spec. The caller commits ONE patch for it. */
+ commit(spec: PivotSpec): void
+}
+
+const el = <K extends keyof HTMLElementTagNameMap>(
+ tag: K, cls?: string, text?: string,
+): HTMLElementTagNameMap[K] => {
+ const e = document.createElement(tag)
+ if (cls) e.className = cls
+ if (text !== undefined) e.textContent = text
+ return e
+}
+
+/** Filter checklists left open survive the rebuild every commit causes. */
+const openLists = new Set<string>()
+
+/**
+ * Draw the field editor into the properties panel.
+ *
+ * Re-drawn whole after every commit, like every other section of that panel —
+ * the spec is small and the panel is rebuilt from the document, which is what
+ * keeps it from disagreeing with an undo.
+ */
+export function buildPivotFields(o: PivotFieldsHost): void {
+ const { host, kit } = o
+ const read = readPivotSpec(o.sheet)
+ if (!read || !isPivotSheet(o.sheet)) return
+ const spec: PivotSpec = read
+ const src = o.source
+ const colOf = (id: string): Column | undefined => src?.columns.find((c) => c.id === id)
+ const nameOf = (id: string): string => colOf(id)?.name ?? id
+ const ro = o.readOnly
+ const commit = (next: PivotSpec): void => { if (!ro && next !== spec) o.commit(next) }
+
+ kit.section(host, t('Pivot table'))
+ kit.readonlyRow(host, t('Source'), src ? src.name : t('(missing sheet)'))
+ if (!src) {
+ kit.note(host, t('The sheet this pivot summarised is not in the workbook any more.'))
+ return
+ }
+
+ // --- the field list ---------------------------------------------------------
+ kit.section(host, t('Fields'))
+ const list = el('div', 'dpf-list')
+ list.setAttribute('role', 'list')
+ for (const c of src.columns) {
+ const used = fieldAreas(spec, c.id)
+ const item = el('label', 'dpf-field')
+ item.setAttribute('role', 'listitem')
+ item.dataset.col = c.id
+ item.draggable = !ro
+ const box = document.createElement('input')
+ box.type = 'checkbox'
+ box.checked = used.length > 0
+ box.disabled = ro
+ box.addEventListener('change', () => commit(toggleField(spec, c.id, c)))
+ const name = el('span', 'dpf-field-name', c.name)
+ const kind = el('span', 'dpf-field-type', t(TYPE_LABEL[c.type]))
+ item.append(box, name, kind)
+ if (used.length) {
+ item.title = used.map(areaLabel).join(' · ')
+ item.classList.add('dpf-used')
+ }
+ item.addEventListener('dragstart', (e) => startDrag(e, { col: c.id }))
+ list.append(item)
+ }
+ host.append(list)
+ // A field dragged back onto the list is taken OUT — Excel's gesture for
+ // removing one, and the only place a drag can mean "nowhere".
+ dropTarget(list, (p) => {
+ if (p.area === undefined || p.index === undefined) return
+ commit(removeField(spec, p.area, p.index))
+ })
+ if (!ro) kit.note(host, t('Drag a field into an area below, or tick it.'))
+
+ // --- the four areas ---------------------------------------------------------
+ for (const area of AREAS) {
+ kit.section(host, areaLabel(area))
+ const well = el('div', 'dpf-well')
+ well.dataset.area = area
+ const entries: string[] = area === 'values' ? spec.values.map((v) => v.col)
+ : area === 'filters' ? filterCols(spec) : spec[area]
+ entries.forEach((col, index) => well.append(chip(area, col, index)))
+ if (!entries.length) {
+ well.append(el('div', 'dpf-empty', area === 'values'
+ ? t('Drop a field here to summarise it')
+ : t('Drop a field here')))
+ }
+ if (!ro) well.append(adder(area))
+ host.append(well)
+ dropTarget(well, (p, e) => {
+ const at = dropIndex(well, e.clientY)
+ if (p.area === undefined || p.index === undefined) {
+ commit(addField(spec, p.col, area, { at, column: colOf(p.col) }))
+ } else {
+ commit(moveField(spec, { area: p.area, index: p.index }, { area, index: at }, colOf(p.col)))
+ }
+ })
+ }
+
+ // --- options ----------------------------------------------------------------
+ kit.section(host, t('Totals'))
+ const opt = (label: string, on: boolean, set: (v: boolean) => PivotSpec): void => {
+ const cb = kit.check(on, (v) => commit(set(v)))
+ cb.disabled = ro
+ kit.row(host, label, cb)
+ }
+ const flag = (key: 'subtotals' | 'grandTotals' | 'blanks', v: boolean): PivotSpec => {
+ const s = clone(spec)
+ // DEFAULT TRUE, so ON is spelled by ABSENCE: switching one off and back on
+ // leaves the file exactly as it was (panels.ts `totalsPatch` makes the same
+ // argument), and a collaborator sees no op for a pivot that is unchanged.
+ if (v) delete s[key]; else s[key] = false
+ return s
+ }
+ opt(t('Subtotals'), spec.subtotals !== false, (v) => flag('subtotals', v))
+ opt(t('Grand totals'), spec.grandTotals !== false, (v) => flag('grandTotals', v))
+ opt(t('Show (blank) groups'), spec.blanks !== false, (v) => flag('blanks', v))
+
+ // --- pieces -----------------------------------------------------------------
+
+ function chip(area: Area, col: string, index: number): HTMLElement {
+ const c = el('div', 'dpf-chip')
+ c.dataset.col = col
+ c.dataset.index = String(index)
+ c.draggable = !ro
+ c.addEventListener('dragstart', (e) => startDrag(e, { col, area, index }))
+ const missing = !colOf(col)
+ if (missing) c.classList.add('dpf-missing')
+ if (area === 'values') {
+ const v: PivotValue = spec.values[index]
+ const known = (AGG_FNS as string[]).includes(v.fn)
+ const sel = kit.select(
+ known ? AGG_FNS.map((fn) => [fn, aggLabel(fn)] as const) : [[String(v.fn), String(v.fn)] as const],
+ String(v.fn),
+ (fn) => commit(setAgg(spec, index, fn as AggFn)))
+ sel.className = 'dpf-agg'
+ sel.disabled = ro || !known
+ sel.title = t('How to summarise {name}', { name: nameOf(col) })
+ sel.setAttribute('aria-label', sel.title)
+ c.append(sel, el('span', 'dpf-of', t('of')))
+ }
+ c.append(el('span', 'dpf-chip-name', nameOf(col)))
+ if (missing) c.title = t('This column is not in {sheet} any more.', { sheet: src!.name })
+ if (area === 'filters') {
+ const f = (spec.filters ?? [])[index]
+ const btn = el('button', 'dpf-filter-btn', filterSummary(f, col))
+ btn.type = 'button'
+ btn.title = t('Choose which values to include')
+ btn.setAttribute('aria-expanded', String(openLists.has(col)))
+ btn.addEventListener('click', () => {
+ if (openLists.has(col)) openLists.delete(col); else openLists.add(col)
+ const next = c.querySelector('.dpf-check')
+ if (next) { next.remove(); btn.setAttribute('aria-expanded', 'false'); return }
+ btn.setAttribute('aria-expanded', 'true')
+ c.append(checklist(col, f))
+ })
+ c.append(btn)
+ }
+ if (!ro) {
+ const x = el('button', 'dpf-x', '✕')
+ x.type = 'button'
+ x.title = t('Remove {name}', { name: nameOf(col) })
+ x.setAttribute('aria-label', x.title)
+ x.addEventListener('click', () => commit(removeField(spec, area, index)))
+ c.append(x)
+ }
+ if (area === 'filters' && openLists.has(col)) c.append(checklist(col, (spec.filters ?? [])[index]))
+ return c
+ }
+
+ function adder(area: Area): HTMLElement {
+ const opts: Array<readonly [string, string]> = [['', t('Add field…')]]
+ for (const c of src!.columns) {
+ // A grouping area offers what is not already in it; Values offers every
+ // column, because Sum AND Average of one column is a fair question.
+ if (area !== 'values' && fieldAreas(spec, c.id).includes(area)) continue
+ opts.push([c.id, c.name])
+ }
+ const sel = kit.select(opts, '', (id) => {
+ if (!id) return
+ commit(addField(spec, id, area, { column: colOf(id) }))
+ })
+ sel.className = 'dpf-add'
+ sel.title = t('Add a field to {area}', { area: areaLabel(area) })
+ sel.setAttribute('aria-label', sel.title)
+ return sel
+ }
+
+ function filterSummary(f: PivotFilter | undefined, col: string): string {
+ const p = f?.pred as { op?: string; values?: unknown[]; set?: Set<unknown> } | undefined
+ if (!p) return t('All')
+ if (p.op === 'isOneOf') {
+ const vals = p.values ?? (p.set ? [...p.set] : [])
+ if (vals.length === 1) return vals[0] === null ? t('(Blanks)') : listLabel(vals[0], colOf(col))
+ return t('{n} selected', { n: vals.length })
+ }
+ return t('Custom')
+ }
+
+ function checklist(col: string, f: PivotFilter | undefined): HTMLElement {
+ const box = el('div', 'dpf-check')
+ const column = colOf(col)
+ const n = src!.rids.reduce((a, [, k]) => a + k, 0)
+ const comp = o.computed?.get(col)
+ const get = (_c: string, r: number): unknown => (comp ? comp[r] : readCell(src!.data[col], r))
+ const all = distinctValues(get, col, n, FILTER_CAP)
+ const p = f?.pred as { op?: string; values?: unknown[] } | undefined
+ const ticked = new Set<string>(p?.op === 'isOneOf' && Array.isArray(p.values)
+ ? p.values.map(matchKey)
+ : all.values.map(matchKey))
+ const allBox = document.createElement('input')
+ allBox.type = 'checkbox'
+ allBox.checked = all.values.every((v) => ticked.has(matchKey(v)))
+ allBox.disabled = ro
+ const allRow = el('label', 'dpf-check-item dpf-check-all')
+ allRow.append(allBox, el('span', '', t('(Select all)')))
+ allBox.addEventListener('change', () => commit(setFilterValues(spec, col, allBox.checked ? null : [])))
+ box.append(allRow)
+ for (const v of all.values) {
+ const k = matchKey(v)
+ const row = el('label', 'dpf-check-item')
+ const cb = document.createElement('input')
+ cb.type = 'checkbox'
+ cb.checked = ticked.has(k)
+ cb.disabled = ro
+ cb.dataset.k = k
+ cb.addEventListener('change', () => {
+ if (cb.checked) ticked.add(k); else ticked.delete(k)
+ const keep = all.values.filter((x) => ticked.has(matchKey(x)))
+ // EVERYTHING TICKED IS "(All)", spelled by the absent predicate — not a
+ // list of today's values, which would silently exclude every value a
+ // later edit adds to the column.
+ commit(setFilterValues(spec, col, keep.length === all.values.length && !all.truncated ? null : keep))
+ })
+ row.append(cb, el('span', '', k === BLANK_KEY ? t('(Blanks)') : listLabel(v, column)))
+ box.append(row)
+ }
+ if (all.truncated) {
+ box.append(el('div', 'dpf-note', t('Only the first {n} values are listed.', { n: FILTER_CAP })))
+ }
+ return box
+ }
+
+ function startDrag(e: DragEvent, p: DragPayload): void {
+ if (ro || !e.dataTransfer) return
+ e.dataTransfer.setData(DRAG_TYPE, JSON.stringify(p))
+ e.dataTransfer.effectAllowed = 'move'
+ }
+}
+
+/** Accept a dragged field. Only ours: anything else dragged over is ignored. */
+function dropTarget(target: HTMLElement, onDrop: (p: DragPayload, e: DragEvent) => void): void {
+ target.addEventListener('dragover', (e) => {
+ if (!e.dataTransfer?.types.includes(DRAG_TYPE)) return
+ e.preventDefault()
+ e.dataTransfer.dropEffect = 'move'
+ target.classList.add('dpf-over')
+ })
+ target.addEventListener('dragleave', (e) => {
+ if (!target.contains(e.relatedTarget as Node | null)) target.classList.remove('dpf-over')
+ })
+ target.addEventListener('drop', (e) => {
+ target.classList.remove('dpf-over')
+ const raw = e.dataTransfer?.getData(DRAG_TYPE)
+ if (!raw) return
+ e.preventDefault()
+ e.stopPropagation()
+ let p: DragPayload
+ try { p = JSON.parse(raw) as DragPayload } catch { return }
+ if (!p || typeof p.col !== 'string') return
+ onDrop(p, e)
+ })
+}
+
+/** Where in a well a drop at `y` lands: before the first chip whose middle is
+ * below the pointer. */
+function dropIndex(well: HTMLElement, y: number): number {
+ const chips = [...well.querySelectorAll<HTMLElement>(':scope > .dpf-chip')]
+ for (let i = 0; i < chips.length; i++) {
+ const r = chips[i].getBoundingClientRect()
+ if (y < r.top + r.height / 2) return i
+ }
+ return chips.length
+}
diff --git a/dash/src/tabs.ts b/dash/src/tabs.ts
index 8620950c..6c55e48f 100644
--- a/dash/src/tabs.ts
+++ b/dash/src/tabs.ts
@@ -376,7 +376,7 @@ export function stepSheet(doc: DashDoc, from: string, dir: -1 | 1): string | nul
* arrived, and a label that confidently states the wrong thing is worse than
* a vague one. */
export function describeKind(kind: string): { chip: string; why: string } {
- if (kind === 'pivot') return { chip: t('Pivot'), why: t('pivot table — open it from + Pivot') }
+ if (kind === 'pivot') return { chip: t('Pivot'), why: t('pivot table — a summary of another sheet') }
// "Canvas" is the WIRE word and does not change (PLATFORM §3). What a reader
// sees is "Spreadsheet", the same way select() localises display labels while
// values stay model words.
@@ -636,6 +636,32 @@ export interface TabsHost {
/** the `.dx-body` element — the strip is inserted directly after it, so it
* lands between the grid and the status bar without main.ts changing shape */
body: HTMLElement
+ /** sheets shown somewhere OTHER than the grid — a pivot sheet. Optional, so
+ * the strip still mounts (and refuses those tabs) without one. */
+ views?: SheetViews
+}
+
+/**
+ * A sheet the GRID cannot show and the app can — the pivot, drawn where the grid
+ * was. The strip asks this before falling back to "this build cannot open it",
+ * and highlights its tab while it is up.
+ *
+ * WHY A HOOK AND NOT `isOpenable`: `isOpenable` answers "can `grid.setSheet`
+ * take this", and a dozen callers (sheet deletion, ctrl+PgDn, the drag-to-open)
+ * rely on that meaning, because handing the grid a pivot throws. A pivot is
+ * opened by a different owner, so it gets a different door.
+ */
+export interface SheetViews {
+ /** the id of the sheet shown instead of the grid, or null */
+ showing(): string | null
+ /** can this sheet be opened by `open`? */
+ canOpen(sheet: Sheet): boolean
+ /** open it; false when it cannot be */
+ open(sheet: Sheet): boolean
+ /** back to the grid */
+ close(): void
+ /** set by the strip: call when `showing()` changes */
+ onChange?: () => void
}
export interface Tabs {
@@ -693,9 +719,12 @@ export function mountTabs(host: TabsHost): Tabs {
* a repaint. The kind-agnostic accessor is the whole fix.
*/
function showing(): string {
- return grid.showingId()
+ return host.views?.showing() ?? grid.showingId()
}
+ /** Does clicking this tab do anything? The grid's kinds, or a view's. */
+ const canShow = (s: Sheet): boolean => isOpenable(s) || !!host.views?.canOpen(s)
+
function commit(p: Patch | Patch[]): void {
if (ro()) return
store.commit(p)
@@ -768,7 +797,16 @@ export function mountTabs(host: TabsHost): Tabs {
el.appendChild(w)
}
- if (!isOpenable(sheet)) {
+ if (!isOpenable(sheet) && host.views?.canOpen(sheet)) {
+ // Opens where the grid was — a sheet like any other, with its kind named
+ // in the chip because it has no drawn mark of its own.
+ const { chip, why } = describeKind(kind)
+ el.title = `${sheet.name} — ${why}`
+ const badge = document.createElement('span')
+ badge.className = 'dx-tab-kind'
+ badge.textContent = chip
+ el.appendChild(badge)
+ } else if (!isOpenable(sheet)) {
// HONEST, NOT HIDDEN. The sheet is really in the file; a tab that is
// missing reads as a sheet that was deleted. The chip says what it is at
// a glance and the tooltip says why it will not open.
@@ -849,7 +887,20 @@ export function mountTabs(host: TabsHost): Tabs {
// A tab this build cannot open explains itself rather than doing nothing:
// the menu's first line is what the sheet IS, and the operations that DO
// work on it (duplicate, delete, move) are right there under it.
- if (!isOpenable(sheet)) { openMenu(el, sheet); return }
+ if (!isOpenable(sheet)) {
+ if (host.views?.open(sheet)) return
+ openMenu(el, sheet)
+ return
+ }
+ // Leaving a pivot for the grid. The grid may already be on this very sheet
+ // (it stays where it was under the pivot), and `setSheet` to the sheet it
+ // is showing changes nothing — so closing the view is the whole switch.
+ if (host.views?.showing()) {
+ host.views.close()
+ if (sheet.id !== grid.showingId()) grid.setSheet(sheet.id)
+ refresh(true)
+ return
+ }
if (sheet.id === showing()) return
grid.setSheet(sheet.id)
})
@@ -1158,13 +1209,16 @@ export function mountTabs(host: TabsHost): Tabs {
// trap this file's own header names: `isTable` answers "has columns",
// `isOpenable` answers "does clicking do anything", and only the second
// one is what a navigation list is asking.
- const open = isOpenable(sheet)
+ const open = canShow(sheet)
const kind = String((sheet as { kind?: unknown }).kind ?? '')
const label = (sheet.id === cur ? '✓ ' : '') + (sheet.name || t('(untitled sheet)')) +
(isTable(sheet) ? '' : ` · ${describeKind(kind).chip}`)
menuItem(menu, label, () => {
if (!open) return
- grid.setSheet(sheet.id)
+ if (!isOpenable(sheet)) { host.views?.open(sheet); return }
+ if (host.views?.showing()) host.views.close()
+ if (sheet.id !== grid.showingId()) grid.setSheet(sheet.id)
+ refresh(true)
}, !open, open ? '' : describeKind(kind).why)
}
})
@@ -1233,7 +1287,11 @@ export function mountTabs(host: TabsHost): Tabs {
* here too.
*/
store.beforePatch((patches) => {
- const cur = showing()
+ // THE GRID'S sheet, not `showing()`: this guards `grid.setSheet` against a
+ // sheet it cannot paint. While a pivot is up `showing()` is the pivot, and
+ // every edit to its fields is a `setSheet` to a non-grid kind — read as
+ // "doomed", it threw the reader onto the next tab on every drag.
+ const cur = grid.showingId()
if (!cur) return
// `isOpenable`, not `isTable`: a SPREADSHEET renders now, so a patch that
// replaces the showing sheet with one is not a sheet the grid has to flee.
@@ -1258,6 +1316,7 @@ export function mountTabs(host: TabsHost): Tabs {
window.addEventListener('resize', () => scrollActiveIntoView())
store.on('doc', () => refresh())
+ if (host.views) host.views.onChange = () => refresh()
// CHAINED, never replaced: panels.ts hangs its own rebuild off this callback
// and main.ts's import path is what fires it.
const announced = grid.onSheetChange
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index fb0e93fe..b45c7a32 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -11601,3 +11601,33 @@ value again.
Guarded by scripts/test-dash-entryparse.ts and
scripts/test-dash-entryparse-browser.mjs.
+
+## 2026-10-20 — dash: a pivot opens as a sheet; the chart is edited in the panel
+
+A pivot sheet now OPENS where the grid was (its tab works), and the properties
+panel becomes its field editor — Excel's PivotTable Fields layout. Which pivot
+is up is view state, like which tab is up; the grid stays on its last sheet
+underneath, and `isOpenable` still means "the grid can show it" (tabs.ts takes a
+separate `SheetViews` hook for kinds another owner draws). The pivot's own
+filters are stored in model.ts's `StoredFilter` spelling (`isOneOf` as a
+`values` array, never a Set); a Filters-area field with no `pred` means
+"(All)". A grouping field sits in one of Filters/Columns/Rows; Values may repeat
+a column but not a column-and-function.
+
+The 2D chart is edited in the properties panel while it is selected (clicking
+the plot or Edit), as a slides chart is. New `ChartBinding` fields are additive:
+`title`, `legend`, `colors` (keyed by column id, never position) and
+`allowLine`. A line whose category column has no order (text, enum, bool) is
+drawn as bars unless `allowLine` is set, and the refusal is made in
+`optionFor`, so the panel, a story and a dashboard all refuse alike. The value
+axis takes its label pattern from the series columns only when they all share
+one format; percent axes are scaled by 100.
+
+3D is hidden behind a per-viewer developer flag
+(`localStorage['bento-dash-dev-3d'] = 'on'`), never in the document; viz3d.ts
+stays.
+
+Escape does not leave a pivot: it is a sheet now, and as in Excel you leave a
+sheet by its tab. #808's Escape-closes-Pivot existed for the Pivot side panel
+(review 4.8), which this removes; Escape still closes the Story panel.
+
diff --git a/scripts/test-dash-chartbind.ts b/scripts/test-dash-chartbind.ts
new file mode 100644
index 00000000..a40dd431
--- /dev/null
+++ b/scripts/test-dash-chartbind.ts
@@ -0,0 +1,135 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// bento/dash chart binding rig — the chart from the SELECTION, the line it
+// refuses, and the axis that wears the column's format.
+//
+// node scripts/test-dash-chartbind.ts
+//
+// WHAT THIS PROVES, each against a failure measured in the 2026-10-20 review:
+// 1. "Chart the selected columns" charts the selected columns. With Value
+// selected it charted Value, Weighted and Computed — the selection was
+// never read. `bindingFromSelection` is the decision; the browser rig
+// (test-dash-pivotchart-browser.mjs) proves the button calls it.
+// 2. A line is not drawn through categories that have no order. The type
+// toggle drew a line from North to South to East; a line claims the space
+// between two points means something, and between two regions it does not.
+// Refused unless the author asked (`allowLine`).
+// 3. The value axis says £ when the series are money, % when percent (scaled
+// ×100, because percent columns store the fraction), and nothing when the
+// series do not share a format.
+// 4. The editor's additive fields reach the option: per-series colours keyed
+// by COLUMN (not position), the legend switch, and a binding without any of
+// them draws exactly what it always drew.
+
+import {
+ optionFor, bindingFromSelection, lineRefused, axisFormat, isOrdered, defaultBinding,
+ type ChartBinding,
+} from '../dash/src/chart.ts'
+import type { TableSheet } from '../dash/src/model.ts'
+
+let failures = 0
+let checks = 0
+function ok(cond: boolean, msg: string) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+
+const sheet = (): TableSheet => ({
+ id: 's', name: 'Pipeline', kind: 'table',
+ rids: [[1, 4]],
+ columns: [
+ { id: 'region', name: 'Region', type: 'text' },
+ { id: 'owner', name: 'Owner', type: 'text' },
+ { id: 'value', name: 'Value', type: 'money', format: '£#,##0' },
+ { id: 'closed', name: 'Closed', type: 'date' },
+ { id: 'prob', name: 'Probability', type: 'percent', format: '0%' },
+ { id: 'weighted', name: 'Weighted', type: 'money', format: '£#,##0' },
+ { id: 'qty', name: 'Qty', type: 'number' },
+ ],
+ data: {
+ region: { enc: 'raw', v: ['North', 'South', 'North', 'East'] },
+ owner: { enc: 'raw', v: ['Priya', 'Sam', 'Lee', 'Lee'] },
+ value: { enc: 'raw', v: [100, 200, 300, 400] },
+ closed: { enc: 'raw', v: ['2026-01-01', '2026-02-01', '2026-03-01', '2026-04-01'] },
+ prob: { enc: 'raw', v: [0.5, 0.25, 1, 0] },
+ weighted: { enc: 'raw', v: [50, 50, 300, 0] },
+ qty: { enc: 'raw', v: [1, 2, 3, 4] },
+ },
+ steps: [],
+} as unknown as TableSheet)
+
+type Opt = { series: Array<{ type: string; name: string; data: Array<number | null> }>; color: string[]; legend?: unknown; yAxis: { axisLabel?: { formatter?: string } }; xAxis: { data: string[] } }
+
+console.log('\n1. the selection is the chart')
+{
+ const s = sheet()
+ const b = bindingFromSelection(s, ['value'])!
+ ok(JSON.stringify(b.series) === '["value"]',
+ `Value selected → ONE series, Value (got ${JSON.stringify(b.series)}; the old button charted ${JSON.stringify(defaultBinding(s)!.series)})`)
+ ok(b.x === 'region' && b.aggregate === 'sum', 'with no text column in the selection, the sheet\'s first one is the categories, summed')
+ const two = bindingFromSelection(s, ['owner', 'value', 'weighted'])!
+ ok(two.x === 'owner' && JSON.stringify(two.series) === '["value","weighted"]',
+ 'Owner, Value, Weighted selected → Owner is the categories (the first TEXT column in the selection), the two money columns the series')
+ const none = bindingFromSelection(s, ['region'])!
+ ok(JSON.stringify(none) === JSON.stringify(defaultBinding(s)),
+ 'a selection with nothing numeric in it falls back to the sheet default rather than an empty axis')
+ ok(bindingFromSelection(s, ['ghost', 'value'])!.series.length === 1, 'an id that is not a column is ignored, never charted as an empty series')
+ const noText: TableSheet = { ...s, columns: s.columns.filter((c) => c.type !== 'text') } as TableSheet
+ const nt = bindingFromSelection(noText, ['value'])!
+ ok(nt.aggregate === 'none' && nt.x !== 'value', 'no text column anywhere → one point per row, and the series is never its own category axis')
+}
+
+console.log('\n2. a line through unordered categories is refused unless asked')
+{
+ const s = sheet()
+ const line: ChartBinding = { x: 'region', series: ['value'], kind: 'line', aggregate: 'sum' }
+ ok(!isOrdered(s.columns[0]) && isOrdered(s.columns[3]) && isOrdered(s.columns[2]), 'text has no order; dates and numbers do')
+ ok(lineRefused(s, line), 'Line over Region is refused')
+ const o = optionFor(s, line) as unknown as Opt
+ ok(o.series.every((x) => x.type === 'bar'), `…and DRAWN AS BARS (series types: ${o.series.map((x) => x.type).join(',')})`)
+ const asked = optionFor(s, { ...line, allowLine: true }) as unknown as Opt
+ ok(!lineRefused(s, { ...line, allowLine: true }) && asked.series.every((x) => x.type === 'line'),
+ '"Draw a line anyway" (allowLine) draws the line')
+ const dated = optionFor(s, { ...line, x: 'closed' }) as unknown as Opt
+ ok(!lineRefused(s, { ...line, x: 'closed' }) && dated.series[0].type === 'line', 'a line over DATES is drawn without asking')
+ ok(!lineRefused(s, { ...line, kind: 'bar' }), 'bars are never refused')
+}
+
+console.log('\n3. the axis wears the column\'s format')
+{
+ const s = sheet()
+ const money = optionFor(s, { x: 'region', series: ['value', 'weighted'], kind: 'bar', aggregate: 'sum' }) as unknown as Opt
+ ok(money.yAxis.axisLabel?.formatter === '£{value}', `two £ series → axis "£{value}" (${money.yAxis.axisLabel?.formatter})`)
+ const pct = optionFor(s, { x: 'region', series: ['prob'], kind: 'bar', aggregate: 'avg' }) as unknown as Opt
+ ok(pct.yAxis.axisLabel?.formatter === '{value}%', `a percent series → "{value}%" (${pct.yAxis.axisLabel?.formatter})`)
+ ok(pct.series[0].data[0] === 75, `…and its data is scaled to percent: North avg (0.5+1)/2 = 75, not 0.75 (${pct.series[0].data[0]})`)
+ const mixed = optionFor(s, { x: 'region', series: ['value', 'prob'], kind: 'bar', aggregate: 'sum' }) as unknown as Opt
+ ok(mixed.yAxis.axisLabel === undefined && axisFormat(s, ['value', 'prob']).mixed,
+ 'money and percent on one axis share no unit → bare numbers, never a £ on a probability')
+ ok(mixed.series[1].data[0] === 1.5, 'and nothing is scaled when the axis is not a percent axis')
+ const plain = optionFor(s, { x: 'region', series: ['qty'], kind: 'bar', aggregate: 'sum' }) as unknown as Opt
+ ok(plain.yAxis.axisLabel === undefined && !axisFormat(s, ['qty']).mixed, 'an unformatted number column → plain labels, not "mixed"')
+}
+
+console.log('\n4. the editor\'s fields reach the option, additively')
+{
+ const s = sheet()
+ const b: ChartBinding = { x: 'region', series: ['value', 'weighted'], kind: 'bar', aggregate: 'sum' }
+ const plain = optionFor(s, b) as unknown as Opt
+ ok(plain.color[0] === '#F7A600' && plain.color[1] === '#5B8DEF', 'no colours set → the palette, in order')
+ ok(!!plain.legend, 'two series → a legend by default')
+ const one = optionFor(s, { ...b, series: ['value'] }) as unknown as Opt
+ ok(one.legend === undefined, 'one series → no legend by default (charts-lite drew `{show:false}` anyway, so absent is the off switch)')
+ const painted = optionFor(s, { ...b, colors: { weighted: '#112233' } }) as unknown as Opt
+ ok(painted.color[1] === '#112233' && painted.color[0] === '#F7A600', 'a colour set on Weighted paints Weighted')
+ const dropped = optionFor(s, { ...b, series: ['weighted'], colors: { weighted: '#112233' } }) as unknown as Opt
+ ok(dropped.color[0] === '#112233', 'and STAYS on Weighted when Value is removed — colours follow the column, not the position')
+ ok((optionFor(s, { ...b, legend: false }) as unknown as Opt).legend === undefined, 'the legend switch turns it off')
+ ok(!!(optionFor(s, { ...b, series: ['value'], legend: true }) as unknown as Opt).legend, 'and on, for one series')
+ const json = JSON.parse(JSON.stringify({ ...b, title: 'Deals', colors: { value: '#000000' }, allowLine: true, future: 1 }))
+ ok(json.title === 'Deals' && json.future === 1, 'every new field is plain JSON, and an unknown one rides along')
+}
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+if (failures) process.exit(1)
diff --git a/scripts/test-dash-fields-browser.mjs b/scripts/test-dash-fields-browser.mjs
index 2cb52b51..87637055 100644
--- a/scripts/test-dash-fields-browser.mjs
+++ b/scripts/test-dash-fields-browser.mjs
@@ -118,6 +118,9 @@ try {
console.log(`\n${theme} theme\n`)
const ctx = await browser.newContext({ viewport: { width: 1440, height: 960 } })
await ctx.addInitScript((th) => { try { localStorage.setItem('bento-theme', th) } catch {} }, theme)
+ // 3D sits behind a developer flag (off by default); this rig measures its
+ // panel's fields, so it turns the flag on.
+ await ctx.addInitScript(() => { try { localStorage.setItem('bento-dash-dev-3d', 'on') } catch {} })
await ctx.route(/^https?:/, (r) => r.abort())
const fresh = async () => {
const p = await ctx.newPage()
@@ -153,12 +156,15 @@ try {
ok(own >= s.min && bad.length === 0,
`${s.name}: ${own} field(s) of its own (floor ${s.min}), all ${res.fields.length} on the page in the field look` +
bad.map(([f, pr]) => `\n ${f.id}: ${pr.join('; ')}`).join(''))
- if (s.name === 'chart') focusPage = p
+ // the dataset panel carries all three kinds (text, number, select). It was
+ // the chart's page while the chart sat beside the cell panel; the chart
+ // now owns the panel with its own editor, which has no number field.
+ if (s.name === 'properties panel (dataset)') focusPage = p
else await p.close()
}
ok(total >= 150, `${total} fields measured across ${SURFACES.length} surfaces`)
- // 2. the focus ring, on each kind of field the chart panel carries
+ // 2. the focus ring, on each kind of field the dataset panel carries
const p = focusPage
for (const sel of ['input[type="text"]', 'input[type="number"]', 'select']) {
const ring = await p.evaluate((sel) => {
diff --git a/scripts/test-dash-gestures-browser.mjs b/scripts/test-dash-gestures-browser.mjs
index b324ee88..b83bd0d9 100644
--- a/scripts/test-dash-gestures-browser.mjs
+++ b/scripts/test-dash-gestures-browser.mjs
@@ -22,7 +22,8 @@
// with a highlight), another sheet's tab inserts `Sheet!A1`, Enter
// commits — on a spreadsheet AND in a dataset per-cell formula, where a
// sorted view still writes the FILE's row;
-// 7. Escape closes the Story and Pivot panels.
+// 7. Escape closes the Story panel — and does NOT leave a pivot sheet (a
+// pivot is a sheet since #815; you leave a sheet by its tab).
// Every row has a control showing the path ran (the selection moved, the menu
// opened, the click still commits where no reference can go, …).
// DASH_SHELL=<path> runs it against another build (the fails-on-old-code check).
@@ -336,7 +337,7 @@ console.log('point mode on a dataset')
await ctx.close()
}
-// ── 6. Escape closes Story and Pivot ─────────────────────────────────────────
+// ── 6. Escape closes Story, not a pivot sheet ────────────────────────────────
console.log('Escape closes panels')
{
const { ctx, page } = await fresh()
@@ -349,14 +350,28 @@ console.log('Escape closes panels')
await page.keyboard.press('Escape')
ok(await page.$('.ds-editor') === null, 'Escape closes the Story panel')
await click(page, '.ds-editor', { modifiers: [] }).catch(() => {})
+ // NOT THE PIVOT, deliberately. The Pivot side panel this section used to
+ // close is gone: since #815 a pivot is a SHEET with a tab, and as in Excel you
+ // leave a sheet by its tab, never with Escape. So the row is the opposite one:
+ // Escape on a pivot sheet leaves it on screen, and throws nothing.
+ const pivotUp = () => page.evaluate(() => {
+ const el = document.querySelector('.dx-pivotview')
+ if (!el) return false
+ const r = el.getBoundingClientRect()
+ return r.width > 0 && r.height > 0 && getComputedStyle(el).display !== 'none'
+ })
await click(page, '[data-act="pivot"]')
await page.waitForTimeout(150)
- const shown = () => page.evaluate(() => { const el = document.querySelector('.dx-chart-close')?.closest('[hidden], .dx-chart, aside, section'); return !!document.querySelector('.dx-chart-close') && document.querySelector('.dx-chart-close').offsetParent !== null })
- ok(await shown(), 'control: the Pivot panel opened')
- await click(page, cellSel(2, 1))
+ await page.locator('.dx-tab:not(.active)').first().click()
+ await page.waitForTimeout(150)
+ await page.locator('.dx-tab', { hasText: /pivot/i }).first().click()
+ await page.waitForTimeout(150)
+ const pivotWas = await pivotUp()
+ const errorsBefore = errors.length
await page.keyboard.press('Escape')
await page.waitForTimeout(60)
- ok(!(await shown()), 'Escape closes the Pivot panel')
+ ok(pivotWas && await pivotUp() && errors.length === errorsBefore,
+ `Escape does not leave a pivot sheet, and throws nothing (control: opened from its tab, the pivot was shown: ${pivotWas})`)
await ctx.close()
}
diff --git a/scripts/test-dash-i18n.ts b/scripts/test-dash-i18n.ts
index 824d4e6c..d75a66ac 100644
--- a/scripts/test-dash-i18n.ts
+++ b/scripts/test-dash-i18n.ts
@@ -225,8 +225,8 @@ const KEEP_ENGLISH = new Map<string, string>([
* countable as translated because they are.
*/
const SAME_AS_ENGLISH: Record<string, string[]> = {
- es: ['Total', 'editor', 'General'],
- fr: ['Auto', 'Date', 'Format', 'Orientation', 'Portrait', 'Total', 'Type'],
+ es: ['Total', 'editor', 'General', 'Series'],
+ fr: ['Auto', 'Date', 'Format', 'Orientation', 'Portrait', 'Source', 'Total', 'Type'],
ja: ['OK'],
de: ['Dashboard', 'Format', 'Name', 'OK', 'Symbol', 'Text', 'Updates'],
it: ['Dashboard', 'File', 'Formula', 'Max', 'Min', 'OK', 'vs', 'editor'],
diff --git a/scripts/test-dash-pivotchart-browser.mjs b/scripts/test-dash-pivotchart-browser.mjs
new file mode 100644
index 00000000..268aefb1
--- /dev/null
+++ b/scripts/test-dash-pivotchart-browser.mjs
@@ -0,0 +1,359 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// The pivot and chart tools finish what they start — measured in the packaged
+// document.
+//
+// npm run build:single --prefix dash && node scripts/test-dash-pivotchart-browser.mjs
+// (PLAYWRIGHT_MODULE / CHROME_PATH as the other dash browser rigs take them)
+//
+// Each row is a finding from the 2026-10-20 review, driven through the real UI:
+// PIVOT 1. + Pivot opens the pivot as a SHEET (where the grid was) with the
+// field editor in the properties panel — there was no editor at all.
+// 2. The Grand total column is reachable: fully on screen at desktop
+// width, and scrolled to (not cut off) when the pivot is wider than
+// its pane — it was clipped at the panel edge with no way to reach it.
+// 3. A field DRAGGED from the list into Columns (real mouse) regroups.
+// 4. A field PICKED into Values, its aggregate switched to Distinct,
+// computes a distinct count.
+// 5. A Filters checklist excludes the lost deals; the totals follow and
+// are still money (£). ⌘Z takes the filter back.
+// 6. The pivot TAB opens it (it used to offer "open it from + Pivot"),
+// and the edited spec survives a save → reopen of the file.
+// CHART 7. With one Value cell selected, Chart charts Value — not Value,
+// Weighted and Computed.
+// 8. The editor sets Line; over Region (no order) it is drawn as bars
+// with a "Draw a line anyway" note, which draws the line.
+// 9. The value axis is labelled in £; a title typed in the editor heads
+// the chart; ⌘Z puts the old heading back.
+// 10. Series added and coloured from the editor; clicking the grid
+// gives the panel back to the cell.
+// 3D 11. The 3D button is hidden by default and shown by the dev flag.
+// FILTER 12. A money column's filter checklist lists £4,300, not 4300, and a
+// search for "4,300" finds it.
+const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright')
+import { writeFileSync, mkdtempSync, rmSync } from 'node:fs'
+import { join } from 'node:path'
+import { tmpdir } from 'node:os'
+import { pathToFileURL } from 'node:url'
+
+let checks = 0
+let failures = 0
+function ok(cond, msg) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+
+// DASH_SHELL points the rig at another build — how its fails-on-old-code result
+// was taken (an origin/main shell before this change).
+const SHELL = process.env.DASH_SHELL
+ ? pathToFileURL(process.env.DASH_SHELL).href
+ : new URL('../dash/dist-single/Bento_Dash.bento.html', import.meta.url).href
+const MOD = process.platform === 'darwin' ? 'Meta' : 'Control'
+const tmp = mkdtempSync(join(tmpdir(), 'dash-pivotchart-'))
+
+/** One area of the rig. A section that throws (an old build has no field
+ * editor to click) is a FAILURE, recorded, and the next section still runs —
+ * so a run against the old code lists every row it fails, not just the first. */
+async function section(name, fn) {
+ try { await fn() } catch (e) { ok(false, `${name}: the section could not run — ${String(e.message).split('\n')[0]}`) }
+}
+
+const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH, headless: true })
+const errors = []
+
+async function open(url = SHELL, { width = 1440, height = 900, dev3d = false } = {}) {
+ const ctx = await browser.newContext({ viewport: { width, height } })
+ await ctx.route(/^https?:/, (r) => r.abort())
+ if (dev3d) await ctx.addInitScript(() => { try { localStorage.setItem('bento-dash-dev-3d', 'on') } catch {} })
+ const p = await ctx.newPage()
+ p.setDefaultTimeout(5000)
+ p.on('dialog', (d) => d.dismiss())
+ p.on('pageerror', (e) => errors.push(e.message))
+ await p.goto(url)
+ await p.waitForFunction(() => window.bento?.doc && document.querySelector('.dg-cell'))
+ await p.waitForTimeout(250)
+ return p
+}
+
+const pivotSpec = (p) => p.evaluate(() => {
+ const s = window.bento.doc.sheets.find((x) => x.kind === 'pivot')
+ return s ? JSON.parse(JSON.stringify(s.pivot)) : null
+})
+const visible = (p, sel) => p.evaluate((sel) => {
+ const el = document.querySelector(sel)
+ if (!el) return false
+ const r = el.getBoundingClientRect()
+ return r.width > 0 && r.height > 0 && getComputedStyle(el).display !== 'none'
+}, sel)
+/** the grand-total cell of the LAST value column, as text */
+const grandCell = (p) => p.evaluate(() => {
+ const tr = [...document.querySelectorAll('.dx-pivotview .dxp-r.dxp-grand')].pop()
+ const tds = tr ? tr.querySelectorAll('td') : []
+ return tds.length ? tds[tds.length - 1].textContent : null
+})
+
+try {
+ await section('pivot', async () => {
+ // ================================================================== PIVOT
+ console.log('\npivot: opens as a sheet, with a field editor')
+ const p = await open()
+ await p.locator('[data-act="pivot"]').click()
+ await p.waitForTimeout(300)
+ ok(await visible(p, '.dx-pivotview') && !(await visible(p, '.dx-grid')),
+ '+ Pivot shows the pivot where the grid was, and hides the grid')
+ ok(await p.locator('.dx-tab.active').innerText().then((s) => /pivot/i.test(s)),
+ 'its tab is the active one')
+ ok(await p.locator('.dp-panel .dpf-well').count() === 4,
+ 'the properties panel is the field editor: Filters, Columns, Rows and Values')
+ ok(await p.locator('.dp-panel .dpf-field').count() >= 7, 'with the source\'s columns listed as fields')
+
+ console.log('\npivot: the Grand total column is reachable')
+ const grandVisible = (pg) => pg.evaluate(() => {
+ const scroll = document.querySelector('.dx-pivotview .dxp-scroll')
+ const ths = [...document.querySelectorAll('.dx-pivotview thead th')]
+ const g = ths.filter((th) => /Grand total/.test(th.textContent)).pop()
+ if (!scroll || !g) return null
+ const s = scroll.getBoundingClientRect()
+ const r = g.getBoundingClientRect()
+ return { inside: r.right <= s.right + 1 && r.left >= s.left - 1, sw: scroll.scrollWidth, cw: scroll.clientWidth }
+ })
+ const g1 = await grandVisible(p)
+ ok(g1 && g1.inside, `at 1440px the Grand total header lies wholly inside the pivot pane (${JSON.stringify(g1)})`)
+
+ console.log('\npivot: drag a field into Columns')
+ const src = await p.locator('.dpf-field[data-col="stage"]').boundingBox()
+ const dst = await p.locator('.dpf-well[data-area="cols"]').boundingBox()
+ await p.mouse.move(src.x + 20, src.y + src.height / 2)
+ await p.mouse.down()
+ await p.mouse.move(src.x + 40, src.y + 40, { steps: 4 })
+ await p.mouse.move(dst.x + dst.width / 2, dst.y + dst.height - 6, { steps: 8 })
+ await p.mouse.up()
+ await p.waitForTimeout(300)
+ let spec = await pivotSpec(p)
+ ok(spec.cols.includes('stage'), `Stage dragged with the mouse lands in Columns (cols: ${JSON.stringify(spec.cols)})`)
+ ok(await p.locator('.dx-pivotview thead th', { hasText: /^Won$/ }).count() > 0, 'and the table regroups under Won / Open / Lost')
+ ok(await p.locator('.dx-tab.active').innerText().then((s) => /pivot/i.test(s)),
+ 'the edit does not throw the reader off the pivot tab (a setSheet to a pivot read as "doomed" did)')
+
+ console.log('\npivot: wider than its pane, the Grand total scrolls into reach')
+ {
+ const narrow = await p.context().newPage()
+ await narrow.setViewportSize({ width: 900, height: 800 })
+ narrow.on('pageerror', (e) => errors.push(e.message))
+ await narrow.goto(SHELL)
+ await narrow.waitForFunction(() => window.bento?.doc && document.querySelector('.dg-cell'))
+ await narrow.locator('[data-act="pivot"]').click({ force: true }).catch(async () => {
+ await narrow.locator('.dx-dd-trig[data-dd="insert"]').click(); await narrow.locator('[data-act="pivot"]').click()
+ })
+ await narrow.waitForTimeout(300)
+ await narrow.locator('.dpf-well[data-area="cols"] .dpf-add').selectOption('stage')
+ await narrow.waitForTimeout(300)
+ const before = await grandVisible(narrow)
+ ok(before && before.sw > before.cw, `the Owner × Stage pivot is wider than its pane at 900px (${before?.sw} > ${before?.cw})`)
+ await narrow.evaluate(() => { const s = document.querySelector('.dx-pivotview .dxp-scroll'); s.scrollLeft = s.scrollWidth })
+ const after = await grandVisible(narrow)
+ ok(after && after.inside, 'and scrolling the pivot brings the whole Grand total column into view — it is scrolled to, not cut off')
+ await narrow.close()
+ }
+
+ console.log('\npivot: pick a field into Values, count it distinct')
+ await p.locator('.dpf-well[data-area="cols"] .dpf-chip[data-col="stage"] .dpf-x').click()
+ await p.waitForTimeout(200)
+ await p.locator('.dpf-well[data-area="cols"] .dpf-chip[data-col="owner"] .dpf-x').click()
+ await p.waitForTimeout(200)
+ await p.locator('.dpf-well[data-area="values"] .dpf-add').selectOption('owner')
+ await p.waitForTimeout(200)
+ spec = await pivotSpec(p)
+ ok(spec.values.length === 2 && spec.values[1].col === 'owner' && spec.values[1].fn === 'count',
+ `Owner picked into Values is COUNTED, not summed (${JSON.stringify(spec.values[1])})`)
+ await p.locator('.dpf-well[data-area="values"] .dpf-chip').nth(1).locator('.dpf-agg').selectOption('countDistinct')
+ await p.waitForTimeout(250)
+ spec = await pivotSpec(p)
+ ok(spec.values[1].fn === 'countDistinct', 'its aggregate switched to Distinct is stored')
+ ok(await grandCell(p) === '3', `the grand Distinct Owner is 3 (Priya, Sam, Lee) — not the 8 rows (${await grandCell(p)})`)
+ ok(await p.locator('.dx-pivotview .dxp-skipped').count() === 0,
+ 'and no cell of a count is marked "values are not numbers and were not counted" — a count of names counted every name')
+ const sumGrand = await p.evaluate(() => {
+ const tr = [...document.querySelectorAll('.dx-pivotview .dxp-r.dxp-grand')].pop()
+ return tr.querySelectorAll('td')[0].textContent
+ })
+ ok(sumGrand === '£97,050', `Sum of Value keeps the column's money format (${sumGrand})`)
+
+ console.log('\npivot: filter the lost deals out')
+ await p.locator('.dpf-well[data-area="filters"] .dpf-add').selectOption('stage')
+ await p.waitForTimeout(200)
+ await p.locator('.dpf-chip[data-col="stage"] .dpf-filter-btn').click()
+ await p.waitForTimeout(150)
+ const labels = await p.locator('.dpf-chip[data-col="stage"] .dpf-check-item:not(.dpf-check-all)').allInnerTexts()
+ ok(labels.join('|') === 'Lost|Open|Won', `the checklist lists the stages (${labels.join('|')})`)
+ await p.locator('.dpf-chip[data-col="stage"] .dpf-check-item', { hasText: /^Lost$/ }).locator('input').click()
+ await p.waitForTimeout(300)
+ spec = await pivotSpec(p)
+ ok(JSON.stringify(spec.filters?.[0]?.pred) === '{"op":"isOneOf","values":["Open","Won"]}',
+ `the filter is stored as a JSON list (${JSON.stringify(spec.filters?.[0]?.pred)})`)
+ ok(JSON.stringify(spec.rows) === '["region"]', 'and Region is still the rows')
+ const filtered = await p.evaluate(() => {
+ const tr = [...document.querySelectorAll('.dx-pivotview .dxp-r.dxp-grand')].pop()
+ return tr ? tr.querySelectorAll('td')[0].textContent : null
+ })
+ ok(filtered === '£87,950', `without the lost deal the grand total is £87,950 = £97,050 − £9,100 (${filtered})`)
+ const south = await p.evaluate(() => {
+ const tr = [...document.querySelectorAll('.dx-pivotview .dxp-r.dxp-leaf')].find((r) => r.querySelector('th')?.textContent === 'South')
+ return tr ? tr.querySelectorAll('td')[0].textContent : null
+ })
+ ok(south === '£26,500', `South loses exactly its £9,100 lost deal: £8,200 + £18,300 = £26,500 (${south})`)
+ await p.locator('.dx-pivotview').click({ position: { x: 600, y: 400 } })
+ await p.keyboard.press(`${MOD}+z`)
+ await p.waitForTimeout(300)
+ spec = await pivotSpec(p)
+ ok(!spec.filters?.[0]?.pred, `⌘Z takes the filter back (${JSON.stringify(spec.filters)})`)
+ // A printable key and Enter, with the pivot up: before the guard they went
+ // to the HIDDEN grid's cursor (Region, row 1) and typed over "North".
+ const table = () => p.evaluate(() => JSON.stringify(window.bento.doc.sheets.filter((x) => x.kind !== 'pivot')))
+ const was = await table()
+ await p.keyboard.press('q')
+ await p.keyboard.press('Enter')
+ await p.waitForTimeout(700)
+ ok(await table() === was && !(await p.evaluate(() => document.activeElement?.isContentEditable || document.activeElement?.tagName === 'TEXTAREA')),
+ 'typing with the pivot up does not reach the hidden grid — the dataset is unchanged and no cell editor opened')
+ await p.keyboard.press(`${MOD}+Shift+z`)
+ await p.waitForTimeout(200)
+ spec = await pivotSpec(p)
+ ok(spec.filters?.[0]?.pred?.op === 'isOneOf', '⇧⌘Z puts it back')
+
+ console.log('\npivot: the tab opens it, and the file keeps it')
+ await p.locator('.dx-tab', { hasText: 'Pipeline' }).first().click()
+ await p.waitForTimeout(250)
+ ok(await visible(p, '.dx-grid') && !(await visible(p, '.dx-pivotview')), 'the Pipeline tab brings the grid back')
+ ok(!(await p.locator('.dp-panel .dpf-well').count()), 'and the panel back to the cell')
+ await p.locator('.dx-tab', { hasText: /pivot/i }).click()
+ await p.waitForTimeout(250)
+ ok(await visible(p, '.dx-pivotview') && await p.locator('.dx-pop, .dx-tab-menu').count() === 0,
+ 'clicking the pivot TAB opens the pivot — not a menu saying "open it from + Pivot"')
+ const file = join(tmp, 'saved.bento.html')
+ writeFileSync(file, await p.evaluate(() => window.bento.serialize()))
+ const q = await open(pathToFileURL(file).href)
+ await q.locator('.dx-tab', { hasText: /pivot/i }).click()
+ await q.waitForTimeout(300)
+ const qs = await pivotSpec(q)
+ ok(JSON.stringify(qs) === JSON.stringify(spec),
+ `saved and reopened, the pivot has the fields it was given (${JSON.stringify(qs)})`)
+ const reopened = await q.evaluate(() => {
+ const tr = [...document.querySelectorAll('.dx-pivotview .dxp-r.dxp-grand')].pop()
+ return tr ? tr.querySelectorAll('td')[0].textContent : null
+ })
+ ok(reopened === '£87,950', `and computes the same filtered total from the file (${reopened})`)
+ await q.context().close()
+ await p.context().close()
+ })
+
+ await section('chart', async () => {
+ // ================================================================== CHART
+ console.log('\nchart: from the selection')
+ const c = await open()
+ await c.locator('.dg-cell', { hasText: /^£12,400$/ }).first().click()
+ await c.waitForTimeout(100)
+ await c.locator('[data-act="chart"]').click()
+ await c.waitForTimeout(400)
+ let chart = await c.evaluate(() => window.bento.doc.chart)
+ ok(JSON.stringify(chart?.binding?.series) === '["value"]',
+ `one Value cell selected → the chart is of Value alone (${JSON.stringify(chart?.binding?.series)})`)
+ ok(await c.locator('.dp-panel .dce-type').count() === 1, 'and the properties panel is its editor')
+ const yLabels = await c.evaluate(() => [...document.querySelectorAll('.dx-chart-body svg text')].map((t) => t.textContent))
+ ok(yLabels.some((s) => /^£\d/.test(s)), `the value axis is in £ (${yLabels.filter((s) => /\d/.test(s)).slice(0, 3).join(', ')})`)
+
+ console.log('\nchart: a line through Region is refused, unless asked')
+ // Bars are rects painted in the series colour; a line is a stroked path with
+ // a dot per category. (charts-lite also lays transparent hit bands over each
+ // category, so "any rect" counts the wrong thing.)
+ const shapes = () => c.evaluate(() => {
+ const svg = document.querySelector('.dx-chart-body svg')
+ const series = '#f7a600'
+ return {
+ bars: [...svg.querySelectorAll('rect')].filter((r) => (r.getAttribute('fill') || '').toLowerCase() === series).length,
+ lines: [...svg.querySelectorAll('path')].filter((x) => x.getAttribute('fill') === 'none' && (x.getAttribute('stroke') || '').toLowerCase() === series).length,
+ note: [...document.querySelectorAll('.dx-chart-note')].map((n) => n.textContent).join(' '),
+ }
+ })
+ await c.locator('.dce-type').selectOption('line')
+ await c.waitForTimeout(300)
+ chart = await c.evaluate(() => window.bento.doc.chart)
+ let sh = await shapes()
+ ok(chart.binding.kind === 'line' && sh.bars === 3 && sh.lines === 0 && /Draw a line anyway/.test(sh.note),
+ `Line chosen over Region → drawn as 3 bars and no line, with the reason and the offer (${sh.bars} bars, ${sh.lines} lines; "${sh.note.slice(0, 60)}…")`)
+ await c.locator('.dx-chart-note button', { hasText: 'Draw a line anyway' }).click()
+ await c.waitForTimeout(300)
+ chart = await c.evaluate(() => window.bento.doc.chart)
+ sh = await shapes()
+ ok(chart.binding.allowLine === true && sh.bars === 0 && sh.lines === 1 && !/Draw a line anyway/.test(sh.note),
+ `asked, the line is drawn (${sh.lines} line, ${sh.bars} bars, allowLine ${chart.binding.allowLine})`)
+ await c.locator('.dce-type').selectOption('bar')
+ await c.waitForTimeout(200)
+
+ console.log('\nchart: title, undo, series, colour')
+ const head = () => c.locator('.dx-chart-title').innerText()
+ const before = await head()
+ await c.locator('.dce-title').fill('Deals by region')
+ await c.locator('.dce-title').press('Enter')
+ await c.waitForTimeout(250)
+ ok(await head() === 'Deals by region', `a typed title heads the chart (${await head()})`)
+ await c.locator('.dx-chart-body').click({ position: { x: 20, y: 20 } })
+ await c.keyboard.press(`${MOD}+z`)
+ await c.waitForTimeout(300)
+ ok(await head() === before && !(await c.evaluate(() => window.bento.doc.chart.binding.title)),
+ `⌘Z puts the old heading back on screen AND in the file (${await head()})`)
+ await c.locator('.dce-add').selectOption('weighted')
+ await c.waitForTimeout(250)
+ chart = await c.evaluate(() => window.bento.doc.chart)
+ ok(JSON.stringify(chart.binding.series) === '["value","weighted"]', 'Weighted added from the editor')
+ ok(await c.locator('.dce-series').count() === 2, 'and listed as a second series')
+ await c.locator('.dce-series[data-col="weighted"] .dce-colour').evaluate((el) => {
+ el.value = '#112233'; el.dispatchEvent(new Event('change', { bubbles: true }))
+ })
+ await c.waitForTimeout(250)
+ chart = await c.evaluate(() => window.bento.doc.chart)
+ const fills = await c.evaluate(() => [...document.querySelectorAll('.dx-chart-body svg rect')].map((r) => (r.getAttribute('fill') || '').toLowerCase()))
+ ok(chart.binding.colors?.weighted === '#112233' && fills.includes('#112233'),
+ `its colour is stored and painted (${chart.binding.colors?.weighted})`)
+ await c.locator('.dg-cell', { hasText: /^North$/ }).first().click()
+ await c.waitForTimeout(250)
+ ok(!(await c.locator('.dp-panel .dce-type').count()) && await c.locator('.dp-panel .dp-section', { hasText: /^Cell$/i }).count() > 0,
+ 'clicking back into the grid gives the panel back to the cell')
+ await c.context().close()
+ })
+
+ await section('3D', async () => {
+ // ===================================================================== 3D
+ console.log('\n3D: behind a developer flag')
+ const d0 = await open()
+ ok(!(await visible(d0, '[data-act="viz3d"]')), 'the 3D button is hidden by default')
+ await d0.context().close()
+ const d1 = await open(SHELL, { dev3d: true })
+ ok(await visible(d1, '[data-act="viz3d"]'), 'and shown with localStorage bento-dash-dev-3d = "on"')
+ await d1.context().close()
+ })
+
+ await section('filter', async () => {
+ // ================================================================= FILTER
+ console.log('\nfilter: the checklist shows values as the column does')
+ const f = await open()
+ const valueCaret = f.locator('.dg-head-row .dg-filter').nth(3)
+ await valueCaret.click()
+ await f.waitForTimeout(250)
+ const items = await f.locator('.dfx-item:not(.dfx-all)').allInnerTexts()
+ ok(items.includes('£4,300') && !items.includes('4300'), `the Value checklist lists £4,300, not 4300 (${items.slice(0, 3).join(', ')})`)
+ await f.locator('.dfx-q').fill('4,300')
+ await f.waitForTimeout(400)
+ const found = await f.locator('.dfx-item:not(.dfx-all)').allInnerTexts()
+ ok(found.length === 1 && found[0] === '£4,300', `searching "4,300" — what the reader sees — finds it (${found.join(', ')})`)
+ await f.context().close()
+ })
+
+ ok(errors.length === 0, `no page errors${errors.length ? `: ${errors.join(' | ')}` : ''}`)
+} finally {
+ await browser.close()
+ rmSync(tmp, { recursive: true, force: true })
+}
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+if (failures) process.exit(1)
diff --git a/scripts/test-dash-pivotfields.ts b/scripts/test-dash-pivotfields.ts
new file mode 100644
index 00000000..9b31d589
--- /dev/null
+++ b/scripts/test-dash-pivotfields.ts
@@ -0,0 +1,270 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// bento/dash pivot field editor rig — the spec operations behind the editor,
+// and the pivot COMPUTED over configured fields.
+//
+// node scripts/test-dash-pivotfields.ts
+//
+// WHAT THIS PROVES. The field editor (dash/src/pivotfields.ts) turns drags and
+// picks into a new PivotSpec; runPivot turns the spec into numbers. Both halves
+// fail silently: a drag that leaves Region in Rows AND Columns draws a diagonal
+// of one-cell groups that look like data, and a filter stored in the wrong
+// spelling reopens matching nothing — a pivot of zero rows, which reads as "no
+// sales" rather than as a broken file.
+//
+// 1. Every operation returns a NEW spec and never touches its input (the input
+// is the spec inside store.doc; mutating it is a change undo never saw).
+// 2. A grouping field is in ONE of Filters / Columns / Rows; Values may repeat
+// a column but never the same column and function.
+// 3. Configured pivots compute what a hand count says: sum, average, count,
+// min, max and DISTINCT, per group and in the grand total.
+// 4. The pivot's own filters, in the JSON spelling the editor writes, survive
+// the file (JSON round trip + parseDoc) and still filter: the checklist,
+// "(All)", a "(Blanks)" box, and a filter on a column that is gone.
+//
+// The old engine read `spec.filters` as live filter.ts filters, so the stored
+// `values` array arrived where a `Set` was expected — section 4 is the check that
+// goes red on it.
+
+import { registerHooks } from 'node:module'
+
+registerHooks({
+ load(url, context, next) {
+ if (url.endsWith('.css')) return { format: 'module', source: 'export {}', shortCircuit: true }
+ return next(url, context)
+ },
+})
+
+const { runPivot, drillDown, readPivotSpec, newPivotSheet } = await import('../dash/src/pivot.ts')
+const F = await import('../dash/src/pivotfields.ts')
+const { parseDoc } = await import('../dash/src/model.ts')
+const { listLabel } = await import('../dash/src/format.ts')
+type PivotSpec = import('../dash/src/pivot.ts').PivotSpec
+type PivotResult = import('../dash/src/pivot.ts').PivotResult
+type TableSheet = import('../dash/src/model.ts').TableSheet
+
+let failures = 0
+let checks = 0
+function ok(cond: boolean, msg: string) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+
+// The starter workbook's Pipeline, plus one blank Region so "(Blanks)" exists.
+const REGION = ['North', 'South', 'North', 'East', 'South', 'North', 'East', 'South', null]
+const OWNER = ['Priya', 'Sam', 'Priya', 'Lee', 'Sam', 'Lee', 'Priya', 'Sam', 'Lee']
+const STAGE = ['Won', 'Open', 'Won', 'Open', 'Lost', 'Won', 'Open', 'Won', 'Open']
+const VALUE = [12400, 8200, 15600, 4300, 9100, 22750, 6400, 18300, 1000]
+
+const source = (): TableSheet => ({
+ id: 'src', name: 'Pipeline', kind: 'table',
+ rids: [[1, 9]],
+ columns: [
+ { id: 'region', name: 'Region', type: 'text' },
+ { id: 'owner', name: 'Owner', type: 'text' },
+ { id: 'stage', name: 'Stage', type: 'text' },
+ { id: 'value', name: 'Value', type: 'money', format: '£#,##0' },
+ ],
+ data: {
+ region: { enc: 'raw', v: REGION },
+ owner: { enc: 'raw', v: OWNER },
+ stage: { enc: 'raw', v: STAGE },
+ value: { enc: 'raw', v: VALUE },
+ },
+ steps: [],
+} as unknown as TableSheet)
+
+const base = (over: Partial<PivotSpec> = {}): PivotSpec => ({
+ from: 'src', rows: ['region'], cols: [], values: [{ col: 'value', fn: 'sum' }], ...over,
+})
+
+const deepFreeze = <T>(o: T): T => {
+ if (o && typeof o === 'object') { Object.freeze(o); for (const v of Object.values(o)) deepFreeze(v) }
+ return o
+}
+
+const row = (res: PivotResult, kind: string, label?: string) =>
+ res.rows.find((r) => r.kind === kind && (label === undefined || String(r.path[0] ?? '') === label))
+const cell = (res: PivotResult, kind: string, label: string | undefined, vi: number) =>
+ row(res, kind, label)?.cells[vi]?.v ?? null
+
+const money = { type: 'money' as const }
+const text = { type: 'text' as const }
+
+// ================================================================ 1 + 2
+console.log('\nthe operations: new specs, inputs untouched')
+{
+ const s0 = deepFreeze(base())
+ let threw = ''
+ let s1: PivotSpec = s0
+ try {
+ s1 = F.addField(s0, 'stage', 'cols')
+ s1 = F.addField(s1, 'owner', 'values', { column: text })
+ s1 = F.setAgg(s1, 1, 'countDistinct')
+ s1 = F.setFilterValues(s1, 'region', ['North'])
+ s1 = F.moveField(s1, { area: 'cols', index: 0 }, { area: 'rows', index: 0 })
+ s1 = F.removeField(s1, 'values', 0)
+ s1 = F.toggleField(s1, 'value', money)
+ } catch (e) { threw = e instanceof Error ? e.message : String(e) }
+ ok(threw === '', threw || 'seven operations run against a deep-frozen spec without writing to it')
+ ok(JSON.stringify(s0) === JSON.stringify(base()), 'and the frozen input is exactly as it was')
+ ok(s1 !== s0, 'each edit hands back a new object')
+}
+
+console.log('\na grouping field is in one place')
+{
+ let s = F.addField(base(), 'region', 'cols')
+ ok(s.rows.length === 0 && s.cols[0] === 'region', 'Region dragged from Rows to Columns MOVES — it is not in both')
+ s = F.addField(s, 'region', 'filters')
+ ok(s.cols.length === 0 && F.filterCols(s)[0] === 'region', 'and from Columns to Filters, likewise')
+ s = F.setFilterValues(s, 'region', ['North'])
+ s = F.addField(s, 'region', 'rows')
+ ok(!s.filters && s.rows[0] === 'region',
+ 'a filtered field dragged into Rows leaves Filters and drops its checklist — the author is asking to see every region now')
+ const two = F.addField(F.addField(base({ rows: [] }), 'region', 'rows'), 'stage', 'rows', { at: 0 })
+ ok(JSON.stringify(two.rows) === '["stage","region"]', 'a field dropped at position 0 goes FIRST — outermost grouping')
+ const re = F.addField(two, 'stage', 'rows', { at: 2 })
+ ok(JSON.stringify(re.rows) === '["region","stage"]',
+ 'reordering within an area: dropping the first field after the last moves it to the end, not one past it')
+}
+
+console.log('\nvalues may repeat a column, never a column AND function')
+{
+ let s = F.addField(base(), 'value', 'values', { fn: 'avg' })
+ ok(s.values.length === 2 && s.values[1].fn === 'avg', 'Sum AND Average of Value side by side is allowed')
+ const same = F.addField(s, 'value', 'values', { fn: 'sum' })
+ ok(same === s, 'a second Sum of Value is refused — the spec comes back unchanged')
+ ok(F.setAgg(s, 1, 'sum') === s, 'and switching the Average to Sum is refused for the same reason')
+ s = F.addField(s, 'region', 'values', { column: text })
+ ok(s.values[2].fn === 'count', 'a TEXT field dropped into Values is counted, never summed')
+ ok(F.addField(base({ values: [] }), 'value', 'values', { column: money }).values[0].fn === 'sum',
+ 'a measure dropped into Values is summed')
+ const r = F.addField(base(), 'region', 'values', { column: text })
+ ok(r.rows[0] === 'region' && r.values.some((v) => v.col === 'region'),
+ 'a field can be a row AND a value — "Count of Region by Region" is a fair question')
+ const moved = F.moveField(F.addField(base(), 'value', 'values', { fn: 'max' }), { area: 'values', index: 1 }, { area: 'values', index: 0 })
+ ok(moved.values[0].fn === 'max' && moved.values[1].fn === 'sum', 'a value dragged to the top keeps its function')
+ const toRows = F.moveField(base(), { area: 'values', index: 0 }, { area: 'rows', index: 1 }, money)
+ ok(toRows.values.length === 0 && toRows.rows[1] === 'value', 'a value dragged into Rows stops being a value')
+}
+
+console.log('\nthe field-list tick')
+{
+ const s = F.toggleField(base({ rows: [], values: [] }), 'stage', text)
+ ok(s.rows[0] === 'stage', 'ticking a text field puts it in Rows')
+ const t2 = F.toggleField(s, 'value', money)
+ ok(t2.values[0]?.col === 'value' && t2.values[0].fn === 'sum', 'ticking a money field sums it in Values')
+ const off = F.toggleField(F.addField(t2, 'value', 'values', { fn: 'avg' }), 'value', money)
+ ok(off.values.length === 0, 'unticking takes the field out of EVERY area it is in')
+}
+
+console.log('\nthe Filters area stores the JSON spelling')
+{
+ const s = F.setFilterValues(base(), 'stage', ['Won', 'Open'])
+ const f = s.filters![0] as { col: string; pred: { op: string; values?: unknown[]; set?: unknown } }
+ ok(f.pred.op === 'isOneOf' && Array.isArray(f.pred.values) && f.pred.set === undefined,
+ 'a checklist is stored as `values`, an ARRAY — a Set would serialize as {} and match nothing')
+ const all = F.setFilterValues(s, 'stage', null)
+ ok(all.filters![0].col === 'stage' && all.filters![0].pred === undefined,
+ '"(All)" keeps the field in the area with NO predicate rather than a list of today\'s values')
+ ok(F.removeField(all, 'filters', 0).filters === undefined,
+ 'removing the last filter field drops `filters` entirely — the file goes back to what it was')
+}
+
+// ================================================================ 3
+console.log('\nconfigured fields compute what a hand count says')
+{
+ const spec = base({
+ rows: ['stage'],
+ values: [
+ { col: 'value', fn: 'sum' }, { col: 'value', fn: 'avg' }, { col: 'owner', fn: 'countDistinct' },
+ { col: 'value', fn: 'min' }, { col: 'value', fn: 'max' }, { col: 'region', fn: 'count' },
+ ],
+ })
+ const res = runPivot(source(), spec)
+ ok(res.findings.length === 0, `no findings (${res.findings.map((f) => f.detail).join('; ')})`)
+ ok(cell(res, 'leaf', 'Won', 0) === 69050, `Sum of Value, Won = 12400+15600+22750+18300 = 69,050 (${cell(res, 'leaf', 'Won', 0)})`)
+ ok(cell(res, 'leaf', 'Open', 0) === 19900, `Sum of Value, Open = 8200+4300+6400+1000 = 19,900 (${cell(res, 'leaf', 'Open', 0)})`)
+ ok(cell(res, 'leaf', 'Won', 1) === 17262.5, 'Average of Value, Won = 69050 / 4 = 17,262.5')
+ ok(cell(res, 'leaf', 'Won', 2) === 3, 'Distinct Owner, Won = {Priya, Lee, Sam} = 3, not the 4 rows')
+ ok(cell(res, 'leaf', 'Open', 2) === 3, 'Distinct Owner, Open = {Sam, Lee, Priya} = 3 (Lee twice)')
+ ok(cell(res, 'grand', undefined, 2) === 3,
+ 'Distinct Owner in the GRAND total = 3 — computed from rows, not the 3+3+1 = 7 a summed subtotal would print')
+ ok(cell(res, 'leaf', 'Won', 3) === 12400 && cell(res, 'leaf', 'Won', 4) === 22750, 'Min and Max of Value, Won = 12,400 and 22,750')
+ ok(cell(res, 'leaf', 'Open', 5) === 3, 'Count of Region, Open = 3 — the blank region is not a value, so it is not counted')
+ ok(cell(res, 'grand', undefined, 0) === VALUE.reduce((a, b) => a + b, 0), 'the grand Sum equals the column total, 98,050')
+ ok(cell(res, 'grand', undefined, 1) === 98050 / 9, 'and the grand Average divides by the nine values present')
+
+ const two = runPivot(source(), base({ rows: ['region'], cols: ['stage'], values: [{ col: 'value', fn: 'sum' }] }))
+ const ci = two.columns.findIndex((c) => c.kind === 'leaf' && c.path[0] === 'Won')
+ ok(row(two, 'leaf', 'North')!.cells[ci].v === 50750, 'Region × Stage: North, Won = 12400+15600+22750 = 50,750')
+ const drill = drillDown(two, two.rows.findIndex((r) => r.kind === 'leaf' && r.path[0] === 'North'), ci)
+ ok(drill.total === 3 && drill.rows.reduce((a, r) => a + VALUE[r], 0) === 50750,
+ 'and its drill-down is the three rows that make it')
+}
+
+// ================================================================ 4
+console.log('\nthe pivot\'s own filters, as the editor writes them, through the file')
+{
+ // Through the EDITOR's operation and a real JSON round trip — the spelling on
+ // disk is what has to work, not an in-memory Set.
+ const edited = F.setFilterValues(base({ rows: ['stage'] }), 'region', ['North', 'South'])
+ const doc = {
+ format: 'bento/dash', version: 1, docId: 'd', title: 'w',
+ sheets: [source(), newPivotSheet('pv', 'By stage', edited)],
+ }
+ const parsed = parseDoc(JSON.stringify(doc))
+ ok(parsed.ok, 'the workbook with a filtered pivot parses')
+ const spec = parsed.ok ? readPivotSpec(parsed.doc.sheets[1])! : edited
+ const f0 = spec.filters?.[0] as { pred?: { values?: unknown[] } } | undefined
+ ok(JSON.stringify(f0?.pred?.values) === '["North","South"]', 'the checklist comes back as the two regions it was')
+
+ let res: PivotResult | null = null
+ let threw = ''
+ try { res = runPivot(source(), spec) } catch (e) { threw = e instanceof Error ? e.message : String(e) }
+ ok(threw === '', threw ? `runPivot threw on a stored filter: ${threw}` : 'runPivot reads the stored filter without throwing')
+ if (res) {
+ ok(res.scanned === 6, `six rows are North or South (${res.scanned})`)
+ ok(cell(res, 'leaf', 'Won', 0) === 69050 && cell(res, 'leaf', 'Open', 0) === 8200 && cell(res, 'leaf', 'Lost', 0) === 9100,
+ `Won 69,050 · Open 8,200 · Lost 9,100 — East's two Open deals are out (${cell(res, 'leaf', 'Open', 0)})`)
+ ok(cell(res, 'grand', undefined, 0) === 86350, `the grand total is 86,350 (${cell(res, 'grand', undefined, 0)})`)
+ }
+
+ const blanks = runPivot(source(), F.setFilterValues(base({ rows: ['stage'] }), 'region', [null]))
+ ok(blanks.scanned === 1 && cell(blanks, 'grand', undefined, 0) === 1000,
+ 'a "(Blanks)" tick (null in the list) admits exactly the row with no region')
+
+ const allSpec = JSON.parse(JSON.stringify(F.setFilterValues(edited, 'region', null))) as PivotSpec
+ const all = runPivot(source(), allSpec)
+ ok(all.scanned === 9 && cell(all, 'grand', undefined, 0) === 98050,
+ '"(All)" — the field in the area with no predicate — filters nothing')
+
+ const none = runPivot(source(), F.setFilterValues(base(), 'region', []))
+ ok(none.scanned === 0, 'an empty checklist admits nothing — it is not read as "(All)"')
+
+ const gone = runPivot(source(), base({ filters: [{ col: 'quarter', pred: { op: 'isOneOf', values: ['Q1'] } }] }))
+ ok(gone.scanned === 9 && gone.findings.some((f) => f.kind === 'missing-column' && f.detail.includes('quarter')),
+ 'a filter on a column that is gone is DROPPED and REPORTED — it does not empty the pivot')
+
+ const live = runPivot(source(), base({ rows: ['stage'], filters: [{ col: 'stage', pred: { op: 'isOneOf', set: new Set(['Won']) } }] }))
+ ok(live.scanned === 4, 'a live filter.ts filter (a Set) still works for a caller holding one')
+
+ const unknown = runPivot(source(), base({ filters: [{ col: 'region', pred: { op: 'fuzzy', v: 'nor' } }] }))
+ ok(unknown.scanned === 9, 'a predicate this build does not know filters nothing rather than throwing')
+ ok(readPivotSpec({ pivot: { ...base(), filters: [{ col: 'region', pred: { op: 'fuzzy', v: 'nor' } }] } })!
+ .filters![0].pred !== undefined, '…and is kept in the document for the build that does')
+}
+
+console.log('\nthe checklist shows a value as its column does')
+{
+ ok(listLabel(4300, { type: 'money', format: '£#,##0' }) === '£4,300', `money: £4,300 (${listLabel(4300, { type: 'money', format: '£#,##0' })})`)
+ ok(listLabel(0.25, { type: 'percent', format: '0%' }) === '25%', 'percent: 25%, not the stored 0.25')
+ ok(listLabel('North', { type: 'text' }) === 'North', 'text prints as stored')
+ ok(listLabel(false, { type: 'bool' }) === 'false',
+ 'a Yes/No false is NOT blanked — "" is the label the (Blanks) box owns')
+ ok(listLabel('n/a', { type: 'money', format: '£#,##0' }) === 'n/a', 'a word in a money column prints as the word')
+}
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+if (failures) process.exit(1)
diff --git a/scripts/test-dash-story.ts b/scripts/test-dash-story.ts
index 108c784f..76588cbb 100644
--- a/scripts/test-dash-story.ts
+++ b/scripts/test-dash-story.ts
@@ -299,9 +299,12 @@ section('canMorph refuses what the renderer would draw as a lie')
const narrow = stepOption(sheet, step({ filters: [{ col: 'region', pred: { op: 'contains', v: 'th' } }] }))!
ok(canMorph(alignOptions(wide, narrow)), 'bars morph across a filter: a null renders as a zero-height rect, which is what absent looks like')
- const lineWide = optionFor(sheet, { x: 'region', series: ['amount'], kind: 'line', aggregate: 'sum' })
+ // `allowLine`: Region has no order, so chart.ts refuses a line through it
+ // unless the author asked for one. This block is about how a line MORPHS, so
+ // it asks.
+ const lineWide = optionFor(sheet, { x: 'region', series: ['amount'], kind: 'line', aggregate: 'sum', allowLine: true })
const lineNarrow = optionFor(sheet, {
- x: 'region', series: ['amount'], kind: 'line', aggregate: 'sum',
+ x: 'region', series: ['amount'], kind: 'line', aggregate: 'sum', allowLine: true,
}, viewColumns(sheet, stepOrder(sheet, step({ filters: [{ col: 'region', pred: { op: 'contains', v: 'th' } }] })), ['region', 'amount']))
const la = alignOptions(lineWide as Opt, lineNarrow as Opt)
ok(la.introduced, 'the same filter introduces gaps on a line chart')