react-semaphor 0.1.423 → 0.1.425
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/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +243 -91
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +8 -8
- package/dist/chunks/{analyze-result-contract-D7pjjYPy.js → analyze-result-contract-DnfF8kBb.js} +434 -427
- package/dist/chunks/analyze-result-contract-ege_u6Nl.js +1 -0
- package/dist/chunks/{braces-8TRlDwDw.js → braces-BdbUk_r9.js} +1 -1
- package/dist/chunks/{braces-D2tStQjF.js → braces-CbO-aIwH.js} +1 -1
- package/dist/chunks/calendar-preferences-dialog-BLaSWhLl.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-t5ET6MON.js → calendar-preferences-dialog-DJwV0aqn.js} +4 -4
- package/dist/chunks/{catalog-field-grounding-CJKAqtiC.js → catalog-field-grounding-DcxPLns0.js} +10 -10
- package/dist/chunks/{switch-2bh3Hka1.js → code-editor-Bkk7s8hI.js} +7382 -6809
- package/dist/chunks/code-editor-CkXyNgYc.js +138 -0
- package/dist/chunks/{common-types-4bjoIgvm.js → common-types-ClkOI-3O.js} +4 -4
- package/dist/chunks/comparison-document-migration-CQJ0DZlL.js +414 -0
- package/dist/chunks/comparison-document-migration-Db64RWYD.js +1 -0
- package/dist/chunks/{index-yHe0SeLO.js → dashboard-5agU0G_D.js} +56752 -55440
- package/dist/chunks/dashboard-MKIqgGDp.js +1402 -0
- package/dist/chunks/{dashboard-briefing-launcher-S2akO-ub.js → dashboard-briefing-launcher-CII8-4qo.js} +11 -6
- package/dist/chunks/{dashboard-briefing-launcher-Cavd0QJb.js → dashboard-briefing-launcher-qyEVfuOm.js} +226 -209
- package/dist/chunks/dashboard-controls-PJpeYZHw.js +36 -0
- package/dist/chunks/dashboard-controls-aJY0FNPP.js +2196 -0
- package/dist/chunks/dashboard-input-contract-BFpERluO.js +18 -0
- package/dist/chunks/dashboard-input-contract-DV3cshjz.js +1 -0
- package/dist/chunks/{dashboard-json-Do2-pdPZ.js → dashboard-json-CzHSP6Fa.js} +16 -15
- package/dist/chunks/dashboard-json-DtmR5yCf.js +1 -0
- package/dist/chunks/date-formatter-BTTYdAik.js +1 -0
- package/dist/chunks/date-formatter-D-89jTjG.js +514 -0
- package/dist/chunks/{edit-dashboard-visual-Cw6bq4_w.js → edit-dashboard-visual-AkZzwBCV.js} +8892 -8996
- package/dist/chunks/edit-dashboard-visual-Cif6uDqN.js +182 -0
- package/dist/chunks/{index-CjzRe2su.js → index-CnujJ3fa.js} +3 -3
- package/dist/chunks/{index-DRlMUglg.js → index-Dpm_VET4.js} +2 -2
- package/dist/chunks/{index-CJdxSyQq.js → index-If0wlXGi.js} +308 -308
- package/dist/chunks/index-jSrCwPQz.js +31 -0
- package/dist/chunks/{x-CXDkqdur.js → index-xHCrHprY.js} +59 -59
- package/dist/chunks/{layout-grid-C0OI-MRn.js → layout-grid-B08pP7v6.js} +1 -1
- package/dist/chunks/{layout-grid-CiubineE.js → layout-grid-D5tYJg1-.js} +1 -1
- package/dist/chunks/metric-comparison-4oA4ouU9.js +354 -0
- package/dist/chunks/metric-comparison-nQKquVnx.js +1 -0
- package/dist/chunks/{palette-C4KTXOug.js → palette-C0yjT5Tv.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-jqaAcwiQ.js} +1 -1
- package/dist/chunks/{save-DgMfP0j8.js → save-HCJjjzdX.js} +1 -1
- package/dist/chunks/{save-C__QggEE.js → save-Xdc4pnys.js} +1 -1
- package/dist/chunks/{search-BHsQIWBV.js → search-DHZCro8B.js} +1 -1
- package/dist/chunks/{search-DNCejM7Z.js → search-Dcud9ajy.js} +1 -1
- package/dist/chunks/{update-policy-C1pmhLz9.js → update-policy-BgONreNd.js} +1 -1
- package/dist/chunks/{update-policy-BCJc0oI5.js → update-policy-CY2k-pJP.js} +9 -9
- package/dist/chunks/{use-create-flow-overlay-state-5MDbZcs1.js → use-create-flow-overlay-state-ByOKVV2K.js} +62 -62
- package/dist/chunks/{use-create-flow-overlay-state-BNczg9Gj.js → use-create-flow-overlay-state-DmuReEnk.js} +2 -2
- package/dist/chunks/validators-B4VMLX3_.js +1 -0
- package/dist/chunks/{validators-PXkij33j.js → validators-Cz-XuORM.js} +123 -119
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +2 -2
- package/dist/dashboard-authoring/index.js +6 -4
- package/dist/data-app-builder/index.cjs +6 -6
- package/dist/data-app-builder/index.js +5 -5
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +1 -1
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +65 -68
- package/dist/format-utils/index.cjs +2 -2
- package/dist/format-utils/index.js +59 -58
- package/dist/index.cjs +1 -1
- package/dist/index.js +19 -19
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +299 -3
- package/dist/types/brand-studio.d.ts +2 -2
- package/dist/types/briefings.d.ts +65 -41
- package/dist/types/dashboard-assistant.d.ts +28 -7
- package/dist/types/dashboard-authoring.d.ts +123 -43
- package/dist/types/dashboard.d.ts +97 -48
- package/dist/types/data-app-builder.d.ts +2 -2
- package/dist/types/data-app-sdk.d.ts +1 -1
- package/dist/types/format-utils.d.ts +98 -10
- package/dist/types/index.js +1 -1
- package/dist/types/main.d.ts +229 -95
- package/dist/types/shared.d.ts +84 -43
- package/dist/types/surfboard.d.ts +99 -49
- package/dist/types/types.d.ts +110 -50
- package/package.json +2 -1
- package/dist/chunks/analyze-result-contract-DpDcImgk.js +0 -1
- package/dist/chunks/calendar-preferences-dialog-CTmeASaM.js +0 -1
- package/dist/chunks/contracts-CoCOpd_i.js +0 -11
- package/dist/chunks/contracts-CtB2VONT.js +0 -1
- package/dist/chunks/dashboard-controls-BJLrErjW.js +0 -2322
- package/dist/chunks/dashboard-controls-DzbP8AXA.js +0 -52
- package/dist/chunks/dashboard-json-5tWb5KD6.js +0 -1
- package/dist/chunks/date-formatter-B4EBSe9C.js +0 -1
- package/dist/chunks/date-formatter-BlhBftA9.js +0 -416
- package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +0 -178
- package/dist/chunks/index-BPM3gDRw.js +0 -1406
- package/dist/chunks/switch-DMT7qf_R.js +0 -138
- package/dist/chunks/validators-DMlVbd1p.js +0 -1
- package/dist/chunks/x-B6ghREd2.js +0 -31
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-MKIqgGDp.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-BLaSWhLl.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e } from "../chunks/
|
|
2
|
-
import { C, E } from "../chunks/common-types-
|
|
3
|
-
import { C as s } from "../chunks/calendar-preferences-dialog-
|
|
1
|
+
import { a as e } from "../chunks/dashboard-5agU0G_D.js";
|
|
2
|
+
import { C, E } from "../chunks/common-types-ClkOI-3O.js";
|
|
3
|
+
import { C as s } from "../chunks/calendar-preferences-dialog-DJwV0aqn.js";
|
|
4
4
|
export {
|
|
5
5
|
C as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
s as CalendarPreferencesDialog,
|
|
@@ -56,16 +56,97 @@ export declare function buildSemaphorQualifiedSourcePath(input: {
|
|
|
56
56
|
quoteIdentifier?: (value: string, dialect: SemaphorDialect) => string;
|
|
57
57
|
}): string;
|
|
58
58
|
|
|
59
|
+
export declare const COMPARISON_PRESENTATION_DEFAULTS: {
|
|
60
|
+
readonly displayMode: "difference";
|
|
61
|
+
readonly showComparison: true;
|
|
62
|
+
readonly indicatorStyle: "arrow_badge";
|
|
63
|
+
readonly showColor: true;
|
|
64
|
+
readonly conditionalLabel: false;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export declare type ComparisonAvailability = {
|
|
68
|
+
status: 'available';
|
|
69
|
+
} | {
|
|
70
|
+
status: 'unavailable';
|
|
71
|
+
reason: ComparisonUnavailableReason;
|
|
72
|
+
traceId?: string;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare type ComparisonPresentationSpec = {
|
|
76
|
+
/** Defaults to difference. */
|
|
77
|
+
displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
|
|
78
|
+
/** Defaults to true. This controls display, not baseline selection. */
|
|
79
|
+
showComparison?: boolean;
|
|
80
|
+
/** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
|
|
81
|
+
precision?: number;
|
|
82
|
+
/** Defaults to arrow_badge. */
|
|
83
|
+
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
84
|
+
/** Defaults to true. */
|
|
85
|
+
showColor?: boolean;
|
|
86
|
+
position?: 'left' | 'right' | 'top';
|
|
87
|
+
/** Defaults to false. */
|
|
88
|
+
conditionalLabel?: boolean;
|
|
89
|
+
labelName?: string;
|
|
90
|
+
conditionalLabels?: {
|
|
91
|
+
increase?: string;
|
|
92
|
+
decrease?: string;
|
|
93
|
+
neutral?: string;
|
|
94
|
+
};
|
|
95
|
+
colors?: {
|
|
96
|
+
increase?: string;
|
|
97
|
+
decrease?: string;
|
|
98
|
+
neutral?: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare type ComparisonUnavailableReason = 'finite_current_window_required' | 'current_window_not_started' | 'temporal_binding_missing' | 'temporal_binding_ambiguous' | 'temporal_binding_invalid' | 'unsupported_output_shape' | 'unsupported_raw_sql' | 'insufficient_history' | 'invalid_comparison_spec' | 'comparison_execution_failed';
|
|
103
|
+
|
|
104
|
+
export declare const DEFAULT_METRIC_COMPARISON_POLARITY: "higher_is_better";
|
|
105
|
+
|
|
106
|
+
export declare function evaluateMetricComparison(input: {
|
|
107
|
+
currentValue: number | null;
|
|
108
|
+
comparisonValue: number | null;
|
|
109
|
+
polarity?: MetricComparisonPolarity;
|
|
110
|
+
}): MetricComparisonEvaluation;
|
|
111
|
+
|
|
59
112
|
export declare function getAnalyticsCatalogFieldCandidates(field: AnalyticsCatalogField): string[];
|
|
60
113
|
|
|
61
114
|
export declare function getAnalyticsCatalogFieldName(field: AnalyticsCatalogField): string;
|
|
62
115
|
|
|
116
|
+
/** Stable persisted identity for a card control's compatibility input. */
|
|
117
|
+
export declare function getCardControlCompatInputId(cardId: string, controlId: string): string;
|
|
118
|
+
|
|
119
|
+
/** Stable persisted identity for a card inline filter's compatibility input. */
|
|
120
|
+
export declare function getCardInlineFilterCompatInputId(cardId: string, filterId: string): string;
|
|
121
|
+
|
|
122
|
+
/** Stable persisted identity for a dashboard control's compatibility input. */
|
|
123
|
+
export declare function getDashboardControlCompatInputId(controlId: string): string;
|
|
124
|
+
|
|
125
|
+
/** Stable persisted identity for a dashboard filter's compatibility input. */
|
|
126
|
+
export declare function getDashboardFilterCompatInputId(filterId: string): string;
|
|
127
|
+
|
|
63
128
|
export declare function getSemaphorAnalyzeResultFieldNames(): SemaphorAnalyzeResultFieldName[];
|
|
64
129
|
|
|
65
130
|
export declare function getSemaphorConnectionCapabilities(connectionType: string | undefined, options?: {
|
|
66
131
|
connectionId?: string;
|
|
67
132
|
}): SemaphorConnectionCapabilities;
|
|
68
133
|
|
|
134
|
+
export declare type GlobalDateComparisonContext = {
|
|
135
|
+
selection: GlobalDateComparisonSelection;
|
|
136
|
+
inheritGlobalComparison?: false;
|
|
137
|
+
/** Fixed execution clock carried by authoritative dashboard replay snapshots. */
|
|
138
|
+
referenceTime?: string;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export declare type GlobalDateComparisonSelection = {
|
|
142
|
+
mode: 'off';
|
|
143
|
+
} | {
|
|
144
|
+
mode: 'period';
|
|
145
|
+
spec: ViewerPeriodComparisonSpec;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export declare function hasCompleteSemaphorSourceIdentity(source: SemaphorSourceRef | undefined): boolean;
|
|
149
|
+
|
|
69
150
|
export declare function isAnalyticsCatalogDateField(field: AnalyticsCatalogField): boolean;
|
|
70
151
|
|
|
71
152
|
export declare function isAnalyticsCatalogDimensionField(field: AnalyticsCatalogField): boolean;
|
|
@@ -405,6 +486,104 @@ export declare type MatrixWarning = {
|
|
|
405
486
|
|
|
406
487
|
export declare function mergeSemaphorSourcesByIdentity<TSource extends SemaphorSourceRef>(sources: readonly TSource[]): TSource[];
|
|
407
488
|
|
|
489
|
+
export declare type MetricComparisonConfig = {
|
|
490
|
+
mode: 'off';
|
|
491
|
+
} | {
|
|
492
|
+
mode: 'explicit';
|
|
493
|
+
spec: MetricComparisonSpec;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
export declare type MetricComparisonDirection = 'increase' | 'decrease' | 'no_change' | 'unknown';
|
|
497
|
+
|
|
498
|
+
export declare type MetricComparisonEvaluation = {
|
|
499
|
+
status: 'available' | 'insufficient_history';
|
|
500
|
+
currentValue: number | null;
|
|
501
|
+
comparisonValue: number | null;
|
|
502
|
+
delta: number | null;
|
|
503
|
+
percentChange: number | null;
|
|
504
|
+
ratio: number | null;
|
|
505
|
+
direction: MetricComparisonDirection;
|
|
506
|
+
sentiment: MetricComparisonSentiment;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
export declare type MetricComparisonMetadataEntry = {
|
|
510
|
+
type: MetricComparisonSpec['kind'];
|
|
511
|
+
displayName?: string;
|
|
512
|
+
displayLabel?: string;
|
|
513
|
+
output: MetricComparisonOutput;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
/** Keyed by MetricComparisonOutput.outputId, never by source id or label. */
|
|
517
|
+
export declare type MetricComparisonMetadataMap = Record<MetricComparisonOutput['outputId'], MetricComparisonMetadataEntry>;
|
|
518
|
+
|
|
519
|
+
export declare type MetricComparisonOutput = MetricComparisonOutputBase & ({
|
|
520
|
+
request: ResolvedMetricComparisonRequest;
|
|
521
|
+
availability: {
|
|
522
|
+
status: 'available';
|
|
523
|
+
};
|
|
524
|
+
comparisonColumnKey: string;
|
|
525
|
+
deltaColumnKey: string;
|
|
526
|
+
percentChangeColumnKey: string;
|
|
527
|
+
ratioColumnKey: string;
|
|
528
|
+
rowStatusColumnKey?: string;
|
|
529
|
+
currentBucketColumnKey?: string;
|
|
530
|
+
comparisonSourceBucketColumnKey?: string;
|
|
531
|
+
} | {
|
|
532
|
+
request?: ResolvedMetricComparisonRequest;
|
|
533
|
+
availability: Extract<ComparisonAvailability, {
|
|
534
|
+
status: 'unavailable';
|
|
535
|
+
}>;
|
|
536
|
+
comparisonColumnKey?: never;
|
|
537
|
+
deltaColumnKey?: never;
|
|
538
|
+
percentChangeColumnKey?: never;
|
|
539
|
+
ratioColumnKey?: never;
|
|
540
|
+
rowStatusColumnKey?: never;
|
|
541
|
+
currentBucketColumnKey?: never;
|
|
542
|
+
comparisonSourceBucketColumnKey?: never;
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
export declare type MetricComparisonOutputBase = {
|
|
546
|
+
outputId: string;
|
|
547
|
+
metricId: string;
|
|
548
|
+
metricAlias: string;
|
|
549
|
+
currentColumnKey: string;
|
|
550
|
+
windowGrain?: MetricComparisonWindowGrain;
|
|
551
|
+
currentWindow?: ResolvedDateWindow;
|
|
552
|
+
comparisonWindow?: ResolvedDateWindow;
|
|
553
|
+
referenceTime?: string;
|
|
554
|
+
temporalField?: SemaphorFieldRef;
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
export declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
|
|
558
|
+
|
|
559
|
+
export declare type MetricComparisonSentiment = 'favorable' | 'unfavorable' | 'neutral';
|
|
560
|
+
|
|
561
|
+
export declare type MetricComparisonSpec = {
|
|
562
|
+
kind: 'previous_period';
|
|
563
|
+
offsetPeriods?: number;
|
|
564
|
+
alignment?: 'calendar' | 'weekday';
|
|
565
|
+
toDate?: boolean;
|
|
566
|
+
} | {
|
|
567
|
+
kind: 'previous_year';
|
|
568
|
+
offsetYears?: number;
|
|
569
|
+
alignment?: 'calendar' | 'weekday';
|
|
570
|
+
toDate?: boolean;
|
|
571
|
+
} | {
|
|
572
|
+
kind: 'target';
|
|
573
|
+
targetValue: number;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
export declare type MetricComparisonWindowGrain = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
577
|
+
|
|
578
|
+
export declare type MetricResultAliasInput = {
|
|
579
|
+
alias?: string;
|
|
580
|
+
name: string;
|
|
581
|
+
entityName?: string;
|
|
582
|
+
role?: string;
|
|
583
|
+
aggregate?: string;
|
|
584
|
+
expression?: string;
|
|
585
|
+
};
|
|
586
|
+
|
|
408
587
|
export declare function normalizeAnalyticsCatalogDataType(value: unknown): AnalyticsCatalogDataType;
|
|
409
588
|
|
|
410
589
|
export declare function normalizeAnalyticsCatalogName(value: unknown): string;
|
|
@@ -417,12 +596,61 @@ export declare function normalizeSemaphorInputOperator(value: SemaphorInputOpera
|
|
|
417
596
|
|
|
418
597
|
export declare function parseSemaphorAnalyzeResult(value: unknown): SemaphorAnalyzeResult;
|
|
419
598
|
|
|
599
|
+
export declare function parseSemaphorIsoInstant(value: unknown): Date | null;
|
|
600
|
+
|
|
420
601
|
export declare function parseSemaphorIsoTimeWindowBoundary(value: unknown): Date | null;
|
|
421
602
|
|
|
422
603
|
export declare function preferSemaphorFieldRefMetadata(current: SemaphorFieldRef, next: SemaphorFieldRef): SemaphorFieldRef;
|
|
423
604
|
|
|
424
605
|
export declare function preferSemaphorSourceMetadata(current: SemaphorSourceRef, next: SemaphorSourceRef): SemaphorSourceRef;
|
|
425
606
|
|
|
607
|
+
export declare type ResolvedDateWindow = {
|
|
608
|
+
startInclusive: string;
|
|
609
|
+
endExclusive: string;
|
|
610
|
+
timezone: string;
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
export declare type ResolvedMetricComparisonRequest = {
|
|
614
|
+
source: 'explicit';
|
|
615
|
+
spec: MetricComparisonSpec;
|
|
616
|
+
} | {
|
|
617
|
+
source: 'inherited';
|
|
618
|
+
spec: ViewerPeriodComparisonSpec;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
export declare type ResolvedTemporalContext = {
|
|
622
|
+
status: 'resolved';
|
|
623
|
+
field: SourceBearingTemporalField;
|
|
624
|
+
bindingSource: TemporalBindingCandidate['kind'];
|
|
625
|
+
currentWindow?: ResolvedDateWindow;
|
|
626
|
+
governingWindowSource?: TemporalRangeCandidate['source'];
|
|
627
|
+
governingRangeId?: string;
|
|
628
|
+
constraints: TemporalRangeCandidate[];
|
|
629
|
+
} | {
|
|
630
|
+
status: 'unavailable';
|
|
631
|
+
reason: 'temporal_binding_missing' | 'temporal_binding_ambiguous' | 'temporal_binding_invalid' | 'unsupported_raw_sql';
|
|
632
|
+
constraints: TemporalRangeCandidate[];
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
export declare function resolveMetricComparisonRequest(input: {
|
|
636
|
+
metricComparison?: MetricComparisonConfig;
|
|
637
|
+
inheritGlobalComparison?: false;
|
|
638
|
+
globalSelection?: GlobalDateComparisonSelection;
|
|
639
|
+
isGlobalDateApplicable: boolean;
|
|
640
|
+
}): ResolvedMetricComparisonRequest | undefined;
|
|
641
|
+
|
|
642
|
+
/** Stable result-instance identity shared by query producers and consumers. */
|
|
643
|
+
export declare function resolveMetricResultAlias(metric: MetricResultAliasInput): string;
|
|
644
|
+
|
|
645
|
+
export declare function resolveTemporalContext(input: ResolveTemporalContextInput): ResolvedTemporalContext;
|
|
646
|
+
|
|
647
|
+
export declare type ResolveTemporalContextInput = {
|
|
648
|
+
rawSql?: boolean;
|
|
649
|
+
candidates: TemporalBindingCandidate[];
|
|
650
|
+
ranges?: TemporalRangeCandidate[];
|
|
651
|
+
querySources?: SemaphorSourceRef[];
|
|
652
|
+
};
|
|
653
|
+
|
|
426
654
|
export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
|
|
427
655
|
revenueKpi: {
|
|
428
656
|
version: 1;
|
|
@@ -641,7 +869,7 @@ export declare const SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT: {
|
|
|
641
869
|
readonly answerSummary: "string";
|
|
642
870
|
readonly responseDetail: "responseDetail";
|
|
643
871
|
readonly mode: "string";
|
|
644
|
-
readonly
|
|
872
|
+
readonly comparisonKind: "string";
|
|
645
873
|
readonly executionResult: "executionResult";
|
|
646
874
|
readonly compiledQuery: "unknown";
|
|
647
875
|
readonly data: "unknown";
|
|
@@ -1117,7 +1345,7 @@ export declare type SemaphorAnalyticsObligation = {
|
|
|
1117
1345
|
requiredFieldCandidates?: string[];
|
|
1118
1346
|
limit?: number;
|
|
1119
1347
|
timeWindow?: SemaphorTimeWindow;
|
|
1120
|
-
comparison?: '
|
|
1348
|
+
comparison?: 'previous_year' | 'previous_period';
|
|
1121
1349
|
required?: boolean;
|
|
1122
1350
|
};
|
|
1123
1351
|
|
|
@@ -2012,7 +2240,7 @@ export declare type SemaphorAnalyzeResult = Partial<Record<SemaphorAnalyzeResult
|
|
|
2012
2240
|
answerSummary?: string;
|
|
2013
2241
|
responseDetail?: SemaphorAnalyzeResponseDetail;
|
|
2014
2242
|
mode?: string;
|
|
2015
|
-
|
|
2243
|
+
comparisonKind?: string;
|
|
2016
2244
|
executionResult?: SemaphorAnalyticsExecutionResult;
|
|
2017
2245
|
compiledQuery?: SemaphorCompiledQuery;
|
|
2018
2246
|
data?: unknown;
|
|
@@ -3925,6 +4153,70 @@ export declare type SemaphorViewPresentation = {
|
|
|
3925
4153
|
kind: 'text';
|
|
3926
4154
|
};
|
|
3927
4155
|
|
|
4156
|
+
export declare type SourceBearingTemporalField = SemaphorFieldRef & {
|
|
4157
|
+
source: SemaphorSourceRef;
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4160
|
+
export declare const TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES: {
|
|
4161
|
+
readonly visibleAxis: {
|
|
4162
|
+
readonly source: {
|
|
4163
|
+
kind: "semantic";
|
|
4164
|
+
domainId: string;
|
|
4165
|
+
datasetName: string;
|
|
4166
|
+
};
|
|
4167
|
+
readonly field: {
|
|
4168
|
+
readonly name: "order_date";
|
|
4169
|
+
readonly label: "Order date";
|
|
4170
|
+
readonly dataType: "timestamp with time zone";
|
|
4171
|
+
};
|
|
4172
|
+
readonly expected: {
|
|
4173
|
+
readonly status: "resolved";
|
|
4174
|
+
readonly bindingSource: "visible_axis";
|
|
4175
|
+
readonly name: "order_date";
|
|
4176
|
+
readonly dataType: "datetime";
|
|
4177
|
+
};
|
|
4178
|
+
};
|
|
4179
|
+
readonly invalidSource: {
|
|
4180
|
+
readonly source: {
|
|
4181
|
+
readonly kind: "semantic";
|
|
4182
|
+
readonly datasetName: "orders";
|
|
4183
|
+
};
|
|
4184
|
+
readonly field: {
|
|
4185
|
+
readonly name: "order_date";
|
|
4186
|
+
readonly label: "Order date";
|
|
4187
|
+
readonly dataType: "date";
|
|
4188
|
+
};
|
|
4189
|
+
readonly expected: {
|
|
4190
|
+
readonly status: "unavailable";
|
|
4191
|
+
readonly reason: "temporal_binding_invalid";
|
|
4192
|
+
};
|
|
4193
|
+
};
|
|
4194
|
+
};
|
|
4195
|
+
|
|
4196
|
+
export declare type TemporalBindingCandidate = {
|
|
4197
|
+
kind: 'visible_axis' | 'explicit_hidden' | 'semantic_primary';
|
|
4198
|
+
field: SourceBearingTemporalField;
|
|
4199
|
+
};
|
|
4200
|
+
|
|
4201
|
+
export declare type TemporalRangeCandidate = {
|
|
4202
|
+
id: string;
|
|
4203
|
+
source: 'global_date' | 'card';
|
|
4204
|
+
field: SourceBearingTemporalField;
|
|
4205
|
+
window: ResolvedDateWindow;
|
|
4206
|
+
};
|
|
4207
|
+
|
|
4208
|
+
export declare function validateComparisonPresentationSpec(value: unknown, path?: string): SemaphorValidationResult;
|
|
4209
|
+
|
|
4210
|
+
export declare function validateGlobalDateComparisonContext(value: unknown, path?: string): SemaphorValidationResult;
|
|
4211
|
+
|
|
4212
|
+
export declare function validateGlobalDateComparisonSelection(value: unknown, path?: string): SemaphorValidationResult;
|
|
4213
|
+
|
|
4214
|
+
export declare function validateMetricComparisonConfig(value: unknown, path?: string): SemaphorValidationResult;
|
|
4215
|
+
|
|
4216
|
+
export declare function validateMetricComparisonPolarity(value: unknown, path?: string): SemaphorValidationResult;
|
|
4217
|
+
|
|
4218
|
+
export declare function validateMetricComparisonSpec(value: unknown, path?: string): SemaphorValidationResult;
|
|
4219
|
+
|
|
3928
4220
|
export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;
|
|
3929
4221
|
|
|
3930
4222
|
export declare function validateSemaphorAnalyticsRecoveryPlan(plan: SemaphorAnalyticsRecoveryPlan): SemaphorAnalyticsValidationResult;
|
|
@@ -3942,4 +4234,8 @@ export declare function validateSemaphorOperationIntent(intent: SemaphorOperatio
|
|
|
3942
4234
|
|
|
3943
4235
|
export declare function validateSemaphorResultCalculation(calculation: SemaphorResultCalculation): SemaphorValidationResult;
|
|
3944
4236
|
|
|
4237
|
+
export declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
|
|
4238
|
+
kind: 'previous_period' | 'previous_year';
|
|
4239
|
+
}>;
|
|
4240
|
+
|
|
3945
4241
|
export { }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
3
|
declare const APPEARANCE_SPEC_VERSION: 1;
|
|
4
4
|
|
|
@@ -101,7 +101,7 @@ export declare type BrandStudioDraft = {
|
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
export declare function BrandStudioEditor({ appearance, previewTitle, isLoading, isSaving, error, className, onDraftChange, onSave, onClearConfig, onCancel, }: BrandStudioEditorProps): JSX.Element;
|
|
104
|
+
export declare function BrandStudioEditor({ appearance, previewTitle, isLoading, isSaving, error, className, onDraftChange, onSave, onClearConfig, onCancel, }: BrandStudioEditorProps): default_2.JSX.Element;
|
|
105
105
|
|
|
106
106
|
export declare type BrandStudioEditorProps = {
|
|
107
107
|
appearance?: AppearanceSpec | null;
|
|
@@ -526,9 +526,6 @@ declare interface CardConfig {
|
|
|
526
526
|
* Configuration for on-click dashboard filters triggered by this card.
|
|
527
527
|
*/
|
|
528
528
|
clickFilterInteractions?: ClickFilterInteraction[];
|
|
529
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
530
|
-
targetValue?: number;
|
|
531
|
-
showComparisonInLegend?: boolean;
|
|
532
529
|
showTrendline?: boolean;
|
|
533
530
|
trendlineWindow?: number;
|
|
534
531
|
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
@@ -665,6 +662,33 @@ declare type ColumnType = 'string' | 'number' | 'date';
|
|
|
665
662
|
|
|
666
663
|
declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
667
664
|
|
|
665
|
+
declare type ComparisonPresentationSpec = {
|
|
666
|
+
/** Defaults to difference. */
|
|
667
|
+
displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
|
|
668
|
+
/** Defaults to true. This controls display, not baseline selection. */
|
|
669
|
+
showComparison?: boolean;
|
|
670
|
+
/** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
|
|
671
|
+
precision?: number;
|
|
672
|
+
/** Defaults to arrow_badge. */
|
|
673
|
+
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
674
|
+
/** Defaults to true. */
|
|
675
|
+
showColor?: boolean;
|
|
676
|
+
position?: 'left' | 'right' | 'top';
|
|
677
|
+
/** Defaults to false. */
|
|
678
|
+
conditionalLabel?: boolean;
|
|
679
|
+
labelName?: string;
|
|
680
|
+
conditionalLabels?: {
|
|
681
|
+
increase?: string;
|
|
682
|
+
decrease?: string;
|
|
683
|
+
neutral?: string;
|
|
684
|
+
};
|
|
685
|
+
colors?: {
|
|
686
|
+
increase?: string;
|
|
687
|
+
decrease?: string;
|
|
688
|
+
neutral?: string;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
|
|
668
692
|
declare type ConditionalFormatCondition = {
|
|
669
693
|
kind: 'comparison';
|
|
670
694
|
columnId: string;
|
|
@@ -957,7 +981,6 @@ declare interface DetailTableBackupConfig {
|
|
|
957
981
|
function: AggregateFunction;
|
|
958
982
|
pivotLevel: string | 'ALL';
|
|
959
983
|
}>;
|
|
960
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
961
984
|
}
|
|
962
985
|
|
|
963
986
|
declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
|
|
@@ -1449,6 +1472,30 @@ declare interface MetricColumn extends BaseColumn {
|
|
|
1449
1472
|
aliasTemplate?: string;
|
|
1450
1473
|
}
|
|
1451
1474
|
|
|
1475
|
+
declare type MetricComparisonConfig = {
|
|
1476
|
+
mode: 'off';
|
|
1477
|
+
} | {
|
|
1478
|
+
mode: 'explicit';
|
|
1479
|
+
spec: MetricComparisonSpec;
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
|
|
1483
|
+
|
|
1484
|
+
declare type MetricComparisonSpec = {
|
|
1485
|
+
kind: 'previous_period';
|
|
1486
|
+
offsetPeriods?: number;
|
|
1487
|
+
alignment?: 'calendar' | 'weekday';
|
|
1488
|
+
toDate?: boolean;
|
|
1489
|
+
} | {
|
|
1490
|
+
kind: 'previous_year';
|
|
1491
|
+
offsetYears?: number;
|
|
1492
|
+
alignment?: 'calendar' | 'weekday';
|
|
1493
|
+
toDate?: boolean;
|
|
1494
|
+
} | {
|
|
1495
|
+
kind: 'target';
|
|
1496
|
+
targetValue: number;
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1452
1499
|
declare interface MetricField extends Field {
|
|
1453
1500
|
role: 'metric';
|
|
1454
1501
|
aggregate?: AggregateFunction;
|
|
@@ -1497,9 +1544,10 @@ declare interface MetricField extends Field {
|
|
|
1497
1544
|
* pre-aggregated metric input.
|
|
1498
1545
|
*/
|
|
1499
1546
|
isPreAggregated?: boolean;
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1547
|
+
comparison?: MetricComparisonConfig;
|
|
1548
|
+
comparisonPolarity?: MetricComparisonPolarity;
|
|
1549
|
+
/** Governed runtime annotation. When present, authoring polarity is read-only. */
|
|
1550
|
+
semanticComparisonPolarity?: MetricComparisonPolarity;
|
|
1503
1551
|
}
|
|
1504
1552
|
|
|
1505
1553
|
declare type NoneOptions = {};
|
|
@@ -2193,6 +2241,11 @@ declare type TCard = {
|
|
|
2193
2241
|
};
|
|
2194
2242
|
|
|
2195
2243
|
declare type TCardPreferences = {
|
|
2244
|
+
comparisonPresentation?: ComparisonPresentationSpec;
|
|
2245
|
+
/** Absence means eligible metrics inherit the Global Date comparison. */
|
|
2246
|
+
inheritGlobalComparison?: false;
|
|
2247
|
+
/** Separate two-metric KPI feature; defaults to false. */
|
|
2248
|
+
metricPairComparisonEnabled?: boolean;
|
|
2196
2249
|
onClickFilter?: FilterOnClick[];
|
|
2197
2250
|
filterOnClick?: boolean;
|
|
2198
2251
|
filterOnClickField?: string;
|
|
@@ -2265,43 +2318,14 @@ declare type TCardPreferences = {
|
|
|
2265
2318
|
colorScale?: string;
|
|
2266
2319
|
};
|
|
2267
2320
|
kpiVisualOptions?: {
|
|
2268
|
-
lowerIsBetter?: boolean;
|
|
2269
2321
|
countryLogoId?: string;
|
|
2270
2322
|
valueAlignment?: 'left' | 'center';
|
|
2271
2323
|
formatOptions?: TFormatOptions;
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
showColor?: boolean;
|
|
2278
|
-
conditionalLabel?: boolean;
|
|
2279
|
-
labelName?: string;
|
|
2280
|
-
position?: 'left' | 'right' | 'top';
|
|
2281
|
-
conditionalLabels?: {
|
|
2282
|
-
increase?: string;
|
|
2283
|
-
decrease?: string;
|
|
2284
|
-
noChange?: string;
|
|
2285
|
-
};
|
|
2286
|
-
colorConfig?: {
|
|
2287
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2288
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2289
|
-
noChange?: 'green' | 'red' | 'neutral' | string;
|
|
2290
|
-
};
|
|
2291
|
-
};
|
|
2292
|
-
};
|
|
2293
|
-
tableVisualOptions?: {
|
|
2294
|
-
metricComparison?: {
|
|
2295
|
-
calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
|
|
2296
|
-
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
2297
|
-
formatOptions?: TFormatOptions;
|
|
2298
|
-
colors?: {
|
|
2299
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2300
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2301
|
-
neutral?: 'green' | 'red' | 'neutral' | string;
|
|
2302
|
-
};
|
|
2303
|
-
lowerIsBetter?: boolean;
|
|
2304
|
-
};
|
|
2324
|
+
/**
|
|
2325
|
+
* Presentation-only polarity for a query-backed KPI's manually returned
|
|
2326
|
+
* current/prior value pair. Governed KPIs use per-metric polarity instead.
|
|
2327
|
+
*/
|
|
2328
|
+
queryComparisonPolarity?: MetricComparisonPolarity;
|
|
2305
2329
|
};
|
|
2306
2330
|
pivotTableOptions?: {
|
|
2307
2331
|
showRowTotals?: boolean;
|
|
@@ -109,9 +109,6 @@ declare interface CardConfig {
|
|
|
109
109
|
* Configuration for on-click dashboard filters triggered by this card.
|
|
110
110
|
*/
|
|
111
111
|
clickFilterInteractions?: ClickFilterInteraction[];
|
|
112
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
113
|
-
targetValue?: number;
|
|
114
|
-
showComparisonInLegend?: boolean;
|
|
115
112
|
showTrendline?: boolean;
|
|
116
113
|
trendlineWindow?: number;
|
|
117
114
|
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
@@ -356,7 +353,6 @@ declare interface DetailTableBackupConfig {
|
|
|
356
353
|
function: AggregateFunction;
|
|
357
354
|
pivotLevel: string | 'ALL';
|
|
358
355
|
}>;
|
|
359
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
360
356
|
}
|
|
361
357
|
|
|
362
358
|
declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
|
|
@@ -791,6 +787,30 @@ declare type MatrixTotals = {
|
|
|
791
787
|
};
|
|
792
788
|
};
|
|
793
789
|
|
|
790
|
+
declare type MetricComparisonConfig = {
|
|
791
|
+
mode: 'off';
|
|
792
|
+
} | {
|
|
793
|
+
mode: 'explicit';
|
|
794
|
+
spec: MetricComparisonSpec;
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
|
|
798
|
+
|
|
799
|
+
declare type MetricComparisonSpec = {
|
|
800
|
+
kind: 'previous_period';
|
|
801
|
+
offsetPeriods?: number;
|
|
802
|
+
alignment?: 'calendar' | 'weekday';
|
|
803
|
+
toDate?: boolean;
|
|
804
|
+
} | {
|
|
805
|
+
kind: 'previous_year';
|
|
806
|
+
offsetYears?: number;
|
|
807
|
+
alignment?: 'calendar' | 'weekday';
|
|
808
|
+
toDate?: boolean;
|
|
809
|
+
} | {
|
|
810
|
+
kind: 'target';
|
|
811
|
+
targetValue: number;
|
|
812
|
+
};
|
|
813
|
+
|
|
794
814
|
declare interface MetricField extends Field {
|
|
795
815
|
role: 'metric';
|
|
796
816
|
aggregate?: AggregateFunction;
|
|
@@ -839,9 +859,10 @@ declare interface MetricField extends Field {
|
|
|
839
859
|
* pre-aggregated metric input.
|
|
840
860
|
*/
|
|
841
861
|
isPreAggregated?: boolean;
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
862
|
+
comparison?: MetricComparisonConfig;
|
|
863
|
+
comparisonPolarity?: MetricComparisonPolarity;
|
|
864
|
+
/** Governed runtime annotation. When present, authoring polarity is read-only. */
|
|
865
|
+
semanticComparisonPolarity?: MetricComparisonPolarity;
|
|
845
866
|
}
|
|
846
867
|
|
|
847
868
|
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'like' | 'not like' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
|