react-semaphor 0.1.602 → 0.1.604
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/dist/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1451
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4491
- package/dist/format-utils/index.js +1 -424
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +1 -88
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +6 -2
- package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
- package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
- package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
- package/dist/chunks/context-BJoEFgNl.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
- package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
- package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-BXT6y303.js +0 -703
- package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
- package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-BW0yozjs.js +0 -2795
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
- package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
- package/dist/chunks/palette-CuA0HlzF.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
- package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
- package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-BKHlDONy.js +0 -21
- package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
- package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
- package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
- package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
- package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
- package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
- package/dist/chunks/token-types-D_xKgyVS.js +0 -8
- package/dist/chunks/upload-Dll_M7XQ.js +0 -15
- package/dist/chunks/validators-ClWHpYql.js +0 -3686
- package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { c as v, g as M, a as A, b as q, d as N, e as y, h as D, j as w } from "./resolve-dashboard-input-context-CULCE_hM.js";
|
|
2
|
-
import { d as E } from "./validators-ClWHpYql.js";
|
|
3
|
-
import { g as L, m as x } from "./matrix-analytical-definition-CgQgVeeI.js";
|
|
4
|
-
const O = [
|
|
5
|
-
{
|
|
6
|
-
value: "only",
|
|
7
|
-
label: "The only value",
|
|
8
|
-
hint: "Shows the value when exactly one matches. When more than one matches, readers see nothing."
|
|
9
|
-
},
|
|
10
|
-
{ value: "first", label: "First by…", hint: "Shows the first value by the order you choose." },
|
|
11
|
-
{ value: "list", label: "List", hint: "Shows the distinct values in order, joined with a separator." }
|
|
12
|
-
], k = {
|
|
13
|
-
SUM: { number: "Total", date: "Total", other: "Total" },
|
|
14
|
-
AVG: { number: "Average", date: "Average", other: "Average" },
|
|
15
|
-
MIN: { number: "Lowest", date: "Earliest", other: "Min" },
|
|
16
|
-
MAX: { number: "Highest", date: "Latest", other: "Max" },
|
|
17
|
-
MEDIAN: { number: "Median", date: "Median", other: "Median" },
|
|
18
|
-
COUNT: { number: "Count", date: "Count", other: "Count" },
|
|
19
|
-
DISTINCT: { number: "Count distinct", date: "Count distinct", other: "Count distinct" }
|
|
20
|
-
};
|
|
21
|
-
function h(e) {
|
|
22
|
-
return E(e) === "aggregate";
|
|
23
|
-
}
|
|
24
|
-
function X(e) {
|
|
25
|
-
const t = e == null ? void 0 : e.dataType;
|
|
26
|
-
if (h(e))
|
|
27
|
-
return [
|
|
28
|
-
{ value: "calculation", label: "The calculation’s value", hint: "Shows the calculation over the rows the filters keep; it aggregates itself." }
|
|
29
|
-
];
|
|
30
|
-
const a = y(t), i = a === "number" ? "number" : a === "date" ? "date" : "other", o = [...D(t)];
|
|
31
|
-
return i === "date" && o.push({ value: "MIN", label: "Min" }, { value: "MAX", label: "Max" }), [
|
|
32
|
-
...O,
|
|
33
|
-
...o.map(({ value: l }) => {
|
|
34
|
-
var n, r;
|
|
35
|
-
return {
|
|
36
|
-
value: l,
|
|
37
|
-
label: ((n = k[l]) == null ? void 0 : n[i]) ?? l,
|
|
38
|
-
hint: `Shows the ${(((r = k[l]) == null ? void 0 : r[i]) ?? l).toLowerCase()} of the rows the filters keep.`
|
|
39
|
-
};
|
|
40
|
-
})
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
function H(e) {
|
|
44
|
-
return h(e) ? "calculation" : y(e.dataType) === "number" ? w(y(e.dataType)) : "only";
|
|
45
|
-
}
|
|
46
|
-
function b(e) {
|
|
47
|
-
return e !== "only" && e !== "first" && e !== "list";
|
|
48
|
-
}
|
|
49
|
-
function B(e) {
|
|
50
|
-
return e.mode !== "data" || !e.field || !b(e.get) ? !1 : e.get === "COUNT" || e.get === "DISTINCT" ? !0 : y(e.field.dataType) === "number";
|
|
51
|
-
}
|
|
52
|
-
function G() {
|
|
53
|
-
var e, t;
|
|
54
|
-
return ((t = (e = globalThis.crypto) == null ? void 0 : e.randomUUID) == null ? void 0 : t.call(e).replace(/-/g, "").slice(0, 10)) ?? Math.random().toString(36).slice(2, 12);
|
|
55
|
-
}
|
|
56
|
-
function V() {
|
|
57
|
-
return `var_${G()}`;
|
|
58
|
-
}
|
|
59
|
-
function z() {
|
|
60
|
-
return { id: V(), name: "", mode: "data", sql: "", get: "only", sortDirection: "asc" };
|
|
61
|
-
}
|
|
62
|
-
const _ = {
|
|
63
|
-
id: "catalog",
|
|
64
|
-
name: "catalog",
|
|
65
|
-
label: "catalog",
|
|
66
|
-
derivedLabel: "catalog",
|
|
67
|
-
alias: "catalog",
|
|
68
|
-
sourceField: "catalog",
|
|
69
|
-
source: "catalog",
|
|
70
|
-
qualifiedFieldName: "catalog",
|
|
71
|
-
dataType: "catalog",
|
|
72
|
-
nativeDataType: "catalog",
|
|
73
|
-
description: "catalog",
|
|
74
|
-
qualifiedEntityName: "catalog",
|
|
75
|
-
dateFormat: "catalog",
|
|
76
|
-
customFormat: "catalog",
|
|
77
|
-
granularity: "catalog",
|
|
78
|
-
entityId: "catalog",
|
|
79
|
-
entityName: "catalog",
|
|
80
|
-
entityType: "catalog",
|
|
81
|
-
expression: "catalog",
|
|
82
|
-
calculatedFormula: "catalog",
|
|
83
|
-
derivedField: "catalog",
|
|
84
|
-
format: "catalog",
|
|
85
|
-
semanticTemporalPresentation: "catalog",
|
|
86
|
-
calculationRepresentation: "catalog",
|
|
87
|
-
calculatedFieldOrigin: "catalog",
|
|
88
|
-
labelOrigin: "catalog",
|
|
89
|
-
formatOrigin: "catalog",
|
|
90
|
-
fieldScope: "catalog",
|
|
91
|
-
timeDrillPath: "catalog",
|
|
92
|
-
aliasTemplate: "catalog",
|
|
93
|
-
valueAliases: "catalog",
|
|
94
|
-
isPreAggregated: "catalog",
|
|
95
|
-
role: "shelf",
|
|
96
|
-
aggregate: "shelf",
|
|
97
|
-
aggregateOrigin: "shelf",
|
|
98
|
-
semanticAggregate: "shelf",
|
|
99
|
-
effectiveAggregate: "shelf",
|
|
100
|
-
aggregateSource: "shelf",
|
|
101
|
-
comparison: "shelf",
|
|
102
|
-
comparisonPolarity: "shelf",
|
|
103
|
-
semanticComparisonPolarity: "shelf",
|
|
104
|
-
parameters: "shelf",
|
|
105
|
-
direction: "shelf",
|
|
106
|
-
grainMode: "shelf"
|
|
107
|
-
// chart-date-grain DG-D1: a Group by's setting, never the catalog field's
|
|
108
|
-
};
|
|
109
|
-
function T(e) {
|
|
110
|
-
return Object.fromEntries(
|
|
111
|
-
Object.entries(e).filter(([t]) => _[t] !== "shelf")
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
function K(e) {
|
|
115
|
-
var g, u, m, d, p;
|
|
116
|
-
const { query: t, get: a } = e, i = t.config ?? {}, o = (g = i.metricColumns) == null ? void 0 : g[0], l = (u = i.groupByColumns) == null ? void 0 : u[0], n = (m = i.sortByColumns) == null ? void 0 : m[0], r = n ? T(o && n.id === o.id ? o : n) : void 0, s = (d = t.sql) != null && d.trim() ? t.sql : "";
|
|
117
|
-
return {
|
|
118
|
-
id: e.id,
|
|
119
|
-
name: e.name,
|
|
120
|
-
...e.label ? { label: e.label } : {},
|
|
121
|
-
mode: s ? "sql" : "data",
|
|
122
|
-
dataSource: t.dataSource,
|
|
123
|
-
connectionId: t.connectionId,
|
|
124
|
-
sql: s,
|
|
125
|
-
field: o && a.kind === "aggregate" ? T(o) : l ? T(l) : void 0,
|
|
126
|
-
get: a.kind === "aggregate" ? h(o) ? "calculation" : (o == null ? void 0 : o.aggregate) ?? "SUM" : a.kind,
|
|
127
|
-
sortField: r,
|
|
128
|
-
sortDirection: (n == null ? void 0 : n.direction) ?? "asc",
|
|
129
|
-
...a.kind === "list" ? { listLimit: a.limit, listSeparator: a.separator } : {},
|
|
130
|
-
conditions: i.filters ?? null,
|
|
131
|
-
calculatedFields: t.calculatedFields,
|
|
132
|
-
presentation: e.presentation,
|
|
133
|
-
emptyText: e.emptyText,
|
|
134
|
-
...a.kind === "aggregate" && ((p = o == null ? void 0 : o.comparison) == null ? void 0 : p.mode) === "explicit" ? { comparison: o.comparison } : {}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function P(e, t) {
|
|
138
|
-
var n;
|
|
139
|
-
const a = t.name.trim();
|
|
140
|
-
if (a) return a;
|
|
141
|
-
const i = (n = t.label) != null && n.trim() ? v(t.label) : t.field ? v(t.field.name || t.field.label) : t.mode === "sql" ? "sql_value" : "variable", o = new Set(
|
|
142
|
-
M(
|
|
143
|
-
e,
|
|
144
|
-
{ source: "dataVariable", variableId: t.id },
|
|
145
|
-
{ cardInputs: "taken" }
|
|
146
|
-
)
|
|
147
|
-
);
|
|
148
|
-
let l = i;
|
|
149
|
-
for (let r = 2; o.has(l); r += 1) l = `${i}_${r}`;
|
|
150
|
-
return l;
|
|
151
|
-
}
|
|
152
|
-
function Q(e, t) {
|
|
153
|
-
var g, u, m, d, p, f, F, I;
|
|
154
|
-
const a = P(t, e), i = {
|
|
155
|
-
id: e.id,
|
|
156
|
-
name: a,
|
|
157
|
-
...(g = e.label) != null && g.trim() ? { label: e.label.trim() } : {},
|
|
158
|
-
...e.presentation ? { presentation: e.presentation } : {},
|
|
159
|
-
...(u = e.emptyText) != null && u.trim() ? { emptyText: e.emptyText } : {}
|
|
160
|
-
};
|
|
161
|
-
if (e.mode === "sql")
|
|
162
|
-
return {
|
|
163
|
-
...i,
|
|
164
|
-
query: {
|
|
165
|
-
...e.connectionId ? { connectionId: e.connectionId } : {},
|
|
166
|
-
...e.dataSource ? { dataSource: e.dataSource } : {},
|
|
167
|
-
sql: e.sql
|
|
168
|
-
},
|
|
169
|
-
get: e.get === "first" ? { kind: "first" } : { kind: "only" }
|
|
170
|
-
};
|
|
171
|
-
const o = ((m = e.dataSource) == null ? void 0 : m.connectionId) || ((f = (p = (d = e.dataSource) == null ? void 0 : d.selectedEntities) == null ? void 0 : p[0]) == null ? void 0 : f.connectionId), l = {
|
|
172
|
-
...o ? { connectionId: o } : {},
|
|
173
|
-
...e.dataSource ? { dataSource: e.dataSource } : {},
|
|
174
|
-
...(F = e.calculatedFields) != null && F.length ? { calculatedFields: e.calculatedFields } : {},
|
|
175
|
-
config: {
|
|
176
|
-
...e.conditions ? { filters: e.conditions } : {}
|
|
177
|
-
}
|
|
178
|
-
}, n = l.config, r = e.field;
|
|
179
|
-
let s;
|
|
180
|
-
if (!r)
|
|
181
|
-
s = b(e.get) ? { kind: "aggregate" } : { kind: e.get };
|
|
182
|
-
else if (b(e.get)) {
|
|
183
|
-
const { comparison: S, ...c } = C(r, e.get);
|
|
184
|
-
n.metricColumns = [
|
|
185
|
-
((I = e.comparison) == null ? void 0 : I.mode) === "explicit" && e.comparison.spec.kind !== "target" && B(e) ? { ...c, comparison: e.comparison } : c
|
|
186
|
-
], s = { kind: "aggregate" };
|
|
187
|
-
} else if (h(r))
|
|
188
|
-
n.metricColumns = [C(r, "calculation")], s = { kind: "aggregate" };
|
|
189
|
-
else if (n.groupByColumns = [U(r)], e.get === "list" ? s = {
|
|
190
|
-
kind: "list",
|
|
191
|
-
...e.listLimit ? { limit: e.listLimit } : {},
|
|
192
|
-
...e.listSeparator !== void 0 && e.listSeparator !== ", " ? { separator: e.listSeparator } : {}
|
|
193
|
-
} : s = { kind: e.get }, e.get !== "only") {
|
|
194
|
-
const S = e.sortField ?? r;
|
|
195
|
-
if (j(S, r)) {
|
|
196
|
-
const c = n.groupByColumns[0];
|
|
197
|
-
n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
198
|
-
} else {
|
|
199
|
-
const c = C(S, e.sortDirection === "desc" ? "MAX" : "MIN");
|
|
200
|
-
n.metricColumns = [c], n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return { ...i, query: l, get: s };
|
|
204
|
-
}
|
|
205
|
-
function C(e, t) {
|
|
206
|
-
const a = A(e, "metrics", [], q("metrics", e));
|
|
207
|
-
return h(e) || t === "calculation" || !b(t) ? a : {
|
|
208
|
-
...a,
|
|
209
|
-
...x(a, t, "explicit"),
|
|
210
|
-
...L(a, N(e.name, t))
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
function U(e) {
|
|
214
|
-
const t = A(e, "groupBy", [], q("groupBy", e));
|
|
215
|
-
if (e.granularity || !("granularity" in t)) return t;
|
|
216
|
-
const { granularity: a, ...i } = t;
|
|
217
|
-
return i;
|
|
218
|
-
}
|
|
219
|
-
function j(e, t) {
|
|
220
|
-
return e.name === t.name && (e.qualifiedEntityName ?? e.entityName ?? "") === (t.qualifiedEntityName ?? t.entityName ?? "");
|
|
221
|
-
}
|
|
222
|
-
function Y(e) {
|
|
223
|
-
var t, a;
|
|
224
|
-
if (e.mode === "sql")
|
|
225
|
-
return e.connectionId ? e.sql.trim() ? void 0 : "Write the SQL that returns the value." : "Choose a connection.";
|
|
226
|
-
if (!((a = (t = e.dataSource) == null ? void 0 : t.selectedEntities) != null && a.length)) return "Choose a source.";
|
|
227
|
-
if (!e.field) return "Choose a field.";
|
|
228
|
-
}
|
|
229
|
-
export {
|
|
230
|
-
_ as S,
|
|
231
|
-
X as a,
|
|
232
|
-
K as b,
|
|
233
|
-
B as c,
|
|
234
|
-
H as d,
|
|
235
|
-
z as e,
|
|
236
|
-
P as f,
|
|
237
|
-
Y as g,
|
|
238
|
-
b as i,
|
|
239
|
-
V as n,
|
|
240
|
-
h as o,
|
|
241
|
-
Q as v
|
|
242
|
-
};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
const B = ["number", "line", "bar", "stackedBar", "table"], A = {
|
|
2
|
-
/** Fewest points on a line. */
|
|
3
|
-
lineMinPoints: 2,
|
|
4
|
-
/** Most measures on one line chart. */
|
|
5
|
-
lineMaxMeasures: 3,
|
|
6
|
-
/**
|
|
7
|
-
* Categories (or time points) on a bar chart. Up to `barDefaultMaxCategories`
|
|
8
|
-
* a category breakdown opens as bars; past it, up to `barMaxCategories`, it
|
|
9
|
-
* opens as a table with bars in the toggle and on request; past that, a
|
|
10
|
-
* table only.
|
|
11
|
-
*/
|
|
12
|
-
barMinCategories: 2,
|
|
13
|
-
barDefaultMaxCategories: 12,
|
|
14
|
-
barMaxCategories: 30,
|
|
15
|
-
/** Series a bar with series shows, at least and at most. */
|
|
16
|
-
seriesMin: 2,
|
|
17
|
-
seriesMax: 6
|
|
18
|
-
}, d = { kind: "table", encodings: {} }, M = {
|
|
19
|
-
number: "a single number",
|
|
20
|
-
line: "a line chart",
|
|
21
|
-
bar: "a bar chart",
|
|
22
|
-
stackedBar: "a stacked bar chart",
|
|
23
|
-
table: "a table"
|
|
24
|
-
};
|
|
25
|
-
function U(e, r) {
|
|
26
|
-
const { options: s, reason: n } = S(e), a = e.governed ? s : [...s.filter((c) => c.kind === "table"), ...s.filter((c) => c.kind !== "table")], o = a.map((c) => c.kind);
|
|
27
|
-
if (r === void 0)
|
|
28
|
-
return { ok: !0, visual: a[0], eligible: o, reason: e.governed ? n : `Advanced SQL opens as a table. ${n}` };
|
|
29
|
-
const t = a.find((c) => c.kind === r);
|
|
30
|
-
return t ? { ok: !0, visual: t, eligible: o, reason: n } : {
|
|
31
|
-
ok: !1,
|
|
32
|
-
code: "kind_not_eligible",
|
|
33
|
-
eligible: o,
|
|
34
|
-
message: `${D(M[r])} does not fit this result: ${L(n)}. It can be shown as ${o.map((c) => M[c]).join(" or ")}.`
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function S(e) {
|
|
38
|
-
const r = (i) => ({ options: [d], reason: i });
|
|
39
|
-
if (!e.complete) return r("Part of the question could not be answered");
|
|
40
|
-
if (e.truncated || e.records.length < e.rowCount) return r("The result has more rows than are kept");
|
|
41
|
-
if (e.records.length === 0) return r("The result has no rows");
|
|
42
|
-
const s = (i) => e.columns.filter((u) => I(u, e.governed) === i).map((u) => u.key), n = s("time"), a = s("dimension"), o = s("measure");
|
|
43
|
-
if (s("other").length) return r("A column cannot be charted");
|
|
44
|
-
if (o.length === 0) return r("The result has no measure");
|
|
45
|
-
if (!e.records.every((i) => o.every((u) => _(i[u]))))
|
|
46
|
-
return r("A measure has values that are not numbers");
|
|
47
|
-
const t = e.records.length, {
|
|
48
|
-
lineMinPoints: c,
|
|
49
|
-
lineMaxMeasures: f,
|
|
50
|
-
barMinCategories: l,
|
|
51
|
-
barDefaultMaxCategories: O,
|
|
52
|
-
barMaxCategories: h,
|
|
53
|
-
seriesMin: x,
|
|
54
|
-
seriesMax: p
|
|
55
|
-
} = A;
|
|
56
|
-
if (t === 1 && e.columns.length === 1)
|
|
57
|
-
return { options: [{ kind: "number", encodings: { y: o } }, d], reason: "One value" };
|
|
58
|
-
if (n.length === 1 && a.length === 0 && o.length <= f) {
|
|
59
|
-
if (t < c || !$(e.records, n)) return r("The time column does not form a series");
|
|
60
|
-
if (!T(e.records, n[0])) return r("The rows are not in time order");
|
|
61
|
-
const i = { x: n[0], y: o };
|
|
62
|
-
return {
|
|
63
|
-
options: [
|
|
64
|
-
{ kind: "line", encodings: i },
|
|
65
|
-
...t <= h ? [{ kind: "bar", encodings: i }] : [],
|
|
66
|
-
d
|
|
67
|
-
],
|
|
68
|
-
reason: `A time column and ${y(o.length, "measure")} over ${t} points`
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
if (a.length === 1 && n.length === 0 && o.length === 1) {
|
|
72
|
-
if (!$(e.records, a)) return r("A category value repeats");
|
|
73
|
-
if (t < l) return r(`One category with ${y(t, "value")}`);
|
|
74
|
-
if (t > h)
|
|
75
|
-
return r(`One category with ${t} values, more than a bar chart shows (${h})`);
|
|
76
|
-
const i = { kind: "bar", encodings: { x: a[0], y: o } };
|
|
77
|
-
return t <= O ? { options: [i, d], reason: `One category with ${y(t, "value")} and one measure` } : { options: [d, i], reason: `One category with ${t} values: a table first, bars when asked` };
|
|
78
|
-
}
|
|
79
|
-
const b = [...n, ...a];
|
|
80
|
-
if (b.length === 2 && o.length === 1) {
|
|
81
|
-
const [i, u] = b, v = n.includes(i);
|
|
82
|
-
if (v && !T(e.records, i)) return r("The rows are not in time order");
|
|
83
|
-
const g = C(e.records, i), m = C(e.records, u);
|
|
84
|
-
if (!$(e.records, b)) return r("A pair of grouping values repeats");
|
|
85
|
-
if (g < (v ? c : l) || m < x)
|
|
86
|
-
return r("Two groupings with too few values to chart");
|
|
87
|
-
if (m > p)
|
|
88
|
-
return r(`${m} series, more than a chart tells apart (${p})`);
|
|
89
|
-
const w = { x: i, y: o, series: u }, k = g <= h ? [
|
|
90
|
-
{ kind: "bar", encodings: w },
|
|
91
|
-
...e.governed && V(e.columns, o[0]) ? [{ kind: "stackedBar", encodings: w }] : []
|
|
92
|
-
] : [];
|
|
93
|
-
return v ? {
|
|
94
|
-
options: [{ kind: "line", encodings: w }, ...k, d],
|
|
95
|
-
reason: `A time column with ${m} series over ${g} points`
|
|
96
|
-
} : k.length === 0 ? r(`${g} values on the axis, more than a bar chart shows (${h})`) : {
|
|
97
|
-
options: [d, ...k],
|
|
98
|
-
reason: `Two groupings (${g} by ${m}) and one measure`
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return r("The result does not have a chart shape");
|
|
102
|
-
}
|
|
103
|
-
function I(e, r) {
|
|
104
|
-
if (r) {
|
|
105
|
-
if (e.temporalBucket || e.role === "date") return "time";
|
|
106
|
-
if (e.role === "measure") return "measure";
|
|
107
|
-
if (e.role === "dimension" || e.role === "id") return "dimension";
|
|
108
|
-
}
|
|
109
|
-
switch (e.dataType) {
|
|
110
|
-
case "date":
|
|
111
|
-
case "datetime":
|
|
112
|
-
return "time";
|
|
113
|
-
case "string":
|
|
114
|
-
return "dimension";
|
|
115
|
-
case "number":
|
|
116
|
-
return "measure";
|
|
117
|
-
default:
|
|
118
|
-
return "other";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
const N = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
|
|
122
|
-
function T(e, r) {
|
|
123
|
-
let s, n;
|
|
124
|
-
const a = /* @__PURE__ */ new Set();
|
|
125
|
-
for (const o of e) {
|
|
126
|
-
const t = o[r], c = typeof t == "string" ? N.exec(t) : null;
|
|
127
|
-
if (!c) return !1;
|
|
128
|
-
if (a.has(t)) continue;
|
|
129
|
-
a.add(t);
|
|
130
|
-
const f = c[1] !== void 0;
|
|
131
|
-
if (n === void 0 && (n = f), f !== n) return !1;
|
|
132
|
-
const l = f ? Date.parse(t.replace(" ", "T")) : t;
|
|
133
|
-
if (typeof l == "number" && Number.isNaN(l) || s !== void 0 && l <= s) return !1;
|
|
134
|
-
s = l;
|
|
135
|
-
}
|
|
136
|
-
return !0;
|
|
137
|
-
}
|
|
138
|
-
function V(e, r) {
|
|
139
|
-
var n;
|
|
140
|
-
const s = (n = e.find((a) => a.key === r)) == null ? void 0 : n.aggregate;
|
|
141
|
-
return s === "SUM" || s === "COUNT";
|
|
142
|
-
}
|
|
143
|
-
function _(e) {
|
|
144
|
-
return e == null || typeof e == "number" && Number.isFinite(e);
|
|
145
|
-
}
|
|
146
|
-
function $(e, r) {
|
|
147
|
-
const s = /* @__PURE__ */ new Set();
|
|
148
|
-
for (const n of e) {
|
|
149
|
-
const a = JSON.stringify(r.map((o) => n[o] ?? null));
|
|
150
|
-
if (s.has(a)) return !1;
|
|
151
|
-
s.add(a);
|
|
152
|
-
}
|
|
153
|
-
return !0;
|
|
154
|
-
}
|
|
155
|
-
function C(e, r) {
|
|
156
|
-
return new Set(e.map((s) => JSON.stringify(s[r] ?? null))).size;
|
|
157
|
-
}
|
|
158
|
-
function y(e, r) {
|
|
159
|
-
return e === 1 ? `one ${r}` : `${e} ${r}s`;
|
|
160
|
-
}
|
|
161
|
-
function D(e) {
|
|
162
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
163
|
-
}
|
|
164
|
-
function L(e) {
|
|
165
|
-
return e.charAt(0).toLowerCase() + e.slice(1);
|
|
166
|
-
}
|
|
167
|
-
export {
|
|
168
|
-
B as V,
|
|
169
|
-
A as a,
|
|
170
|
-
U as c,
|
|
171
|
-
I as v
|
|
172
|
-
};
|