pivotkit-react 0.4.0 → 0.6.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 +267 -1
- package/README.md +5 -2
- package/dist/chunks/{chunk-YITKWZ4L.js → chunk-2RAVX4DO.js} +604 -505
- package/dist/chunks/{chunk-ZYEYZSYL.js → chunk-7LERNGUW.js} +36 -2
- 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-XN55BQ4M.js → chunk-RIOSIYGC.js} +54 -7
- package/dist/chunks/{chunk-LEN5RPBM.js → chunk-TR2HROIK.js} +43 -7
- package/dist/chunks/chunk-W2KIPREL.js +36 -0
- package/dist/chunks/{chunk-6MDAL3IO.js → chunk-XN5HNKJ2.js} +88 -101
- package/dist/chunks/{chunk-WB4GKWFQ.js → chunk-YXLANLGL.js} +34 -6
- 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 +69 -168
- package/dist/index.js +160 -102
- package/dist/labels.js +6 -6
- package/dist/menu-texts-de.js +1 -1
- package/dist/menus.js +778 -277
- package/dist/styles.css +207 -93
- package/package.json +8 -4
- package/types/chart-decorate.d.ts +28 -4
- package/types/chart-types.d.ts +2 -4
- package/types/echarts.d.ts +1 -1
- package/types/export-run.d.ts +42 -4
- package/types/field-info.d.ts +3 -10
- package/types/filter.d.ts +1 -1
- package/types/icons.d.ts +1 -0
- package/types/import-host.d.ts +34 -8
- package/types/import-labels.d.ts +47 -0
- package/types/import-limits.d.ts +6 -0
- package/types/import-module.d.ts +1 -1
- package/types/import-steps.d.ts +8 -0
- package/types/import-ui.d.ts +18 -4
- package/types/index.d.ts +76 -17
- package/types/labels.d.ts +200 -24
- package/types/light-tokens.d.ts +16 -0
- package/types/menu-labels.d.ts +43 -14
- package/types/menu-ops.d.ts +166 -43
- package/types/menu-topics.d.ts +7 -4
- package/types/names.d.ts +47 -19
- package/types/place.d.ts +24 -0
- package/types/print-frame.d.ts +24 -0
- package/types/report-run.d.ts +14 -0
- package/types/share-actions.d.ts +17 -3
- package/types/share.d.ts +13 -17
- package/types/sheet-views.d.ts +60 -0
- package/types/templates.d.ts +21 -1
- package/types/theme.d.ts +2 -16
- package/types/tips.d.ts +5 -0
- package/types/toolbar-panels.d.ts +9 -6
- package/types/unused-texts.d.ts +13 -3
- package/types/use-export.d.ts +2 -2
- package/types/view-ops.d.ts +65 -6
- package/types/view-save.d.ts +10 -6
- package/types/view-store.d.ts +21 -11
- package/types/chart-layout.d.ts +0 -111
- package/types/import-source.d.ts +0 -32
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/labels.js
|
|
2
|
-
import {
|
|
2
|
+
import { GROUPING_NAMES, PivotkitError, REPORT_LABELS } from "pivotkit-core";
|
|
3
3
|
var en = {
|
|
4
4
|
/** the language of the texts, for the report's lang attribute */
|
|
5
5
|
lang: "en",
|
|
@@ -7,28 +7,7 @@ var en = {
|
|
|
7
7
|
report: "Pivot report",
|
|
8
8
|
core: (
|
|
9
9
|
/** @type {import("pivotkit-core").Labels} */
|
|
10
|
-
|
|
11
|
-
...DEFAULT_LABELS,
|
|
12
|
-
// a yes/no field in the table, the filter list and the drill-down: words, not true/false
|
|
13
|
-
true: "Yes",
|
|
14
|
-
false: "No",
|
|
15
|
-
aggregators: {
|
|
16
|
-
count: "Count",
|
|
17
|
-
countUnique: "Distinct count",
|
|
18
|
-
listUnique: "List of distinct values",
|
|
19
|
-
sum: "Sum",
|
|
20
|
-
average: "Average",
|
|
21
|
-
median: "Median",
|
|
22
|
-
min: "Minimum",
|
|
23
|
-
max: "Maximum",
|
|
24
|
-
stdev: "Standard deviation (sample)",
|
|
25
|
-
stdevp: "Standard deviation (population)",
|
|
26
|
-
var: "Variance (sample)",
|
|
27
|
-
varp: "Variance (population)",
|
|
28
|
-
first: "First value",
|
|
29
|
-
last: "Last value"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
10
|
+
REPORT_LABELS.en
|
|
32
11
|
),
|
|
33
12
|
zones: { rows: "Rows", cols: "Columns", values: "Values", filters: "Filters" },
|
|
34
13
|
zoneHints: {
|
|
@@ -124,27 +103,14 @@ var en = {
|
|
|
124
103
|
hour: "Hour of day",
|
|
125
104
|
bin: "Ranges"
|
|
126
105
|
},
|
|
127
|
-
// a date grouping's name: "Date by month"; the unit as it reads inside it (unitInName)
|
|
128
|
-
derivedName:
|
|
129
|
-
unitInName: {
|
|
130
|
-
|
|
131
|
-
yearQuarter: "quarter",
|
|
132
|
-
yearMonth: "month",
|
|
133
|
-
yearWeek: "week",
|
|
134
|
-
day: "day",
|
|
135
|
-
quarter: "quarter of year",
|
|
136
|
-
month: "month of year",
|
|
137
|
-
week: "week of year",
|
|
138
|
-
weekday: "weekday",
|
|
139
|
-
hour: "hour of day",
|
|
140
|
-
bin: "ranges"
|
|
141
|
-
},
|
|
142
|
-
binsName: "{field} (by {size})",
|
|
106
|
+
// a date grouping's name: "Date by month"; the unit as it reads inside it (unitInName); pivotkit-core's GROUPING_NAMES
|
|
107
|
+
derivedName: GROUPING_NAMES.en.name,
|
|
108
|
+
unitInName: { ...GROUPING_NAMES.en.units },
|
|
109
|
+
binsName: GROUPING_NAMES.en.bins,
|
|
143
110
|
top: "Top",
|
|
144
111
|
topBadge: "Top {count}",
|
|
145
112
|
bottomBadge: "Bottom {count}",
|
|
146
113
|
by: "by {value}",
|
|
147
|
-
filter: "Filter\u2026",
|
|
148
114
|
filtered: "Filtered",
|
|
149
115
|
filterSummary: "{shown} of {total}",
|
|
150
116
|
/** a text the user typed or a name, quoted as the language quotes: a text condition, field names */
|
|
@@ -245,6 +211,7 @@ var en = {
|
|
|
245
211
|
percentRunningTotal: "100% is the total along the axis: the running total ends at 100%.",
|
|
246
212
|
percentDifferenceFromPrevious: "The previous item is 100%: each value says how much it grew or shrank from it."
|
|
247
213
|
},
|
|
214
|
+
colSubtotals: "A Total column adds up the columns of the group before it; it is not an item of its own.",
|
|
248
215
|
chartOverTime: "{field} is a date: lines show how the values change over time.",
|
|
249
216
|
pieSlices: "A pie works for up to about {max} parts; this one has {count}. Bars compare them more easily.",
|
|
250
217
|
pieColumns: "A pie draws one slice per row and adds up the columns ({fields}). Bars show the columns side by side.",
|
|
@@ -266,7 +233,8 @@ var en = {
|
|
|
266
233
|
groupDate: "Group by {unit}",
|
|
267
234
|
saveTemplate: "Save view",
|
|
268
235
|
bars: "Switch to Bars",
|
|
269
|
-
auto: "Show as lines over time"
|
|
236
|
+
auto: "Show as lines over time",
|
|
237
|
+
colSubtotalsOff: "Hide column subtotals"
|
|
270
238
|
},
|
|
271
239
|
dismissTip: "Dismiss tip",
|
|
272
240
|
tipsTitle: "Tips",
|
|
@@ -326,12 +294,48 @@ var en = {
|
|
|
326
294
|
// the measure a sort or a filter goes by when the view shows no value: the rows counted
|
|
327
295
|
countOfRows: "Count of rows",
|
|
328
296
|
// a rule on the names of a field's items, on its chip and in its menu: "contains “an”"
|
|
329
|
-
labelOps: { equals: "is", notEquals: "is not", contains: "contains", notContains: "does not contain", beginsWith: "begins with", endsWith: "ends with" },
|
|
297
|
+
labelOps: { equals: "is", notEquals: "is not", contains: "contains", notContains: "does not contain", beginsWith: "begins with", notBeginsWith: "does not begin with", endsWith: "ends with", notEndsWith: "does not end with" },
|
|
298
|
+
// a rule inverted (a loaded view's "not" the menus have no word for): "not (begins with “a”)"
|
|
299
|
+
notRule: "not ({rule})",
|
|
330
300
|
// a relative date range and a date compared, in short (the chip and the Filter level): "last 5 years (2022–2026)", "from 2022"
|
|
331
301
|
relative: { year: "this year", years: "last {count} years", month: "last {count} month", months: "last {count} months", day: "last {count} day", days: "last {count} days" },
|
|
332
302
|
withRange: "{text} ({range})",
|
|
333
303
|
// the range counted back from the data's latest record, and the data's share of a range
|
|
334
304
|
relativeTo: "{text} to {end}",
|
|
305
|
+
// a relative range the menus do not write yet (a loaded view's): its words, and the dates it keeps
|
|
306
|
+
relativeMore: {
|
|
307
|
+
last: {
|
|
308
|
+
hour: { one: "last {count} hour", other: "last {count} hours" },
|
|
309
|
+
day: { one: "last {count} day", other: "last {count} days" },
|
|
310
|
+
week: { one: "last {count} week", other: "last {count} weeks" },
|
|
311
|
+
month: { one: "last {count} month", other: "last {count} months" },
|
|
312
|
+
quarter: { one: "last {count} quarter", other: "last {count} quarters" },
|
|
313
|
+
year: { one: "last {count} year", other: "last {count} years" }
|
|
314
|
+
},
|
|
315
|
+
next: {
|
|
316
|
+
hour: { one: "next {count} hour", other: "next {count} hours" },
|
|
317
|
+
day: { one: "next {count} day", other: "next {count} days" },
|
|
318
|
+
week: { one: "next {count} week", other: "next {count} weeks" },
|
|
319
|
+
month: { one: "next {count} month", other: "next {count} months" },
|
|
320
|
+
quarter: { one: "next {count} quarter", other: "next {count} quarters" },
|
|
321
|
+
year: { one: "next {count} year", other: "next {count} years" }
|
|
322
|
+
},
|
|
323
|
+
before: {
|
|
324
|
+
hour: { one: "before the last {count} hour", other: "before the last {count} hours" },
|
|
325
|
+
day: { one: "before the last {count} day", other: "before the last {count} days" },
|
|
326
|
+
week: { one: "before the last {count} week", other: "before the last {count} weeks" },
|
|
327
|
+
month: { one: "before the last {count} month", other: "before the last {count} months" },
|
|
328
|
+
quarter: { one: "before the last {count} quarter", other: "before the last {count} quarters" },
|
|
329
|
+
year: { one: "before the last {count} year", other: "before the last {count} years" }
|
|
330
|
+
},
|
|
331
|
+
this: { hour: "this hour", day: "today", week: "this week", month: "this month", quarter: "this quarter", year: "this year" },
|
|
332
|
+
rolling: "{text}, rolling",
|
|
333
|
+
withoutCurrent: "{text}, current period excluded",
|
|
334
|
+
fromLatest: "{text}, counted from the latest record",
|
|
335
|
+
fromFirst: "{text}, counted from the first record",
|
|
336
|
+
fromDate: "{text}, counted from {date}",
|
|
337
|
+
until: "until {to}"
|
|
338
|
+
},
|
|
335
339
|
withShare: "{text} ({range}; {missing})",
|
|
336
340
|
noData: { one: "{range} has no data", other: "{range} have no data" },
|
|
337
341
|
compareShort: { "=": "{value}", "!=": "not {value}", ">": "after {value}", ">=": "from {value}", "<": "before {value}", "<=": "up to {value}", between: "{from} to {to}", notBetween: "not {from} to {to}" },
|
|
@@ -353,47 +357,7 @@ var de = {
|
|
|
353
357
|
report: "Pivot-Bericht",
|
|
354
358
|
core: (
|
|
355
359
|
/** @type {import("pivotkit-core").Labels} */
|
|
356
|
-
|
|
357
|
-
...DEFAULT_LABELS,
|
|
358
|
-
blank: "(Leer)",
|
|
359
|
-
total: "{label} gesamt",
|
|
360
|
-
grandTotal: "Gesamtergebnis",
|
|
361
|
-
values: "Werte",
|
|
362
|
-
valueName: "{agg} von {field}",
|
|
363
|
-
countRows: "Anzahl",
|
|
364
|
-
true: "Ja",
|
|
365
|
-
false: "Nein",
|
|
366
|
-
aggregators: {
|
|
367
|
-
count: "Anzahl",
|
|
368
|
-
countUnique: "Anzahl verschiedener Werte",
|
|
369
|
-
listUnique: "Liste verschiedener Werte",
|
|
370
|
-
sum: "Summe",
|
|
371
|
-
average: "Durchschnitt",
|
|
372
|
-
median: "Median",
|
|
373
|
-
min: "Minimum",
|
|
374
|
-
max: "Maximum",
|
|
375
|
-
stdev: "Standardabweichung (Stichprobe)",
|
|
376
|
-
stdevp: "Standardabweichung (Grundgesamtheit)",
|
|
377
|
-
var: "Varianz (Stichprobe)",
|
|
378
|
-
varp: "Varianz (Grundgesamtheit)",
|
|
379
|
-
first: "Erster Wert",
|
|
380
|
-
last: "Letzter Wert"
|
|
381
|
-
},
|
|
382
|
-
showAsName: "{showAs} von {value}",
|
|
383
|
-
showAs: {
|
|
384
|
-
percentOfGrandTotal: "% des Gesamtergebnisses",
|
|
385
|
-
percentOfRowTotal: "% der Zeilensumme",
|
|
386
|
-
percentOfColumnTotal: "% der Spaltensumme",
|
|
387
|
-
percentOfParentRow: "% der \xFCbergeordneten Zeile",
|
|
388
|
-
percentOfParentColumn: "% der \xFCbergeordneten Spalte",
|
|
389
|
-
differenceFromPrevious: "Differenz zum vorherigen",
|
|
390
|
-
percentDifferenceFromPrevious: "% Differenz zum vorherigen",
|
|
391
|
-
runningTotal: "Laufende Summe",
|
|
392
|
-
percentRunningTotal: "% laufende Summe",
|
|
393
|
-
rankAscending: "Rang (kleinster zuerst)",
|
|
394
|
-
rankDescending: "Rang (gr\xF6\xDFter zuerst)"
|
|
395
|
-
}
|
|
396
|
-
}
|
|
360
|
+
REPORT_LABELS.de
|
|
397
361
|
),
|
|
398
362
|
zones: { rows: "Zeilen", cols: "Spalten", values: "Werte", filters: "Filter" },
|
|
399
363
|
zoneHints: {
|
|
@@ -478,26 +442,13 @@ var de = {
|
|
|
478
442
|
hour: "Stunde am Tag",
|
|
479
443
|
bin: "Bereiche"
|
|
480
444
|
},
|
|
481
|
-
derivedName:
|
|
482
|
-
unitInName: {
|
|
483
|
-
|
|
484
|
-
yearQuarter: "Quartal",
|
|
485
|
-
yearMonth: "Monat",
|
|
486
|
-
yearWeek: "Woche",
|
|
487
|
-
day: "Tag",
|
|
488
|
-
quarter: "Quartal im Jahr",
|
|
489
|
-
month: "Monat im Jahr",
|
|
490
|
-
week: "Woche im Jahr",
|
|
491
|
-
weekday: "Wochentag",
|
|
492
|
-
hour: "Stunde am Tag",
|
|
493
|
-
bin: "Bereichen"
|
|
494
|
-
},
|
|
495
|
-
binsName: "{field} (je {size})",
|
|
445
|
+
derivedName: GROUPING_NAMES.de.name,
|
|
446
|
+
unitInName: { ...GROUPING_NAMES.de.units },
|
|
447
|
+
binsName: GROUPING_NAMES.de.bins,
|
|
496
448
|
top: "Oberste",
|
|
497
449
|
topBadge: "Top {count}",
|
|
498
450
|
bottomBadge: "Letzte {count}",
|
|
499
451
|
by: "nach {value}",
|
|
500
|
-
filter: "Filtern\u2026",
|
|
501
452
|
filtered: "Gefiltert",
|
|
502
453
|
filterSummary: "{shown} von {total}",
|
|
503
454
|
quote: "\u201E{text}\u201C",
|
|
@@ -587,6 +538,7 @@ var de = {
|
|
|
587
538
|
chartOverTime: "{field} ist ein Datum: Linien zeigen, wie sich die Werte \xFCber die Zeit \xE4ndern.",
|
|
588
539
|
pieSlices: "Ein Kreis eignet sich f\xFCr bis zu etwa {max} Teile; dieser hat {count}. Balken lassen sich leichter vergleichen.",
|
|
589
540
|
pieColumns: "Ein Kreis zeigt ein St\xFCck je Zeile und addiert daf\xFCr die Spalten ({fields}). Balken zeigen die Spalten nebeneinander.",
|
|
541
|
+
colSubtotals: "Eine Spalte \u201E\u2026 gesamt\u201C addiert die Spalten der Gruppe davor; sie ist kein eigener Eintrag.",
|
|
590
542
|
chartDates: "Die Daten liegen in Spalten, so wird jedes Datum eine eigene Linie. Zeilen und Spalten tauschen, um die Daten entlang der Achse zu zeichnen.",
|
|
591
543
|
chartTrend: "Linien verbinden Punkte zu einem Verlauf. F\xFCr Kategorien wie L\xE4nder passen Balken besser.",
|
|
592
544
|
chartSeries: "{count} Reihen sind schwer zu unterscheiden. Zeilen und Spalten tauschen oder Spalten auf weniger Eintr\xE4ge filtern.",
|
|
@@ -605,7 +557,8 @@ var de = {
|
|
|
605
557
|
groupDate: "Nach {unit} gruppieren",
|
|
606
558
|
saveTemplate: "Ansicht speichern",
|
|
607
559
|
bars: "Zu Balken wechseln",
|
|
608
|
-
auto: "Als Linien \xFCber die Zeit zeigen"
|
|
560
|
+
auto: "Als Linien \xFCber die Zeit zeigen",
|
|
561
|
+
colSubtotalsOff: "Teilergebnisse der Spalten ausblenden"
|
|
609
562
|
},
|
|
610
563
|
dismissTip: "Tipp ausblenden",
|
|
611
564
|
tipsTitle: "Tipps",
|
|
@@ -654,10 +607,44 @@ var de = {
|
|
|
654
607
|
},
|
|
655
608
|
valueConditions: { compare: "{value} {op} {number}", between: "{value} zwischen {from} und {to}", notBetween: "{value} nicht zwischen {from} und {to}" },
|
|
656
609
|
countOfRows: "Anzahl der Zeilen",
|
|
657
|
-
labelOps: { equals: "ist", notEquals: "ist nicht", contains: "enth\xE4lt", notContains: "enth\xE4lt nicht", beginsWith: "beginnt mit", endsWith: "endet mit" },
|
|
610
|
+
labelOps: { equals: "ist", notEquals: "ist nicht", contains: "enth\xE4lt", notContains: "enth\xE4lt nicht", beginsWith: "beginnt mit", notBeginsWith: "beginnt nicht mit", endsWith: "endet mit", notEndsWith: "endet nicht mit" },
|
|
611
|
+
notRule: "nicht ({rule})",
|
|
658
612
|
relative: { year: "dieses Jahr", years: "letzte {count} Jahre", month: "letzter {count} Monat", months: "letzte {count} Monate", day: "letzter {count} Tag", days: "letzte {count} Tage" },
|
|
659
613
|
withRange: "{text} ({range})",
|
|
660
614
|
relativeTo: "{text} bis {end}",
|
|
615
|
+
relativeMore: {
|
|
616
|
+
last: {
|
|
617
|
+
hour: { one: "letzte {count} Stunde", other: "letzte {count} Stunden" },
|
|
618
|
+
day: { one: "letzter {count} Tag", other: "letzte {count} Tage" },
|
|
619
|
+
week: { one: "letzte {count} Woche", other: "letzte {count} Wochen" },
|
|
620
|
+
month: { one: "letzter {count} Monat", other: "letzte {count} Monate" },
|
|
621
|
+
quarter: { one: "letztes {count} Quartal", other: "letzte {count} Quartale" },
|
|
622
|
+
year: { one: "letztes {count} Jahr", other: "letzte {count} Jahre" }
|
|
623
|
+
},
|
|
624
|
+
next: {
|
|
625
|
+
hour: { one: "n\xE4chste {count} Stunde", other: "n\xE4chste {count} Stunden" },
|
|
626
|
+
day: { one: "n\xE4chster {count} Tag", other: "n\xE4chste {count} Tage" },
|
|
627
|
+
week: { one: "n\xE4chste {count} Woche", other: "n\xE4chste {count} Wochen" },
|
|
628
|
+
month: { one: "n\xE4chster {count} Monat", other: "n\xE4chste {count} Monate" },
|
|
629
|
+
quarter: { one: "n\xE4chstes {count} Quartal", other: "n\xE4chste {count} Quartale" },
|
|
630
|
+
year: { one: "n\xE4chstes {count} Jahr", other: "n\xE4chste {count} Jahre" }
|
|
631
|
+
},
|
|
632
|
+
before: {
|
|
633
|
+
hour: { one: "vor der letzten {count} Stunde", other: "vor den letzten {count} Stunden" },
|
|
634
|
+
day: { one: "vor dem letzten {count} Tag", other: "vor den letzten {count} Tagen" },
|
|
635
|
+
week: { one: "vor der letzten {count} Woche", other: "vor den letzten {count} Wochen" },
|
|
636
|
+
month: { one: "vor dem letzten {count} Monat", other: "vor den letzten {count} Monaten" },
|
|
637
|
+
quarter: { one: "vor dem letzten {count} Quartal", other: "vor den letzten {count} Quartalen" },
|
|
638
|
+
year: { one: "vor dem letzten {count} Jahr", other: "vor den letzten {count} Jahren" }
|
|
639
|
+
},
|
|
640
|
+
this: { hour: "diese Stunde", day: "heute", week: "diese Woche", month: "dieser Monat", quarter: "dieses Quartal", year: "dieses Jahr" },
|
|
641
|
+
rolling: "{text}, gleitend",
|
|
642
|
+
withoutCurrent: "{text}, ohne den laufenden Zeitraum",
|
|
643
|
+
fromLatest: "{text}, gez\xE4hlt ab dem letzten Datensatz",
|
|
644
|
+
fromFirst: "{text}, gez\xE4hlt ab dem ersten Datensatz",
|
|
645
|
+
fromDate: "{text}, gez\xE4hlt ab {date}",
|
|
646
|
+
until: "bis {to}"
|
|
647
|
+
},
|
|
661
648
|
withShare: "{text} ({range}; {missing})",
|
|
662
649
|
noData: { one: "{range} hat keine Daten", other: "{range} haben keine Daten" },
|
|
663
650
|
compareShort: { "=": "{value}", "!=": "nicht {value}", ">": "nach {value}", ">=": "ab {value}", "<": "vor {value}", "<=": "bis {value}", between: "{from} bis {to}", notBetween: "nicht {from} bis {to}" },
|
|
@@ -4,12 +4,16 @@ var de = {
|
|
|
4
4
|
settingInfo: {
|
|
5
5
|
grandTotalRow: "Eine letzte Zeile mit der Summe jeder Spalte.",
|
|
6
6
|
grandTotalColumn: "Eine letzte Spalte mit der Summe jeder Zeile.",
|
|
7
|
-
rowSubtotals: "Mit zwei oder mehr Feldern in Zeilen: eine
|
|
8
|
-
colSubtotals: "Mit zwei oder mehr Feldern in Spalten: eine
|
|
7
|
+
rowSubtotals: "Mit zwei oder mehr Feldern in Zeilen: eine Zeile mit dem Teilergebnis (\u201ENord gesamt\u201C) unter jeder Gruppe des \xE4u\xDFeren Felds, die mehr als einen Eintrag hat.",
|
|
8
|
+
colSubtotals: "Mit zwei oder mehr Feldern in Spalten: eine Spalte mit dem Teilergebnis (\u201ENord gesamt\u201C) nach jeder Gruppe des \xE4u\xDFeren Felds, die mehr als einen Eintrag hat.",
|
|
9
9
|
along: "Die Richtung der Berechnung: Zeilen geht die Zeilen jeder Spalte hinunter, Spalten \xFCber die Spalten jeder Zeile. Eine laufende Summe addiert entlang, eine Differenz vergleicht mit dem Eintrag davor.",
|
|
10
10
|
showAs: "Zeigt jeden Wert als Anteil, Differenz, laufende Summe oder Rang statt der Zahl selbst. Bei Prozenten sagt ein Tipp \xFCber dem Ergebnis, was 100 % ist.",
|
|
11
11
|
exportXlsx: "Jede Zahl mit allen Nachkommastellen, Formate bleiben, bereit zum Rechnen.",
|
|
12
|
-
exportCsv: "
|
|
12
|
+
exportCsv: "Die Tabelle wie angezeigt, mit ihren Summen und Prozenten, als reiner Text. Nicht die Zeilen dahinter: Das sind die Quelldaten, unten.",
|
|
13
|
+
exportHtml: "Eine Seite mit der Tabelle wie angezeigt, dem Diagramm, wenn es angezeigt wird, und den Filtern: \xF6ffnet in jedem Browser, druckt gut.",
|
|
14
|
+
exportPrint: "Derselbe Bericht im Druckdialog des Browsers: drucken oder dort Als PDF speichern w\xE4hlen.",
|
|
15
|
+
exportDataCsv: "Alle urspr\xFCnglichen Zeilen hinter dem Bericht, vor Gruppierung, Filtern und Summen, mit jedem Feld. F\xFCr eigene Auswertungen oder um den Bericht mit seiner Ansicht (Ansichten \u2192 Ansicht herunterladen) anderswo neu zu erstellen. In Excel mit Dezimalkomma: \xFCber Daten \u2192 Aus Text/CSV \xF6ffnen.",
|
|
16
|
+
exportDataJson: "Dieselben Zeilen als JSON, f\xFCr ein Programm: Zahlen als Zahlen, Text als Text, ein leerer Wert als null.",
|
|
13
17
|
copyTable: "Die Tabelle wie angezeigt, mit \xDCberschriften und Summen: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt.",
|
|
14
18
|
copyDataJson: "Die Zahlen der Tabelle mit ihren Beschriftungen als JSON, f\xFCr ein Programm. Nicht die Ansicht selbst: Das ist Ansichten \u2192 Ansicht als JSON kopieren.",
|
|
15
19
|
drillCopy: "Die Zeilen wie im Bereich angezeigt, mit einer \xDCberschriftenzeile: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt.",
|
|
@@ -79,13 +83,22 @@ var de = {
|
|
|
79
83
|
range: { one: "Bereich", other: "Bereiche" }
|
|
80
84
|
},
|
|
81
85
|
quickTitle: "Schnellauswahl",
|
|
82
|
-
quickCount: { year: "Anzahl Jahre", month: "Anzahl Monate", day: "Anzahl Tage" },
|
|
83
|
-
quickLast: { year: { one: "Letztes {count} Jahr", other: "Letzte {count} Jahre" }, month: { one: "Letzter {count} Monat", other: "Letzte {count} Monate" }, day: { one: "Letzter {count} Tag", other: "Letzte {count} Tage" } },
|
|
86
|
+
quickCount: { year: "Anzahl Jahre", quarter: "Anzahl Quartale", month: "Anzahl Monate", week: "Anzahl Wochen", day: "Anzahl Tage" },
|
|
84
87
|
quickRows: "{rows} Zeilen",
|
|
85
88
|
quickHidden: { one: "{choices} wird nicht angeboten: die Daten enden am {latest}.", other: "{choices} werden nicht angeboten: die Daten enden am {latest}." },
|
|
89
|
+
quickCurrent: { year: "Das laufende Jahr einbeziehen", quarter: "Das laufende Quartal einbeziehen", month: "Den laufenden Monat einbeziehen", week: "Die laufende Woche einbeziehen", day: "Heute einbeziehen" },
|
|
90
|
+
quickMore: "Weitere Auswahl",
|
|
91
|
+
quickRolling: "Gleitend statt ganzer Kalenderzeitr\xE4ume",
|
|
92
|
+
quickUnitOf: "Einheit von \u201E{choice} \u2026\u201C",
|
|
93
|
+
quickThisUnit: "Laufender Zeitraum",
|
|
86
94
|
anchorLabel: "Gez\xE4hlt ab",
|
|
87
95
|
anchorToday: "heute ({date})",
|
|
88
96
|
anchorLatest: "dem letzten Datensatz ({date})",
|
|
97
|
+
anchorFirst: "dem ersten Datensatz ({date})",
|
|
98
|
+
anchorDate: "einem Datum \u2026",
|
|
99
|
+
anchorDay: "Das Datum, ab dem gez\xE4hlt wird",
|
|
100
|
+
anchorDayIncomplete: "Bitte ein vollst\xE4ndiges Datum eingeben; bis dahin wird ab dem {date} gez\xE4hlt.",
|
|
101
|
+
anchorUseLatest: "Stattdessen ab dem letzten Datensatz ({date}) z\xE4hlen",
|
|
89
102
|
quickLine: "Schnellauswahl: {text}",
|
|
90
103
|
changeAbove: "oben \xE4ndern",
|
|
91
104
|
yearsCombined: "Jahre zusammengefasst",
|
|
@@ -136,7 +149,9 @@ var de = {
|
|
|
136
149
|
lastOp: { one: "im letzten", other: "in den letzten" },
|
|
137
150
|
ruleUnits: { year: { one: "Jahr", other: "Jahren" }, month: { one: "Monat", other: "Monaten" }, day: { one: "Tag", other: "Tagen" } },
|
|
138
151
|
ruleWhose: "Eintr\xE4ge von {field} mit Gesamtwert",
|
|
152
|
+
ruleFixed: "So behalten, wie die Ansicht ihn hat; die Regeln hier k\xF6nnen ihn noch nicht \xE4ndern.",
|
|
139
153
|
blanksOut: "Leere Eintr\xE4ge werden nicht behalten.",
|
|
154
|
+
rulesBlanks: { one: "Auch Eintr\xE4ge ohne Wert behalten ({rows} Zeile)", other: "Auch Eintr\xE4ge ohne Wert behalten ({rows} Zeilen)" },
|
|
140
155
|
ruleUnit: "Einheit",
|
|
141
156
|
moveLeft: "Nach links",
|
|
142
157
|
moveRight: "Nach rechts",
|
|
@@ -154,6 +169,7 @@ var de = {
|
|
|
154
169
|
storeTooLarge: "die Ansichten br\xE4uchten mehr als {max} Zeichen",
|
|
155
170
|
storeRefused: "dieser Browser hat sie nicht behalten (Speicher gesperrt oder voll)",
|
|
156
171
|
storeChanged: "die Ansichten wurden in einem anderen Tab ge\xE4ndert; das Men\xFC neu \xF6ffnen",
|
|
172
|
+
viewSheet: "Blatt \u201E{sheet}\u201C",
|
|
157
173
|
toastSaved: "Ansicht \u201E{name}\u201C gespeichert",
|
|
158
174
|
toastDeleted: "Ansicht \u201E{name}\u201C gel\xF6scht",
|
|
159
175
|
toastPublished: "Ansicht \u201E{name}\u201C ver\xF6ffentlicht",
|
|
@@ -245,6 +261,9 @@ var de = {
|
|
|
245
261
|
topCount: "Anzahl",
|
|
246
262
|
bottom: "Unterste",
|
|
247
263
|
topBy: "nach",
|
|
264
|
+
topTies: "Auch Eintr\xE4ge mit demselben Wert wie der letzte zeigen",
|
|
265
|
+
topShown: { one: "{count} Eintrag angezeigt", other: "{count} Eintr\xE4ge angezeigt" },
|
|
266
|
+
topTiesGroups: "Eine Gruppe kann mehr als {count} Eintr\xE4ge zeigen.",
|
|
248
267
|
searchValues: "Werte suchen",
|
|
249
268
|
selectAll: "Alle ausw\xE4hlen",
|
|
250
269
|
selectNone: "Keine ausw\xE4hlen",
|
|
@@ -257,15 +276,23 @@ var de = {
|
|
|
257
276
|
exportDownload: "Herunterladen",
|
|
258
277
|
exportCopy: "Kopieren",
|
|
259
278
|
exportXlsx: "Excel-Arbeitsmappe (.xlsx)",
|
|
260
|
-
exportCsv: "CSV
|
|
279
|
+
exportCsv: "Tabelle als CSV (.csv)",
|
|
261
280
|
exportPng: "Diagramm als Bild (.png)",
|
|
281
|
+
exportSvg: "Diagramm als Bild (.svg)",
|
|
282
|
+
exportHtml: "HTML-Bericht (.html)",
|
|
283
|
+
exportPrintGroup: "Drucken",
|
|
284
|
+
exportPrint: "Drucken oder als PDF speichern\u2026",
|
|
262
285
|
exportPngNeedsChart: "Zuerst zum Diagramm wechseln.",
|
|
263
286
|
exportNeedsField: "Zuerst ein Feld hinzuf\xFCgen.",
|
|
287
|
+
exportDataGroup: "Quelldaten",
|
|
288
|
+
exportDataCsv: "Alle Zeilen als CSV (.csv)",
|
|
289
|
+
exportDataJson: "Alle Zeilen als JSON (.json)",
|
|
264
290
|
copyTable: "Tabelle kopieren",
|
|
265
291
|
copyDataJson: "Daten als JSON kopieren",
|
|
266
292
|
toastTableCopied: "Tabelle kopiert: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt",
|
|
267
293
|
toastDataCopied: "Daten als JSON kopiert",
|
|
268
294
|
toastCopyBlocked: "Diese Seite erlaubt kein Kopieren. Stattdessen eine Datei herunterladen.",
|
|
295
|
+
toastPrintBlocked: "Diese Seite erlaubt das Drucken des Berichts nicht. Stattdessen den HTML-Bericht herunterladen.",
|
|
269
296
|
drillTitle: "Zeilen hinter diesem Wert",
|
|
270
297
|
drillCount: { one: "{count} Zeile", other: "{count} Zeilen" },
|
|
271
298
|
drillShown: "Die ersten {shown} von {count} Zeilen",
|
|
@@ -342,6 +369,7 @@ var de = {
|
|
|
342
369
|
needsColField: "Braucht ein Feld in Spalten.",
|
|
343
370
|
needsRowFields: "Braucht zwei oder mehr Felder in Zeilen.",
|
|
344
371
|
needsColFields: "Braucht zwei oder mehr Felder in Spalten.",
|
|
372
|
+
needsValue: "Braucht ein Feld in Werten.",
|
|
345
373
|
expandNothing: "Nichts ist zugeklappt.",
|
|
346
374
|
collapseNeedsRows: "Braucht zwei oder mehr Felder in Zeilen.",
|
|
347
375
|
collapseAllDone: "Alle Gruppen sind schon zugeklappt.",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/report-run.js
|
|
2
|
+
import { use as register } from "echarts/core";
|
|
3
|
+
import { SVGRenderer } from "echarts/renderers";
|
|
4
|
+
import { LIGHT_TOKENS, SHAPE_TOKENS, SIZE_TOKENS, WEIGHT_TOKENS, render } from "pivotkit-report";
|
|
5
|
+
register([SVGRenderer]);
|
|
6
|
+
var REPORT_TOKENS = Object.freeze([...Object.keys(WEIGHT_TOKENS), ...Object.keys(SHAPE_TOKENS), ...Object.keys(LIGHT_TOKENS), "--pk-scale-mid"]);
|
|
7
|
+
var REPORT_LENGTHS = Object.freeze(Object.keys(SIZE_TOKENS));
|
|
8
|
+
export {
|
|
9
|
+
REPORT_LENGTHS,
|
|
10
|
+
REPORT_TOKENS,
|
|
11
|
+
render
|
|
12
|
+
};
|
package/dist/echarts.js
CHANGED
|
@@ -116,6 +116,9 @@ function mergeChartOptions(base, over) {
|
|
|
116
116
|
return over;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// src/chart-decorate.js
|
|
120
|
+
import { decorateOption } from "pivotkit-core/chart";
|
|
121
|
+
|
|
119
122
|
// src/chart-tooltip.js
|
|
120
123
|
function tooltipContent(params, { valueFormatter = (v) => String(v ?? ""), xNames = [], yNames = [], categoryNames = [] } = {}) {
|
|
121
124
|
const color = (p) => typeof p.color === "string" ? p.color : null;
|
|
@@ -146,7 +149,7 @@ function tooltipFormatter(doc, options) {
|
|
|
146
149
|
if (title) {
|
|
147
150
|
const head = doc.createElement("div");
|
|
148
151
|
head.textContent = title;
|
|
149
|
-
head.style.fontWeight = "
|
|
152
|
+
head.style.fontWeight = "var(--pk-weight-strong)";
|
|
150
153
|
head.style.marginBottom = "2px";
|
|
151
154
|
box.append(head);
|
|
152
155
|
}
|
|
@@ -169,7 +172,7 @@ function tooltipFormatter(doc, options) {
|
|
|
169
172
|
name.style.flex = "1";
|
|
170
173
|
const value = doc.createElement("span");
|
|
171
174
|
value.textContent = line.value;
|
|
172
|
-
value.style.fontWeight = "
|
|
175
|
+
value.style.fontWeight = "var(--pk-weight-strong)";
|
|
173
176
|
value.style.marginLeft = "12px";
|
|
174
177
|
row.append(marker, name, value);
|
|
175
178
|
box.append(row);
|
|
@@ -178,170 +181,49 @@ function tooltipFormatter(doc, options) {
|
|
|
178
181
|
};
|
|
179
182
|
}
|
|
180
183
|
|
|
181
|
-
// src/chart-layout.js
|
|
182
|
-
function pieLabelRoom(height) {
|
|
183
|
-
return Math.round(Math.min(24, Math.max(0, height) * 0.05));
|
|
184
|
-
}
|
|
185
|
-
var RIGHT_LEGEND_MIN_WIDTH = 480;
|
|
186
|
-
var BOTTOM_LEGEND_ROOM = 32;
|
|
187
|
-
var labelWidth = (text) => String(text).length * 7;
|
|
188
|
-
function ringLabelsFit(radius, box, texts) {
|
|
189
|
-
const half = Math.max(0, Math.min(box.width, box.height)) / 2;
|
|
190
|
-
const px = (r) => typeof r === "number" ? r : /%$/.test(String(r)) ? parseFloat(String(r)) / 100 * half : parseFloat(String(r)) || 0;
|
|
191
|
-
const inner = px(radius[0]);
|
|
192
|
-
if (inner <= 0) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
const ring = px(radius[1]) - inner;
|
|
196
|
-
return texts.every((t) => labelWidth(t) + 6 <= ring);
|
|
197
|
-
}
|
|
198
|
-
var SLANTED_LABEL_WIDTH = 120;
|
|
199
|
-
var HEATMAP_FRAME = { x: 80, y: 120 };
|
|
200
|
-
var LABEL_LINE = 16;
|
|
201
|
-
var LABEL_PAD = 4;
|
|
202
|
-
function columnLabelLayout(names, width, fontSize = 12) {
|
|
203
|
-
if (names.length === 0) {
|
|
204
|
-
return { rotate: 0 };
|
|
205
|
-
}
|
|
206
|
-
const slot = Math.max(0, width - HEATMAP_FRAME.x) / names.length;
|
|
207
|
-
const longest = Math.max(...names.map((n) => String(n).length)) * fontSize * 0.55;
|
|
208
|
-
return longest <= slot ? { rotate: 0 } : { rotate: 45, width: SLANTED_LABEL_WIDTH, overflow: "truncate" };
|
|
209
|
-
}
|
|
210
|
-
function heatmapCellLabels(columns, rows, width, height, texts, fontSize = 12) {
|
|
211
|
-
const w = Math.max(0, width - HEATMAP_FRAME.x) / Math.max(1, columns);
|
|
212
|
-
const h = Math.max(0, height - HEATMAP_FRAME.y) / Math.max(1, rows);
|
|
213
|
-
const longest = texts.reduce((m, t) => Math.max(m, String(t).length), 0) * fontSize * 0.55;
|
|
214
|
-
return w >= longest + 2 * LABEL_PAD && h >= LABEL_LINE;
|
|
215
|
-
}
|
|
216
|
-
function rowLabelInterval(rows, height) {
|
|
217
|
-
const h = Math.max(0, height - HEATMAP_FRAME.y) / Math.max(1, rows);
|
|
218
|
-
return h >= LABEL_LINE ? 0 : Math.ceil(LABEL_LINE / Math.max(h, 0.1)) - 1;
|
|
219
|
-
}
|
|
220
|
-
var CATEGORY_LABEL_WIDTH = 120;
|
|
221
|
-
var AXIS_FRAME = { x: 80, y: 60 };
|
|
222
|
-
function categoryLabelLayout(names, { width, height, horizontal = false, mode = "auto", fontSize = 12 }) {
|
|
223
|
-
const n = Math.max(1, names.length);
|
|
224
|
-
const cut = { width: CATEGORY_LABEL_WIDTH, overflow: (
|
|
225
|
-
/** @type {const} */
|
|
226
|
-
"truncate"
|
|
227
|
-
) };
|
|
228
|
-
const every = (slot2, need) => Math.max(1, Math.ceil(need / Math.max(slot2, 0.1)));
|
|
229
|
-
const result = (rotate, step) => ({ rotate, interval: step - 1, every: step, ...cut });
|
|
230
|
-
if (horizontal) {
|
|
231
|
-
const slot2 = Math.max(0, height - AXIS_FRAME.y) / n;
|
|
232
|
-
return result(0, mode === "all" ? 1 : every(slot2, fontSize + 1));
|
|
233
|
-
}
|
|
234
|
-
const slot = Math.max(0, width - AXIS_FRAME.x) / n;
|
|
235
|
-
const longest = Math.min(CATEGORY_LABEL_WIDTH, Math.max(0, ...names.map((t) => String(t).length)) * fontSize * 0.55);
|
|
236
|
-
if (mode === "nth") {
|
|
237
|
-
return result(0, every(slot, longest + 8));
|
|
238
|
-
}
|
|
239
|
-
if (longest + 8 <= slot) {
|
|
240
|
-
return result(0, 1);
|
|
241
|
-
}
|
|
242
|
-
return result(45, mode === "all" ? 1 : every(slot, LABEL_LINE));
|
|
243
|
-
}
|
|
244
|
-
var GROUP_LABEL_ROOM = Object.freeze({ along: 56, across: 28, width: 420, height: 260 });
|
|
245
|
-
function groupLabelsFit(count, groupSize, { width, height, horizontal = false }) {
|
|
246
|
-
if (width < GROUP_LABEL_ROOM.width || height < GROUP_LABEL_ROOM.height) {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
const n = Math.max(1, count);
|
|
250
|
-
const slot = horizontal ? Math.max(0, height - AXIS_FRAME.y) / n : Math.max(0, width - AXIS_FRAME.x) / n;
|
|
251
|
-
return slot * Math.max(1, groupSize) >= (horizontal ? GROUP_LABEL_ROOM.across : GROUP_LABEL_ROOM.along);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
184
|
// src/chart-decorate.js
|
|
255
|
-
var without = (obj, keys) => Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k)));
|
|
256
185
|
function decorate(option, style, height = 480, doc = void 0, width = 800, extra = {}) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
186
|
+
return decorateOption(option, style, { height, width, ...extra, tooltipFormatter: doc ? (context) => tooltipFormatter(doc, context) : void 0 });
|
|
187
|
+
}
|
|
188
|
+
var LENGTH_TOKENS = Object.freeze(["--pk-chart-title-size", "--pk-chart-text-size", "--pk-radius-chart"]);
|
|
189
|
+
function tokenLengths(root, names = LENGTH_TOKENS) {
|
|
190
|
+
const view = root.ownerDocument.defaultView;
|
|
191
|
+
const style = view?.getComputedStyle(root);
|
|
192
|
+
const lengthy = (value) => Boolean(value) && (typeof CSS === "undefined" || CSS.supports("margin-left", value));
|
|
193
|
+
const set = style ? names.filter((name) => lengthy(style.getPropertyValue(name).trim())) : [];
|
|
194
|
+
if (!view || !set.length) {
|
|
195
|
+
return {};
|
|
268
196
|
}
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
if (s.type === "line") {
|
|
285
|
-
return { ...s, lineStyle: { width: 2 }, symbolSize: 7, smooth: Boolean(s.smooth), areaStyle: s.areaStyle ? { opacity: 0.18 } : void 0, emphasis: { focus: "series" } };
|
|
286
|
-
}
|
|
287
|
-
if (s.type === "pie") {
|
|
288
|
-
const room = pieLabelRoom(height);
|
|
289
|
-
const top = (typeof s.top === "number" ? s.top : 0) + room;
|
|
290
|
-
const bottom = (typeof s.bottom === "number" ? s.bottom : 0) + room;
|
|
291
|
-
let label = s.label;
|
|
292
|
-
let line = s.labelLine;
|
|
293
|
-
if (label?.position === "inside" && label.show !== false && Array.isArray(s.radius)) {
|
|
294
|
-
const box = { width: width - (typeof s.right === "number" ? s.right : 0), height: height - top - bottom };
|
|
295
|
-
const total = (s.data || []).reduce((sum, d) => sum + (typeof d.value === "number" ? d.value : 0), 0);
|
|
296
|
-
const texts = typeof label.formatter === "function" ? (s.data || []).map((d) => label.formatter({ name: d.name, value: d.value, percent: total ? d.value / total * 100 : 0 })) : [];
|
|
297
|
-
if (!ringLabelsFit(s.radius, box, texts)) {
|
|
298
|
-
label = without(label, ["position"]);
|
|
299
|
-
line = { show: true };
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return { ...s, top, bottom, labelLine: line, itemStyle: { borderColor: surface, borderWidth: 2, borderRadius: 4 }, label: { ...label, color: label?.position === "inside" ? void 0 : v("--pk-text") || void 0 } };
|
|
303
|
-
}
|
|
304
|
-
if (s.type === "heatmap") {
|
|
305
|
-
const texts = typeof s.label?.formatter === "function" ? s.data.map((d) => s.label.formatter({ value: d })) : [];
|
|
306
|
-
const fits = heatmapCellLabels(option.xAxis?.data?.length ?? 1, option.yAxis?.data?.length ?? 1, width, height, texts);
|
|
307
|
-
return { ...s, itemStyle: { borderColor: surface, borderWidth: 2, borderRadius: 3 }, label: { ...s.label, show: Boolean(s.label?.show) && fits, color: v("--pk-text") || void 0 } };
|
|
308
|
-
}
|
|
309
|
-
return s;
|
|
310
|
-
});
|
|
311
|
-
const legend = option.legend ? { ...option.legend, icon: "roundRect", itemWidth: 12, itemHeight: 12, textStyle: { ...option.legend.textStyle, color: v("--pk-text") || void 0 } } : void 0;
|
|
312
|
-
const grid = option.grid ? { left: 12, right: 24, bottom: option.visualMap ? 64 : 12, containLabel: true, ...option.grid } : void 0;
|
|
313
|
-
const heatmap = series.some((s) => s.type === "heatmap") && option.xAxis?.axisLabel;
|
|
314
|
-
const xAxis = heatmap ? { ...option.xAxis, axisLabel: { ...option.xAxis.axisLabel, ...columnLabelLayout(option.xAxis.data ?? [], width) } } : option.xAxis;
|
|
315
|
-
const yAxis = heatmap && option.yAxis ? { ...option.yAxis, axisLabel: { ...option.yAxis.axisLabel, interval: rowLabelInterval(option.yAxis.data?.length ?? 0, height) } } : option.yAxis;
|
|
316
|
-
const title = option.title ? { title: { ...option.title, textStyle: { ...option.title.textStyle, width: Math.max(40, width - 32), overflow: "truncate" } } } : {};
|
|
317
|
-
let axes = { xAxis, yAxis };
|
|
318
|
-
let axisEvery = 1;
|
|
319
|
-
const along = !heatmap && series.some((s) => s.type === "bar" || s.type === "line") ? first(option.yAxis)?.type === "category" ? "yAxis" : first(option.xAxis)?.type === "category" ? "xAxis" : null : null;
|
|
320
|
-
if (along) {
|
|
321
|
-
let list = Array.isArray(axes[along]) ? axes[along] : [axes[along]];
|
|
322
|
-
const group = list[1]?.groups ? list[1] : null;
|
|
323
|
-
if (group && group.groupsAuto && !groupLabelsFit(list[0].data?.length ?? 0, group.groupSize ?? 1, { width, height, horizontal: along === "yAxis" })) {
|
|
324
|
-
list = [{ ...list[0], data: extra.categoryNames ?? list[0].data }];
|
|
325
|
-
}
|
|
326
|
-
const names = list[0].data ?? [];
|
|
327
|
-
const layout = categoryLabelLayout(names, { width, height, horizontal: along === "yAxis", mode: extra.axisLabels });
|
|
328
|
-
axisEvery = layout.every;
|
|
329
|
-
const longest = Math.min(CATEGORY_LABEL_WIDTH, Math.max(0, ...names.map((t) => String(t).length)) * 12 * 0.55);
|
|
330
|
-
const offset = along === "yAxis" ? Math.round(longest) + 16 : layout.rotate ? Math.round(longest * 0.71) + 14 : 24;
|
|
331
|
-
const main = { ...list[0], axisLabel: { ...list[0].axisLabel, rotate: layout.rotate, interval: layout.interval, width: layout.width, overflow: layout.overflow } };
|
|
332
|
-
const slot = (along === "yAxis" ? Math.max(0, height - 60) : Math.max(0, width - 80)) / Math.max(1, names.length);
|
|
333
|
-
const groupWidth = along === "yAxis" ? CATEGORY_LABEL_WIDTH : Math.max(24, Math.round(slot * (list[1]?.groupSize ?? 1)) - 8);
|
|
334
|
-
const rest = list.slice(1).map((a) => a.groups ? { ...a, offset, axisTick: { ...a.axisTick, length: offset }, axisLabel: { ...a.axisLabel, width: groupWidth, overflow: "truncate" } } : a);
|
|
335
|
-
axes = { ...axes, [along]: rest.length ? [main, ...rest] : main };
|
|
197
|
+
const probe = root.ownerDocument.createElement("span");
|
|
198
|
+
probe.setAttribute("aria-hidden", "true");
|
|
199
|
+
probe.style.setProperty("position", "absolute");
|
|
200
|
+
probe.style.setProperty("visibility", "hidden");
|
|
201
|
+
root.append(probe);
|
|
202
|
+
try {
|
|
203
|
+
return Object.fromEntries(
|
|
204
|
+
set.map((name) => {
|
|
205
|
+
probe.style.setProperty("margin-left", `var(${name})`);
|
|
206
|
+
return [name, view.getComputedStyle(probe).marginLeft];
|
|
207
|
+
}).filter(([, value]) => /px$/.test(value))
|
|
208
|
+
);
|
|
209
|
+
} finally {
|
|
210
|
+
probe.remove();
|
|
336
211
|
}
|
|
337
|
-
|
|
212
|
+
}
|
|
213
|
+
function chartStyle(root) {
|
|
214
|
+
const style = getComputedStyle(root);
|
|
215
|
+
const lengths = tokenLengths(root);
|
|
216
|
+
return { getPropertyValue: (name) => lengths[name] ?? style.getPropertyValue(name) };
|
|
338
217
|
}
|
|
339
218
|
|
|
340
219
|
// src/echarts.js
|
|
341
220
|
register([BarChart, LineChart, PieChart, HeatmapChart, GridComponent, TooltipComponent, LegendComponent, TitleComponent, VisualMapComponent, CanvasRenderer]);
|
|
342
221
|
export {
|
|
222
|
+
LENGTH_TOKENS,
|
|
223
|
+
chartStyle,
|
|
343
224
|
cleanChartOptions,
|
|
344
225
|
decorate,
|
|
345
226
|
init,
|
|
346
|
-
mergeChartOptions
|
|
227
|
+
mergeChartOptions,
|
|
228
|
+
tokenLengths
|
|
347
229
|
};
|