Skip to content
Merged
Binary file modified docs/assets/screenshots/chart-lines-level-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/chart-lines-level-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/field-menu-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/screenshots/field-menu-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/concepts/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ menu as people see it):
| "A to Z", "Z to A" | a `label` sort |
| "Largest … first", "Smallest … first" | a `value` sort naming the value. Without a value the sort counts rows. |
| "Custom order" | a `custom` sort |
| "Default order" | no entry: the field's entry is removed, and a field order the host gives comes back |

A click on a header of the table writes the same entries
([sort with a click on a header](../use/filters.md#sort-with-a-click-on-a-header)):
Expand Down
4 changes: 2 additions & 2 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ the short version. The [comparison](compare.md) sets pivotkit beside other pivot
## Totals and sorting { #sorting }

- Subtotals and grand totals on or off per axis ([totals](use/fields.md#the-table)).
- Sorting by label, by any value or in a custom order. A click on a header sorts
([sorting](use/filters.md#sorting)).
- Sorting by label, by any value or in a custom order, and back to the default order. A click on a
header sorts ([sorting](use/filters.md#sorting)).

## The rows behind a number { #drill-down }

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/react-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ applies.

| Menu | First level | Levels |
| --- | --- | --- |
| A field on Rows or Columns | Sort (A to Z, Z to A side by side), sort by its one value, Filter, Top items, Move to, Remove field | Sort by value (two or more values, or a custom order), Filter, Group (dates), Number ranges (numbers), Top items, Move to |
| A field on Rows or Columns | Sort (A to Z, Z to A side by side), sort by its one value, Default order, Filter, Top items, Move to, Remove field | Sort by value (two or more values, or a custom order), Filter, Group (dates), Number ranges (numbers), Top items, Move to |
| A field in Filters | Filter, Group (dates), Move to, Remove field | Filter, Group (dates), Move to |
| A value | Summarize by, Show as, Number format, Highlight (side by side), Name, Move to, Remove field | Summarize by, Show as, Number format, Name, Move to |
| Table settings | Totals, Rows (Expand all, Collapse all with what it keeps: "Show Region only") | |
Expand Down
12 changes: 6 additions & 6 deletions docs/use/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,26 @@ type you pick stays.
**Chart settings** lists the chart types first. Below them is one row per topic: Value labels,
Legend, Title, Axis, Tooltip, Reference lines, Series and Layout. Each row shows what is set and opens
a level. **Back**, Escape or the left arrow goes back to the row. A topic the chart has nothing for
is left out: a pie has no Axis, a heatmap no Series.
is left out: a pie has no Axis, a heatmap no Legend or Series.

A choice applies at once, and the menu stays open, so the chart behind it shows the change. The
settings stay with the report: in saved views, links and the chart image. They also stay when the
chart type changes. An **i** explains Group labels, Tooltip, Zoom slider, Series, Stacked to 100 % and the
labels of a pie.
labels of a pie. A line under Automatic, Every n-th, All on horizontal bars, Trend and Share in the tooltip says what each does.

![Chart settings: the chart types, then the rows Value labels, Legend, Title, Axis, Tooltip, Reference lines, Series and Layout](../assets/screenshots/chart-display-light.png#only-light)
![Chart settings: the chart types, then the rows Value labels, Legend, Title, Axis, Tooltip, Reference lines, Series and Layout](../assets/screenshots/chart-display-dark.png#only-dark)

| Setting | Path | Choices | Default |
| --- | --- | --- | --- |
| Value labels | Chart settings › Value labels | Automatic, Off, Value. A pie and a donut also offer Percent and Value and percent. | Automatic: a pie names its slices. A heatmap writes the numbers while there are 200 cells or fewer. Bars and lines write nothing. |
| Legend | Chart settings › Legend | Automatic, Bottom, Right, Off | Automatic: above the chart when there is more than one series. A pie and a donut always have one. |
| Value labels | Chart settings › Value labels | Automatic, Off, Value. A pie and a donut also offer Percent and Value and percent. | Automatic: a pie names its slices, or writes each share with its labels inside. A treemap writes each tile's name and value. A heatmap writes the numbers while it has 200 filled cells or fewer and its cells are large enough for them. Bars and lines write nothing. |
| Legend | Chart settings › Legend | Automatic, Bottom, Right, Off. Not for a treemap or a heatmap. | Automatic: above the chart when there is more than one series. A pie and a donut always have one. |
| Title | Chart settings › Title | Any text. The × removes it at once. | none |
| Axis labels | Chart settings › Axis | Automatic, All (slanted), Every n-th | Automatic |
| Axis labels | Chart settings › Axis | Automatic, All (slanted), Every n-th. Horizontal bars: All instead of All (slanted). | Automatic: straight if the labels fit, else slanted; every n-th if still too many. Horizontal bars keep them straight and leave some out; their All writes every one straight, even where they overlap. Every n-th keeps them straight, with gaps so none overlap. |
| Group labels | Chart settings › Axis | Automatic, On, Off. With two or more fields in Rows. | Automatic: shown while the chart has room for them |
| Zoom slider | Chart settings › Axis | Automatic, On, Off | Automatic: more than 20 categories, or an axis that would leave out 3 names or more between two |
| Tooltip | Chart settings › Tooltip | Automatic, All series | Automatic: the element under the pointer |
| Share in the tooltip | Chart settings › Tooltip | on, off. Not for a heatmap. | off |
| Share in the tooltip | Chart settings › Tooltip | on, off. Not for a heatmap. Sums and counts get their share of the total, such as 25%; averages and values below zero get none. See "The share in the tooltip" below. | off |
| Series | Chart settings › Series | A switch per series, or per slice of a pie or a donut, with its colour beside it. One series is listed for its colour. | all shown, in the palette or the colours your app sets |
| Stacked to 100 % | Chart settings › Layout | on, off. Stacked bars and areas of sums and counts. | off |
| Reference lines | Chart settings › Reference lines | Average, Trend, High and low points, Target. Bars, lines and areas. See [below](#reference-lines). | none |
Expand Down
5 changes: 3 additions & 2 deletions docs/use/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ A row opens the topic's own level in the menu's place. The level's title names t
that differs from the one the report starts with has a dot before it: "Filter · ● 4 of 12". A
screen reader hears ", changed" after it.

![A field's menu: sort A to Z and Z to A side by side, sort by the value, then Filter, Top items and Move to, each with what is set](../assets/screenshots/field-menu-light.png#only-light)
![A field's menu: sort A to Z and Z to A side by side, sort by the value, then Filter, Top items and Move to, each with what is set](../assets/screenshots/field-menu-dark.png#only-dark)
![A field's menu: sort A to Z and Z to A side by side, sort by the value, Default order, then Filter, Top items and Move to, each with what is set](../assets/screenshots/field-menu-light.png#only-light)
![A field's menu: sort A to Z and Z to A side by side, sort by the value, Default order, then Filter, Top items and Move to, each with what is set](../assets/screenshots/field-menu-dark.png#only-dark)

| Topic | What it offers |
| --- | --- |
| **Sort** | A to Z and Z to A side by side on the first level. For a date they read Oldest and Newest. While the field sorts by a value, the row says by which: "Largest Sum of Revenue first". |
| Sort by value | With one value in the report: "Largest Sum of Revenue first" and "Smallest Sum of Revenue first" on the first level. With more values, or a custom order: a level **Sort by value**. It has a pair for each value that gives a number. When the field has a custom order, such as the seasons in the order of the year, it also has "Custom order" and "Custom order, reversed". See [sorting](filters.md#sorting). Its row names the sort in use. |
| Sort order | **Default order** on the first level: the field's own order. See [sorting](filters.md#sorting). Greyed out, with "Already the default order.", while the field sorts this way. |
| **Filter** | A level that starts with a summary of what shows. Then come, for a date, its quick choices, such as "Last 2 years". For a month-of-the-year grouping these are the years combined. Then the values to keep, and its rules as sentences with what each keeps: the item itself compared, its total compared, a rule on its name. See [filters](filters.md). Its row says what the filter keeps: "4 of 12", "last 2 years (2025; 2026 has no data)", "from 2022", "Sum of Revenue > 1,000". A chip in **Filters** has a menu of its own: Filter, Group for a date, Name, Move to and Remove field. |
| **Group** (dates) | A level with the data's range on top and three kinds of choice. One item per period: year, quarter, month, week, day. Same period, years combined: quarter, month, week of the year, weekday, hour. Or no grouping. See [dates](values.md#dates-and-number-ranges). |
| **Number ranges** (numbers) | A level with the size of the ranges and where they start. See [ranges](values.md#number-ranges). |
Expand Down
3 changes: 3 additions & 0 deletions docs/use/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ The menu of a row or column field offers:
values, **Sort by value** lists them.
- **Custom order** sorts in an order the application gives the field, such as the seasons. A field
with such an order is sorted in it when you place it. Choose A to Z to use names instead.
- **Default order** takes the field back to its own order: A to Z, oldest first for a date, or the
order the application gives it. It is not the report's start view. It ends a sort by a value or by
a column too. It is greyed out while the field already sorts this way.

??? info "Values that cannot sort"
Values that give no number cannot sort: a list of distinct values, the first or last entry of a
Expand Down
6 changes: 6 additions & 0 deletions packages/pivotkit-element/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ All notable changes to `pivotkit-element` are documented in this file. The forma
- The import preview lets a person pick a column's decimal mark. See pivotkit-react's changelog.
The import group grows to 23.7 KiB gzip on an official Node 24 build, its budget to 23.9 KiB
([#787](https://github.com/eizedev/pivotkit/issues/787)).
- A field's menu has Default order, and Chart settings says what its unclear choices do. See
pivotkit-react's changelog. On an official Node 24 build the menus group grows to 60.3 KiB gzip, its budget
to 60.3 KiB, and the texts group, with the German menu texts, to 8.7 KiB, its budget to 8.8 KiB
([#916](https://github.com/eizedev/pivotkit/issues/916),
[#917](https://github.com/eizedev/pivotkit/issues/917),
[#963](https://github.com/eizedev/pivotkit/issues/963)).

### Changed

Expand Down
2 changes: 1 addition & 1 deletion packages/pivotkit-element/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function licenses(metafile) {
* can make the first load larger.
* `--size` fails above it.
*/
export const SIZE_BUDGET_KIB = { initial: 182.5, chart: 262.0, export: 13.7, link: 7.5, menus: 59.6, texts: 8.5, unused: 6.5, import: 23.9, report: 29.7, template: 3, lang: 6.2, tips: 1.8 };
export const SIZE_BUDGET_KIB = { initial: 182.5, chart: 262.0, export: 13.7, link: 7.5, menus: 60.3, texts: 8.8, unused: 6.5, import: 23.9, report: 29.7, template: 3, lang: 6.2, tips: 1.8 };

/**
* The load group of each chunk a page loads on demand, by its file name (esbuild's `[name]-[hash]`),
Expand Down
24 changes: 24 additions & 0 deletions packages/pivotkit-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ All notable changes to `pivotkit-react` are documented in this file. The format
The note points there first. New texts `markOf`, `markQuestion` and `markOption` in
`labels.dataImport`
([#787](https://github.com/eizedev/pivotkit/issues/787)).
- A field's menu on Rows or Columns has **Default order** ("Standardreihenfolge"), in a group named
"Sort order". It takes the field back to its own order: A to Z, oldest first, or the host's
order. It ends a sort by a value or by a column too. While the field already sorts this way, it
is greyed out with "Already the default order.". The search finds it by "reset" and "unsorted"
too, and Undo names it "default order of Region". New texts `sortOrder`, `sortDefault`,
`sortIsDefault`, `sortDefaultKeywords` and `steps.sortDefault`
([#917](https://github.com/eizedev/pivotkit/issues/917)).
- Chart settings says what a choice does where its name alone does not. A line under Automatic says
what it shows on this chart: under Value labels, Legend and Axis labels. Lines under Every n-th,
Trend and Share in the tooltip say what they do. The Tooltip's **i** says when Share in the
tooltip adds a share: for sums and counts, not for averages or values below zero. New texts
`chartNotes`
([#916](https://github.com/eizedev/pivotkit/issues/916)).

### Changed

Expand All @@ -46,6 +59,17 @@ All notable changes to `pivotkit-react` are documented in this file. The format

### Fixed

- A heatmap's Chart settings no longer list Legend. Its colour scale takes the legend's place, so
none of its choices changed anything
([#916](https://github.com/eizedev/pivotkit/issues/916)).
- On horizontal bars, Chart settings › Axis names its choice **All** ("Alle"), not "All (slanted)":
those labels are never slanted. A line under it says that it writes every name straight. New text
`axisLabelAllStraight`
([#963](https://github.com/eizedev/pivotkit/issues/963)).
- A menu's search shows a greyed-out choice greyed out, with its reason, as its level does. Before,
a hit such as Default order or Reset filter looked like one to pick and did nothing.
- The line under a menu choice, what it does or why it is greyed out, is read as the choice's
description, not as part of its name.
- The chart's text on coloured fills reads in both themes, with pivotkit-core's fix
([#913](https://github.com/eizedev/pivotkit/issues/913), [#914](https://github.com/eizedev/pivotkit/issues/914)):
a treemap's labels on plates in the background colour, in the middle of their tiles and cut to fit, a heatmap's numbers in the ink that reads on
Expand Down
1 change: 1 addition & 0 deletions packages/pivotkit-react/src/labels-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export const de = {
moved: "{field} nach {zone} verschoben",
reordered: "Reihenfolge in {zone}",
sort: "Sortierung von {field}",
sortDefault: "Standardreihenfolge von {field}",
group: "Gruppierung von {field}",
rename: "Name von {field}",
filter: "Filter auf {field}",
Expand Down
1 change: 1 addition & 0 deletions packages/pivotkit-react/src/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export const en = {
moved: "{field} moved to {zone}",
reordered: "order in {zone}",
sort: "sort of {field}",
sortDefault: "default order of {field}",
group: "grouping of {field}",
rename: "name of {field}",
filter: "filter on {field}",
Expand Down
12 changes: 7 additions & 5 deletions packages/pivotkit-react/src/levels.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Icon } from "./icons.jsx";
import { fill } from "./labels.js";
import { ClearInput } from "./clear-input.jsx";
import { HelpContext } from "./help.js";
import { Group } from "./popover.jsx";
import { Group, menuItemRole } from "./popover.jsx";
import { SettingInfo } from "./section.jsx";
import { rowName, searchEntries, searchHits, stepIndex, typeAheadIndex } from "./menu-topics.js";

Expand Down Expand Up @@ -202,12 +202,13 @@ export function MenuList({ label, labelledBy, describedBy, className, close, chi
* label?: string, className?: string, disabled?: boolean, reason?: string, haspopup?: "menu" | "dialog", level?: string,
* description?: string | null, current?: boolean, note?: string, children?: React.ReactNode }} props
* `plain`: the text type-ahead matches; `start`: takes Tab first; `level`: the topic it opens;
* `note`: a line under the text of an entry that can be chosen, read with it (what a pick does);
* `note`: a line under the text of an entry that can be chosen (what a pick does); it and `reason` are
* read as the entry's description, not as part of its name;
* `description`: an explanation a screen reader reads with it (the "i" next to it shows it);
* `current`: the entry shown now (the view loaded), with a check and aria-current
*/
export function MenuItem({ id, text, onSelect, checked, checkbox, hint, icon, danger, testId, start, plain, label, className, disabled, reason, haspopup, level, description, current, note, children }) {
const role = checked === undefined ? "menuitem" : checkbox ? "menuitemcheckbox" : "menuitemradio";
const role = menuItemRole(checked, checkbox);
const reasonId = useId();
// the line under the text: why it is off, or what choosing it does
const sub = disabled ? reason : note;
Expand Down Expand Up @@ -236,7 +237,8 @@ export function MenuItem({ id, text, onSelect, checked, checkbox, hint, icon, da
<span className="pk-option-text">
{text}
{sub ? (
<span id={reasonId} className="pk-option-hint" data-testid={`${testId ?? id}-${disabled ? "reason" : "note"}`}>
// out of the name (aria-hidden): a screen reader reads it once, as the description (aria-describedby)
<span id={reasonId} className="pk-option-hint" aria-hidden="true" data-testid={`${testId ?? id}-${disabled ? "reason" : "note"}`}>
{sub}
</span>
) : null}
Expand Down Expand Up @@ -469,7 +471,7 @@ function SearchHits({ hits, labels, onPick, onOpen, close }) {
return (
<MenuList label={labels.searchResults} close={close} testId="menu-search-hits" lang={labels.lang}>
{hits.map((h) => (
<MenuItem key={h.id} id={`hit-${h.id}`} text={h.choice ? h.text : `${h.text}…`} plain={h.text} checked={h.choice?.checked} icon={h.choice ? h.topic.icon : "chevronRight"} hint={h.path || undefined} haspopup={h.choice ? undefined : "dialog"} onSelect={() => (h.choice ? onPick(h.choice) : onOpen(h.topic.id, undefined, h.focus))} />
<MenuItem key={h.id} id={`hit-${h.id}`} text={h.choice ? h.text : `${h.text}…`} plain={h.text} checked={h.choice?.checked} icon={h.choice ? h.topic.icon : "chevronRight"} hint={h.path || undefined} haspopup={h.choice ? undefined : "dialog"} disabled={h.choice?.disabled} reason={h.choice?.reason} note={h.choice?.note} onSelect={() => (h.choice ? onPick(h.choice) : onOpen(h.topic.id, undefined, h.focus))} />
))}
</MenuList>
);
Expand Down
Loading
Loading