react-semaphor 0.1.424 → 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-D5mABNDT.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-Dzz6jXSY.js → dashboard-5agU0G_D.js} +57458 -56183
- package/dist/chunks/dashboard-MKIqgGDp.js +1402 -0
- package/dist/chunks/{dashboard-briefing-launcher-DuWgwtxX.js → dashboard-briefing-launcher-CII8-4qo.js} +11 -6
- package/dist/chunks/{dashboard-briefing-launcher-BNDzMjjt.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-CkTEDNtH.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-CRjVRZLk.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-B9vArrvr.js → use-create-flow-overlay-state-ByOKVV2K.js} +62 -62
- package/dist/chunks/{use-create-flow-overlay-state-B-bYbtix.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-iokD3HbE.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-bbEF-AbK.js +0 -52
- package/dist/chunks/dashboard-controls-id39vb7G.js +0 -2322
- package/dist/chunks/dashboard-json-DVoqS1ks.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-CkrxZCcp.js +0 -178
- package/dist/chunks/index-S1CGUcSz.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
|
@@ -188,9 +188,6 @@ declare interface CardConfig {
|
|
|
188
188
|
* Configuration for on-click dashboard filters triggered by this card.
|
|
189
189
|
*/
|
|
190
190
|
clickFilterInteractions?: ClickFilterInteraction[];
|
|
191
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
192
|
-
targetValue?: number;
|
|
193
|
-
showComparisonInLegend?: boolean;
|
|
194
191
|
showTrendline?: boolean;
|
|
195
192
|
trendlineWindow?: number;
|
|
196
193
|
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
@@ -343,8 +340,67 @@ declare type ColumnTextWrap = 'default' | 'truncate' | 'wrap' | 'nowrap' | 'pres
|
|
|
343
340
|
|
|
344
341
|
declare type ColumnType = 'string' | 'number' | 'date';
|
|
345
342
|
|
|
343
|
+
export declare type ComparisonDocumentChange = {
|
|
344
|
+
kind: 'metric';
|
|
345
|
+
path: string;
|
|
346
|
+
metricId?: string;
|
|
347
|
+
legacyType: string;
|
|
348
|
+
comparison?: MetricComparisonConfig;
|
|
349
|
+
comparisonPolarity?: MetricComparisonPolarity;
|
|
350
|
+
removedFields: string[];
|
|
351
|
+
} | {
|
|
352
|
+
kind: 'presentation';
|
|
353
|
+
path: string;
|
|
354
|
+
comparisonPresentation?: ComparisonPresentationSpec;
|
|
355
|
+
metricPairComparisonEnabled?: boolean;
|
|
356
|
+
comparisonPolarityMetricIds?: string[];
|
|
357
|
+
intentionallyDiscardedFields?: string[];
|
|
358
|
+
removedFields: string[];
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export declare type ComparisonDocumentTransformResult<T> = {
|
|
362
|
+
document: T;
|
|
363
|
+
changed: boolean;
|
|
364
|
+
changes: ComparisonDocumentChange[];
|
|
365
|
+
diagnostics: ComparisonMigrationDiagnostic[];
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
export declare type ComparisonMigrationDiagnostic = {
|
|
369
|
+
severity: 'warning' | 'error';
|
|
370
|
+
code: 'invalid_target_value' | 'unsupported_start_vs_end' | 'unsupported_comparison_type' | 'stray_target_value' | 'malformed_metric_columns' | 'conflicting_comparison_contracts' | 'conflicting_comparison_window_transform' | 'conflicting_comparison_presentation_contracts' | 'conflicting_legacy_presentation_namespaces' | 'conflicting_legacy_polarity' | 'invalid_legacy_comparison_presentation' | 'unsupported_comparison_format';
|
|
371
|
+
path: string;
|
|
372
|
+
message: string;
|
|
373
|
+
};
|
|
374
|
+
|
|
346
375
|
declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
347
376
|
|
|
377
|
+
declare type ComparisonPresentationSpec = {
|
|
378
|
+
/** Defaults to difference. */
|
|
379
|
+
displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
|
|
380
|
+
/** Defaults to true. This controls display, not baseline selection. */
|
|
381
|
+
showComparison?: boolean;
|
|
382
|
+
/** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
|
|
383
|
+
precision?: number;
|
|
384
|
+
/** Defaults to arrow_badge. */
|
|
385
|
+
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
386
|
+
/** Defaults to true. */
|
|
387
|
+
showColor?: boolean;
|
|
388
|
+
position?: 'left' | 'right' | 'top';
|
|
389
|
+
/** Defaults to false. */
|
|
390
|
+
conditionalLabel?: boolean;
|
|
391
|
+
labelName?: string;
|
|
392
|
+
conditionalLabels?: {
|
|
393
|
+
increase?: string;
|
|
394
|
+
decrease?: string;
|
|
395
|
+
neutral?: string;
|
|
396
|
+
};
|
|
397
|
+
colors?: {
|
|
398
|
+
increase?: string;
|
|
399
|
+
decrease?: string;
|
|
400
|
+
neutral?: string;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
|
|
348
404
|
export declare function compileDashboardFromPlan(input: {
|
|
349
405
|
dashboardId: string;
|
|
350
406
|
plan: DashboardPlan;
|
|
@@ -676,11 +732,17 @@ declare type DashboardInputScope = {
|
|
|
676
732
|
sectionIds: string[];
|
|
677
733
|
};
|
|
678
734
|
|
|
679
|
-
declare type DashboardInputSlot = {
|
|
735
|
+
declare type DashboardInputSlot = ({
|
|
680
736
|
status: 'set';
|
|
681
737
|
value: DashboardInputValue;
|
|
682
|
-
|
|
738
|
+
comparisonSelection?: GlobalDateComparisonSelection;
|
|
739
|
+
}) | ({
|
|
683
740
|
status: 'cleared';
|
|
741
|
+
comparisonSelection?: GlobalDateComparisonSelection;
|
|
742
|
+
}) | {
|
|
743
|
+
status?: never;
|
|
744
|
+
value?: never;
|
|
745
|
+
comparisonSelection: GlobalDateComparisonSelection;
|
|
684
746
|
};
|
|
685
747
|
|
|
686
748
|
declare type DashboardInputTextContent = Array<{
|
|
@@ -906,7 +968,6 @@ declare interface DetailTableBackupConfig {
|
|
|
906
968
|
function: AggregateFunction;
|
|
907
969
|
pivotLevel: string | 'ALL';
|
|
908
970
|
}>;
|
|
909
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
910
971
|
}
|
|
911
972
|
|
|
912
973
|
declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
|
|
@@ -1506,6 +1567,13 @@ export declare type GeneratedDashboardCardArtifact = {
|
|
|
1506
1567
|
|
|
1507
1568
|
export declare function getDashboardAuthoringCardSource(card: Pick<DashboardPlanCard, 'analyticsIntent'>): SemaphorSourceRef | undefined;
|
|
1508
1569
|
|
|
1570
|
+
declare type GlobalDateComparisonSelection = {
|
|
1571
|
+
mode: 'off';
|
|
1572
|
+
} | {
|
|
1573
|
+
mode: 'period';
|
|
1574
|
+
spec: ViewerPeriodComparisonSpec;
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1509
1577
|
declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
|
|
1510
1578
|
|
|
1511
1579
|
declare interface GroupByColumn extends BaseColumn {
|
|
@@ -1660,6 +1728,30 @@ declare interface MetricColumn extends BaseColumn {
|
|
|
1660
1728
|
aliasTemplate?: string;
|
|
1661
1729
|
}
|
|
1662
1730
|
|
|
1731
|
+
declare type MetricComparisonConfig = {
|
|
1732
|
+
mode: 'off';
|
|
1733
|
+
} | {
|
|
1734
|
+
mode: 'explicit';
|
|
1735
|
+
spec: MetricComparisonSpec;
|
|
1736
|
+
};
|
|
1737
|
+
|
|
1738
|
+
declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
|
|
1739
|
+
|
|
1740
|
+
declare type MetricComparisonSpec = {
|
|
1741
|
+
kind: 'previous_period';
|
|
1742
|
+
offsetPeriods?: number;
|
|
1743
|
+
alignment?: 'calendar' | 'weekday';
|
|
1744
|
+
toDate?: boolean;
|
|
1745
|
+
} | {
|
|
1746
|
+
kind: 'previous_year';
|
|
1747
|
+
offsetYears?: number;
|
|
1748
|
+
alignment?: 'calendar' | 'weekday';
|
|
1749
|
+
toDate?: boolean;
|
|
1750
|
+
} | {
|
|
1751
|
+
kind: 'target';
|
|
1752
|
+
targetValue: number;
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1663
1755
|
declare interface MetricField extends Field {
|
|
1664
1756
|
role: 'metric';
|
|
1665
1757
|
aggregate?: AggregateFunction;
|
|
@@ -1708,9 +1800,10 @@ declare interface MetricField extends Field {
|
|
|
1708
1800
|
* pre-aggregated metric input.
|
|
1709
1801
|
*/
|
|
1710
1802
|
isPreAggregated?: boolean;
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1803
|
+
comparison?: MetricComparisonConfig;
|
|
1804
|
+
comparisonPolarity?: MetricComparisonPolarity;
|
|
1805
|
+
/** Governed runtime annotation. When present, authoring polarity is read-only. */
|
|
1806
|
+
semanticComparisonPolarity?: MetricComparisonPolarity;
|
|
1714
1807
|
}
|
|
1715
1808
|
|
|
1716
1809
|
declare type NoneOptions = {};
|
|
@@ -2687,6 +2780,11 @@ declare type TCard = {
|
|
|
2687
2780
|
};
|
|
2688
2781
|
|
|
2689
2782
|
declare type TCardPreferences = {
|
|
2783
|
+
comparisonPresentation?: ComparisonPresentationSpec;
|
|
2784
|
+
/** Absence means eligible metrics inherit the Global Date comparison. */
|
|
2785
|
+
inheritGlobalComparison?: false;
|
|
2786
|
+
/** Separate two-metric KPI feature; defaults to false. */
|
|
2787
|
+
metricPairComparisonEnabled?: boolean;
|
|
2690
2788
|
onClickFilter?: FilterOnClick[];
|
|
2691
2789
|
filterOnClick?: boolean;
|
|
2692
2790
|
filterOnClickField?: string;
|
|
@@ -2759,43 +2857,14 @@ declare type TCardPreferences = {
|
|
|
2759
2857
|
colorScale?: string;
|
|
2760
2858
|
};
|
|
2761
2859
|
kpiVisualOptions?: {
|
|
2762
|
-
lowerIsBetter?: boolean;
|
|
2763
2860
|
countryLogoId?: string;
|
|
2764
2861
|
valueAlignment?: 'left' | 'center';
|
|
2765
2862
|
formatOptions?: TFormatOptions;
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
showColor?: boolean;
|
|
2772
|
-
conditionalLabel?: boolean;
|
|
2773
|
-
labelName?: string;
|
|
2774
|
-
position?: 'left' | 'right' | 'top';
|
|
2775
|
-
conditionalLabels?: {
|
|
2776
|
-
increase?: string;
|
|
2777
|
-
decrease?: string;
|
|
2778
|
-
noChange?: string;
|
|
2779
|
-
};
|
|
2780
|
-
colorConfig?: {
|
|
2781
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2782
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2783
|
-
noChange?: 'green' | 'red' | 'neutral' | string;
|
|
2784
|
-
};
|
|
2785
|
-
};
|
|
2786
|
-
};
|
|
2787
|
-
tableVisualOptions?: {
|
|
2788
|
-
metricComparison?: {
|
|
2789
|
-
calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
|
|
2790
|
-
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
2791
|
-
formatOptions?: TFormatOptions;
|
|
2792
|
-
colors?: {
|
|
2793
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2794
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2795
|
-
neutral?: 'green' | 'red' | 'neutral' | string;
|
|
2796
|
-
};
|
|
2797
|
-
lowerIsBetter?: boolean;
|
|
2798
|
-
};
|
|
2863
|
+
/**
|
|
2864
|
+
* Presentation-only polarity for a query-backed KPI's manually returned
|
|
2865
|
+
* current/prior value pair. Governed KPIs use per-metric polarity instead.
|
|
2866
|
+
*/
|
|
2867
|
+
queryComparisonPolarity?: MetricComparisonPolarity;
|
|
2799
2868
|
};
|
|
2800
2869
|
pivotTableOptions?: {
|
|
2801
2870
|
showRowTotals?: boolean;
|
|
@@ -3254,6 +3323,13 @@ declare type TotalsBehavior = 'sum' | 'avg' | 'count' | 'label' | 'none';
|
|
|
3254
3323
|
/** Point style options supported by Chart.js */
|
|
3255
3324
|
declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
|
|
3256
3325
|
|
|
3326
|
+
/**
|
|
3327
|
+
* Pure, atomic migration for persisted dashboard-shaped JSON documents.
|
|
3328
|
+
* Documents with neither an active legacy metric comparison nor legacy
|
|
3329
|
+
* comparison presentation are returned by identity.
|
|
3330
|
+
*/
|
|
3331
|
+
export declare function transformComparisonDocument<T>(document: T): ComparisonDocumentTransformResult<T>;
|
|
3332
|
+
|
|
3257
3333
|
declare type TSheet = {
|
|
3258
3334
|
id: string;
|
|
3259
3335
|
kind?: 'dashboard' | 'document';
|
|
@@ -3320,6 +3396,10 @@ export declare function validateDashboardChangePlan(plan: DashboardChangePlan):
|
|
|
3320
3396
|
|
|
3321
3397
|
export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
|
|
3322
3398
|
|
|
3399
|
+
declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
|
|
3400
|
+
kind: 'previous_period' | 'previous_year';
|
|
3401
|
+
}>;
|
|
3402
|
+
|
|
3323
3403
|
/**
|
|
3324
3404
|
* Display mode for visual components - controls which UI elements are shown
|
|
3325
3405
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
2
2
|
import { FontSpec } from 'chart.js';
|
|
3
|
-
import { JSX } from 'react
|
|
4
|
-
import { JSX as JSX_2 } from 'react';
|
|
3
|
+
import { JSX } from 'react';
|
|
5
4
|
|
|
6
5
|
export declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
|
|
7
6
|
|
|
@@ -265,9 +264,6 @@ declare interface CardConfig {
|
|
|
265
264
|
* Configuration for on-click dashboard filters triggered by this card.
|
|
266
265
|
*/
|
|
267
266
|
clickFilterInteractions?: ClickFilterInteraction[];
|
|
268
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
269
|
-
targetValue?: number;
|
|
270
|
-
showComparisonInLegend?: boolean;
|
|
271
267
|
showTrendline?: boolean;
|
|
272
268
|
trendlineWindow?: number;
|
|
273
269
|
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
@@ -430,6 +426,33 @@ declare type ColumnType = 'string' | 'number' | 'date';
|
|
|
430
426
|
|
|
431
427
|
declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
432
428
|
|
|
429
|
+
declare type ComparisonPresentationSpec = {
|
|
430
|
+
/** Defaults to difference. */
|
|
431
|
+
displayMode?: 'difference' | 'percent_change' | 'both' | 'ratio';
|
|
432
|
+
/** Defaults to true. This controls display, not baseline selection. */
|
|
433
|
+
showComparison?: boolean;
|
|
434
|
+
/** Percent/ratio precision. Defaults to the surface formatter; valid range is 0..6. */
|
|
435
|
+
precision?: number;
|
|
436
|
+
/** Defaults to arrow_badge. */
|
|
437
|
+
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
438
|
+
/** Defaults to true. */
|
|
439
|
+
showColor?: boolean;
|
|
440
|
+
position?: 'left' | 'right' | 'top';
|
|
441
|
+
/** Defaults to false. */
|
|
442
|
+
conditionalLabel?: boolean;
|
|
443
|
+
labelName?: string;
|
|
444
|
+
conditionalLabels?: {
|
|
445
|
+
increase?: string;
|
|
446
|
+
decrease?: string;
|
|
447
|
+
neutral?: string;
|
|
448
|
+
};
|
|
449
|
+
colors?: {
|
|
450
|
+
increase?: string;
|
|
451
|
+
decrease?: string;
|
|
452
|
+
neutral?: string;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
|
|
433
456
|
declare type ConditionalFormatCondition = {
|
|
434
457
|
kind: 'comparison';
|
|
435
458
|
columnId: string;
|
|
@@ -680,11 +703,17 @@ export declare type DashboardInputScope = {
|
|
|
680
703
|
sectionIds: string[];
|
|
681
704
|
};
|
|
682
705
|
|
|
683
|
-
export declare type DashboardInputSlot = {
|
|
706
|
+
export declare type DashboardInputSlot = ({
|
|
684
707
|
status: 'set';
|
|
685
708
|
value: DashboardInputValue;
|
|
686
|
-
|
|
709
|
+
comparisonSelection?: GlobalDateComparisonSelection;
|
|
710
|
+
}) | ({
|
|
687
711
|
status: 'cleared';
|
|
712
|
+
comparisonSelection?: GlobalDateComparisonSelection;
|
|
713
|
+
}) | {
|
|
714
|
+
status?: never;
|
|
715
|
+
value?: never;
|
|
716
|
+
comparisonSelection: GlobalDateComparisonSelection;
|
|
688
717
|
};
|
|
689
718
|
|
|
690
719
|
export declare type DashboardInputTextContent = Array<{
|
|
@@ -919,7 +948,6 @@ declare interface DetailTableBackupConfig {
|
|
|
919
948
|
function: AggregateFunction;
|
|
920
949
|
pivotLevel: string | 'ALL';
|
|
921
950
|
}>;
|
|
922
|
-
comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
|
|
923
951
|
}
|
|
924
952
|
|
|
925
953
|
declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
|
|
@@ -1534,7 +1562,8 @@ declare type FormatSpec = {
|
|
|
1534
1562
|
export declare type GetDashboardResponse = {
|
|
1535
1563
|
dashboard: TDashboard;
|
|
1536
1564
|
lenses: TLens[];
|
|
1537
|
-
filterValues?: TFilterValue[];
|
|
1565
|
+
filterValues?: TFilterValue[] | null;
|
|
1566
|
+
inputValues?: LensInputValuesSnapshot | null;
|
|
1538
1567
|
defaultLensId?: string;
|
|
1539
1568
|
assistantProfileId?: string;
|
|
1540
1569
|
semanticExecutionPayload: SemanticExecutionPayload;
|
|
@@ -1549,6 +1578,13 @@ export declare type GetPluginsResponse = {
|
|
|
1549
1578
|
}[];
|
|
1550
1579
|
};
|
|
1551
1580
|
|
|
1581
|
+
declare type GlobalDateComparisonSelection = {
|
|
1582
|
+
mode: 'off';
|
|
1583
|
+
} | {
|
|
1584
|
+
mode: 'period';
|
|
1585
|
+
spec: ViewerPeriodComparisonSpec;
|
|
1586
|
+
};
|
|
1587
|
+
|
|
1552
1588
|
declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
|
|
1553
1589
|
|
|
1554
1590
|
declare interface GroupByColumn extends BaseColumn {
|
|
@@ -1684,7 +1720,12 @@ declare interface JoinPlan {
|
|
|
1684
1720
|
export declare type KPICardProps = {
|
|
1685
1721
|
card: TCard;
|
|
1686
1722
|
isLoading?: boolean;
|
|
1687
|
-
renderFilterInfo?: () =>
|
|
1723
|
+
renderFilterInfo?: () => JSX.Element | null;
|
|
1724
|
+
};
|
|
1725
|
+
|
|
1726
|
+
export declare type LensInputValuesSnapshot = {
|
|
1727
|
+
generatedAt: string;
|
|
1728
|
+
dashboardInputValues: DashboardInputValues;
|
|
1688
1729
|
};
|
|
1689
1730
|
|
|
1690
1731
|
export declare type Level = 'database' | 'schema' | 'table';
|
|
@@ -1709,6 +1750,30 @@ declare interface MetricColumn extends BaseColumn {
|
|
|
1709
1750
|
aliasTemplate?: string;
|
|
1710
1751
|
}
|
|
1711
1752
|
|
|
1753
|
+
declare type MetricComparisonConfig = {
|
|
1754
|
+
mode: 'off';
|
|
1755
|
+
} | {
|
|
1756
|
+
mode: 'explicit';
|
|
1757
|
+
spec: MetricComparisonSpec;
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
declare type MetricComparisonPolarity = 'higher_is_better' | 'lower_is_better' | 'neutral';
|
|
1761
|
+
|
|
1762
|
+
declare type MetricComparisonSpec = {
|
|
1763
|
+
kind: 'previous_period';
|
|
1764
|
+
offsetPeriods?: number;
|
|
1765
|
+
alignment?: 'calendar' | 'weekday';
|
|
1766
|
+
toDate?: boolean;
|
|
1767
|
+
} | {
|
|
1768
|
+
kind: 'previous_year';
|
|
1769
|
+
offsetYears?: number;
|
|
1770
|
+
alignment?: 'calendar' | 'weekday';
|
|
1771
|
+
toDate?: boolean;
|
|
1772
|
+
} | {
|
|
1773
|
+
kind: 'target';
|
|
1774
|
+
targetValue: number;
|
|
1775
|
+
};
|
|
1776
|
+
|
|
1712
1777
|
declare interface MetricField extends Field {
|
|
1713
1778
|
role: 'metric';
|
|
1714
1779
|
aggregate?: AggregateFunction;
|
|
@@ -1757,9 +1822,10 @@ declare interface MetricField extends Field {
|
|
|
1757
1822
|
* pre-aggregated metric input.
|
|
1758
1823
|
*/
|
|
1759
1824
|
isPreAggregated?: boolean;
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1825
|
+
comparison?: MetricComparisonConfig;
|
|
1826
|
+
comparisonPolarity?: MetricComparisonPolarity;
|
|
1827
|
+
/** Governed runtime annotation. When present, authoring polarity is read-only. */
|
|
1828
|
+
semanticComparisonPolarity?: MetricComparisonPolarity;
|
|
1763
1829
|
}
|
|
1764
1830
|
|
|
1765
1831
|
declare type NoneOptions = {};
|
|
@@ -1895,6 +1961,7 @@ export declare type ResolvedDashboardInput = {
|
|
|
1895
1961
|
control?: ControlDefinition;
|
|
1896
1962
|
controlValue?: unknown;
|
|
1897
1963
|
missingRequiredValue?: boolean;
|
|
1964
|
+
comparisonSelection?: GlobalDateComparisonSelection;
|
|
1898
1965
|
};
|
|
1899
1966
|
|
|
1900
1967
|
export declare type ResolvedDashboardInputContext = {
|
|
@@ -1906,6 +1973,7 @@ export declare type ResolvedDashboardInputContext = {
|
|
|
1906
1973
|
controlBindings: ControlBinding[];
|
|
1907
1974
|
controlValues: Record<string, unknown>;
|
|
1908
1975
|
variablesByName: Record<string, ResolvedDashboardInput>;
|
|
1976
|
+
globalDateComparisonSelection?: GlobalDateComparisonSelection;
|
|
1909
1977
|
variablesById: Record<string, ResolvedDashboardInput>;
|
|
1910
1978
|
missingRequiredInputs: ResolvedDashboardInput[];
|
|
1911
1979
|
};
|
|
@@ -2651,6 +2719,11 @@ export declare type TCardContext = {
|
|
|
2651
2719
|
};
|
|
2652
2720
|
|
|
2653
2721
|
export declare type TCardPreferences = {
|
|
2722
|
+
comparisonPresentation?: ComparisonPresentationSpec;
|
|
2723
|
+
/** Absence means eligible metrics inherit the Global Date comparison. */
|
|
2724
|
+
inheritGlobalComparison?: false;
|
|
2725
|
+
/** Separate two-metric KPI feature; defaults to false. */
|
|
2726
|
+
metricPairComparisonEnabled?: boolean;
|
|
2654
2727
|
onClickFilter?: FilterOnClick[];
|
|
2655
2728
|
filterOnClick?: boolean;
|
|
2656
2729
|
filterOnClickField?: string;
|
|
@@ -2723,43 +2796,14 @@ export declare type TCardPreferences = {
|
|
|
2723
2796
|
colorScale?: string;
|
|
2724
2797
|
};
|
|
2725
2798
|
kpiVisualOptions?: {
|
|
2726
|
-
lowerIsBetter?: boolean;
|
|
2727
2799
|
countryLogoId?: string;
|
|
2728
2800
|
valueAlignment?: 'left' | 'center';
|
|
2729
2801
|
formatOptions?: TFormatOptions;
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
showColor?: boolean;
|
|
2736
|
-
conditionalLabel?: boolean;
|
|
2737
|
-
labelName?: string;
|
|
2738
|
-
position?: 'left' | 'right' | 'top';
|
|
2739
|
-
conditionalLabels?: {
|
|
2740
|
-
increase?: string;
|
|
2741
|
-
decrease?: string;
|
|
2742
|
-
noChange?: string;
|
|
2743
|
-
};
|
|
2744
|
-
colorConfig?: {
|
|
2745
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2746
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2747
|
-
noChange?: 'green' | 'red' | 'neutral' | string;
|
|
2748
|
-
};
|
|
2749
|
-
};
|
|
2750
|
-
};
|
|
2751
|
-
tableVisualOptions?: {
|
|
2752
|
-
metricComparison?: {
|
|
2753
|
-
calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
|
|
2754
|
-
indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
|
|
2755
|
-
formatOptions?: TFormatOptions;
|
|
2756
|
-
colors?: {
|
|
2757
|
-
increase?: 'green' | 'red' | 'neutral' | string;
|
|
2758
|
-
decrease?: 'green' | 'red' | 'neutral' | string;
|
|
2759
|
-
neutral?: 'green' | 'red' | 'neutral' | string;
|
|
2760
|
-
};
|
|
2761
|
-
lowerIsBetter?: boolean;
|
|
2762
|
-
};
|
|
2802
|
+
/**
|
|
2803
|
+
* Presentation-only polarity for a query-backed KPI's manually returned
|
|
2804
|
+
* current/prior value pair. Governed KPIs use per-metric polarity instead.
|
|
2805
|
+
*/
|
|
2806
|
+
queryComparisonPolarity?: MetricComparisonPolarity;
|
|
2763
2807
|
};
|
|
2764
2808
|
pivotTableOptions?: {
|
|
2765
2809
|
showRowTotals?: boolean;
|
|
@@ -3248,7 +3292,8 @@ export declare type TLens = {
|
|
|
3248
3292
|
id: string;
|
|
3249
3293
|
name: string;
|
|
3250
3294
|
template?: string;
|
|
3251
|
-
filterValues?: TFilterValue[];
|
|
3295
|
+
filterValues?: TFilterValue[] | null;
|
|
3296
|
+
inputValues?: LensInputValuesSnapshot | null;
|
|
3252
3297
|
isDefault?: boolean;
|
|
3253
3298
|
shared?: boolean;
|
|
3254
3299
|
};
|
|
@@ -3338,6 +3383,10 @@ export declare interface UserPreference {
|
|
|
3338
3383
|
updatedAt: string;
|
|
3339
3384
|
}
|
|
3340
3385
|
|
|
3386
|
+
declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
|
|
3387
|
+
kind: 'previous_period' | 'previous_year';
|
|
3388
|
+
}>;
|
|
3389
|
+
|
|
3341
3390
|
/**
|
|
3342
3391
|
* Display mode for visual components - controls which UI elements are shown
|
|
3343
3392
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ReactRuntime from 'react';
|
|
2
2
|
|
|
3
3
|
export declare type ApiStatus = {
|
|
4
4
|
ok: boolean;
|
|
@@ -169,7 +169,7 @@ export declare type BuilderTurnResult = {
|
|
|
169
169
|
error?: string;
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
export declare function DataAppBuilder({ projectId, projectName, dataAppId, apiServiceUrl, adapters, }: DataAppBuilderProps): JSX.Element;
|
|
172
|
+
export declare function DataAppBuilder({ projectId, projectName, dataAppId, apiServiceUrl, adapters, }: DataAppBuilderProps): ReactRuntime.JSX.Element;
|
|
173
173
|
|
|
174
174
|
export declare type DataAppBuilderAdapters = {
|
|
175
175
|
readStatus?: (options: {
|