pivotkit-react 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +339 -1
- package/README.md +2 -2
- package/dist/chunks/{chunk-IOPAM4JD.js → chunk-2AT72SLA.js} +635 -980
- package/dist/chunks/chunk-3E4NB5RZ.js +215 -0
- package/dist/chunks/{chunk-32Z33U6S.js → chunk-3WUGQPWV.js} +106 -9
- package/dist/chunks/{chunk-7CC4JHDY.js → chunk-4RS72AAA.js} +27 -8
- package/dist/chunks/{chunk-EM23V5GH.js → chunk-E6M57YLL.js} +19 -8
- package/dist/chunks/{chunk-RWYHJRQO.js → chunk-JMRTIOX4.js} +17 -7
- package/dist/chunks/chunk-RIOSIYGC.js +665 -0
- package/dist/chunks/{chunk-APB4NW4O.js → chunk-U5Q5I2D5.js} +36 -10
- package/dist/chunks/report-run-BZBFOMPF.js +12 -0
- package/dist/chunks/{unused-texts-K3VFH65P.js → unused-texts-Y4R67XSN.js} +1 -1
- package/dist/chunks/{unused-texts-de-OW4TGIVX.js → unused-texts-de-6YVPTNVS.js} +1 -1
- package/dist/echarts.js +38 -156
- package/dist/import-ui.js +765 -0
- package/dist/import-worker.js +20 -0
- package/dist/index.js +683 -244
- package/dist/labels.js +14 -10
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +768 -299
- package/dist/styles.css +322 -100
- package/package.json +9 -4
- package/types/chart-decorate.d.ts +28 -4
- package/types/chart-types.d.ts +2 -4
- package/types/data-history.d.ts +85 -0
- package/types/data-keep.d.ts +51 -0
- package/types/data-menu.d.ts +11 -0
- package/types/dom.d.ts +40 -7
- package/types/echarts.d.ts +1 -1
- package/types/export-run.d.ts +37 -3
- package/types/field-info.d.ts +32 -0
- package/types/filter.d.ts +1 -1
- package/types/icons.d.ts +1 -0
- package/types/import-host.d.ts +53 -0
- package/types/import-labels.d.ts +401 -0
- package/types/import-limits.d.ts +6 -0
- package/types/import-module.d.ts +2 -0
- package/types/import-run.d.ts +73 -0
- package/types/import-source.d.ts +32 -0
- package/types/import-steps.d.ts +121 -0
- package/types/import-ui.d.ts +108 -0
- package/types/import-worker.d.ts +1 -0
- package/types/index.d.ts +81 -11
- package/types/labels.d.ts +224 -4
- package/types/lazy-import.d.ts +4 -0
- package/types/lazy-menus.d.ts +2 -2
- package/types/levels.d.ts +3 -2
- package/types/light-tokens.d.ts +16 -0
- package/types/menu-labels.d.ts +37 -17
- package/types/menu-ops.d.ts +161 -40
- package/types/menu-topics.d.ts +9 -8
- package/types/menus.d.ts +1 -0
- package/types/names.d.ts +47 -19
- package/types/overflow.d.ts +29 -17
- package/types/place.d.ts +24 -0
- package/types/popover.d.ts +47 -5
- package/types/print-frame.d.ts +24 -0
- package/types/report-run.d.ts +14 -0
- package/types/section.d.ts +2 -2
- package/types/share-actions.d.ts +3 -3
- package/types/share.d.ts +13 -17
- package/types/theme.d.ts +2 -16
- package/types/tips.d.ts +5 -0
- package/types/toasts.d.ts +1 -1
- package/types/toolbar-panels.d.ts +11 -9
- package/types/unused-keep.d.ts +20 -0
- package/types/unused-texts.d.ts +13 -3
- package/types/unused.d.ts +1 -0
- package/types/use-export.d.ts +2 -2
- package/types/use-view-history.d.ts +12 -4
- package/types/view-ops.d.ts +65 -6
- package/types/virtual.d.ts +15 -0
- package/types/chart-layout.d.ts +0 -111
package/types/virtual.d.ts
CHANGED
|
@@ -42,3 +42,18 @@ export declare function sliceRows(grid: import("pivotkit-core").Grid, start: num
|
|
|
42
42
|
* @param {number} r body row index
|
|
43
43
|
*/
|
|
44
44
|
export declare function rowLabelOf(grid: import("pivotkit-core").Grid, r: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* The longest row labels of a column by their number of characters, at most `n`: what a virtual table
|
|
47
|
+
* measures for the column's width once, instead of the rows it happens to show (they change as it
|
|
48
|
+
* scrolls). With each label whether it has a group's toggle in front of it and whether it is a total's
|
|
49
|
+
* (drawn bolder). A label spanning several columns (a total) is left out: it widens no single column.
|
|
50
|
+
* @param {import("pivotkit-core").Grid} grid
|
|
51
|
+
* @param {number} col a row label column (below grid.rowHeaderColumns)
|
|
52
|
+
* @param {number} n
|
|
53
|
+
* @returns {Array<{ text: string, toggle: boolean, total: boolean }>}
|
|
54
|
+
*/
|
|
55
|
+
export declare function longestLabels(grid: import("pivotkit-core").Grid, col: number, n: number): Array<{
|
|
56
|
+
text: string;
|
|
57
|
+
toggle: boolean;
|
|
58
|
+
total: boolean;
|
|
59
|
+
}>;
|
package/types/chart-layout.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Room (px) above and below a pie for the labels outside it, for a chart `height` px high: 5 % of the
|
|
3
|
-
* height, at most 24 px. The pie's radius is a share of its box, so in a low box the top and bottom
|
|
4
|
-
* labels would reach past the canvas; a tall box keeps nearly all of its pie.
|
|
5
|
-
* @param {number} height
|
|
6
|
-
*/
|
|
7
|
-
export declare function pieLabelRoom(height: number): number;
|
|
8
|
-
/**
|
|
9
|
-
* The least width (px) of a chart that keeps a legend on its right: the legend's column takes 160 px
|
|
10
|
-
* (pivotkit-core), so a narrower chart (a phone) would squeeze the pie or the plot into a sliver. Below
|
|
11
|
-
* it the legend is drawn at the bottom instead, with the room pivotkit-core gives a bottom legend.
|
|
12
|
-
*/
|
|
13
|
-
export declare const RIGHT_LEGEND_MIN_WIDTH = 480;
|
|
14
|
-
/** Room (px) pivotkit-core gives a legend at the bottom of a chart. */
|
|
15
|
-
export declare const BOTTOM_LEGEND_ROOM = 32;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the numbers written inside a donut's ring fit across it: the ring is the outer less the
|
|
18
|
-
* inner radius, both a share (ECharts' "70%") of half the smaller side of the pie's box. A pie (no
|
|
19
|
-
* inner radius) has room from its centre and always fits.
|
|
20
|
-
* @param {[string | number, string | number]} radius the series' radius, inner and outer
|
|
21
|
-
* @param {{ width: number, height: number }} box the pie's box: the chart less the room around it
|
|
22
|
-
* @param {string[]} texts the labels written on the slices
|
|
23
|
-
*/
|
|
24
|
-
export declare function ringLabelsFit(radius: [string | number, string | number], box: {
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
|
-
}, texts: string[]): boolean;
|
|
28
|
-
/** Width (px) a slanted column name of a heatmap takes at most; a longer one ends in "…". */
|
|
29
|
-
export declare const SLANTED_LABEL_WIDTH = 120;
|
|
30
|
-
/**
|
|
31
|
-
* How a heatmap writes its column names along the x axis of a chart `width` px wide: straight when
|
|
32
|
-
* the longest fits its column, else slanted by 45 degrees and cut at SLANTED_LABEL_WIDTH. Every name is
|
|
33
|
-
* shown (the core sets interval 0); the width of a character is estimated as 0.55 of the font size.
|
|
34
|
-
* @param {string[]} names
|
|
35
|
-
* @param {number} width the chart's width in px
|
|
36
|
-
* @param {number} [fontSize] px, ECharts' default for axis labels
|
|
37
|
-
* @returns {{ rotate: number, width?: number, overflow?: "truncate" }}
|
|
38
|
-
*/
|
|
39
|
-
export declare function columnLabelLayout(names: string[], width: number, fontSize?: number): {
|
|
40
|
-
rotate: number;
|
|
41
|
-
width?: number;
|
|
42
|
-
overflow?: "truncate";
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* True when the cells of a heatmap of `columns` x `rows` in a chart of `width` x `height` px hold their
|
|
46
|
-
* numbers as the chart writes them (`texts`, formatted: "1,234.5", "-12.3%"): the longest, estimated at
|
|
47
|
-
* 0.55 of the font size per character, fits a cell's width with room on both sides, and a line its height.
|
|
48
|
-
* @param {number} columns
|
|
49
|
-
* @param {number} rows
|
|
50
|
-
* @param {number} width
|
|
51
|
-
* @param {number} height
|
|
52
|
-
* @param {string[]} texts
|
|
53
|
-
* @param {number} [fontSize] px, ECharts' default for labels
|
|
54
|
-
*/
|
|
55
|
-
export declare function heatmapCellLabels(columns: number, rows: number, width: number, height: number, texts: string[], fontSize?: number): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Which row names of a heatmap the y axis writes in a chart `height` px high: every one (0) when a line
|
|
58
|
-
* fits each row, else every n-th (ECharts' interval: n - 1 names left out between two shown), so the
|
|
59
|
-
* names never overlap and the first one is always there.
|
|
60
|
-
* @param {number} rows
|
|
61
|
-
* @param {number} height
|
|
62
|
-
*/
|
|
63
|
-
export declare function rowLabelInterval(rows: number, height: number): number;
|
|
64
|
-
/** Width (px) a category label of bars, lines and areas takes at most: a longer one ends in "…" (the tooltip has it whole). */
|
|
65
|
-
export declare const CATEGORY_LABEL_WIDTH = 120;
|
|
66
|
-
/**
|
|
67
|
-
* How the category axis of bars, lines and areas writes its labels (`chart.axisLabels`):
|
|
68
|
-
* - "auto": every label straight when the longest fits its slot, else slanted by 45 degrees while a
|
|
69
|
-
* line fits each slot, else every n-th slanted (`every` > 1, the chart says so in a note);
|
|
70
|
-
* - "all": every label, slanted when they do not fit straight;
|
|
71
|
-
* - "nth": straight, every n-th so they never overlap.
|
|
72
|
-
* Along a vertical axis (horizontal bars) the labels stay straight: every one while a line fits each
|
|
73
|
-
* row, else every n-th. A label is cut at CATEGORY_LABEL_WIDTH; character width estimated at 0.55 of the font size.
|
|
74
|
-
* @param {string[]} names
|
|
75
|
-
* @param {{ width: number, height: number, horizontal?: boolean, mode?: string, fontSize?: number }} box
|
|
76
|
-
* @returns {{ rotate: number, interval: number, every: number, width: number, overflow: "truncate" }}
|
|
77
|
-
*/
|
|
78
|
-
export declare function categoryLabelLayout(names: string[], { width, height, horizontal, mode, fontSize }: {
|
|
79
|
-
width: number;
|
|
80
|
-
height: number;
|
|
81
|
-
horizontal?: boolean;
|
|
82
|
-
mode?: string;
|
|
83
|
-
fontSize?: number;
|
|
84
|
-
}): {
|
|
85
|
-
rotate: number;
|
|
86
|
-
interval: number;
|
|
87
|
-
every: number;
|
|
88
|
-
width: number;
|
|
89
|
-
overflow: "truncate";
|
|
90
|
-
};
|
|
91
|
-
/** The least room (px) a group label needs along the axis, and the least size of a chart with group labels. */
|
|
92
|
-
export declare const GROUP_LABEL_ROOM: Readonly<{
|
|
93
|
-
along: 56;
|
|
94
|
-
across: 28;
|
|
95
|
-
width: 420;
|
|
96
|
-
height: 260;
|
|
97
|
-
}>;
|
|
98
|
-
/**
|
|
99
|
-
* Whether "auto" group labels fit a chart of `width` x `height` px with `count` categories whose
|
|
100
|
-
* smallest group has `groupSize` of them: each group's name needs GROUP_LABEL_ROOM.along px under the
|
|
101
|
-
* axis (across: a line per group beside a vertical axis), and the chart itself a least size, or the
|
|
102
|
-
* plot area left over is too small to read.
|
|
103
|
-
* @param {number} count
|
|
104
|
-
* @param {number} groupSize
|
|
105
|
-
* @param {{ width: number, height: number, horizontal?: boolean }} box
|
|
106
|
-
*/
|
|
107
|
-
export declare function groupLabelsFit(count: number, groupSize: number, { width, height, horizontal }: {
|
|
108
|
-
width: number;
|
|
109
|
-
height: number;
|
|
110
|
-
horizontal?: boolean;
|
|
111
|
-
}): boolean;
|