drizzle-cube 0.2.5 → 0.2.8
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/client/charts.js +15 -15
- package/dist/client/chunks/{chart-activitygridchart-BzL97Vnm.js → chart-activitygridchart-Cz4bEf3V.js} +219 -217
- package/dist/client/chunks/chart-activitygridchart-Cz4bEf3V.js.map +1 -0
- package/dist/client/chunks/{chart-activitygridchart-config-48WqIofo.js → chart-activitygridchart-config-BngZDVh_.js} +96 -90
- package/dist/client/chunks/chart-activitygridchart-config-BngZDVh_.js.map +1 -0
- package/dist/client/chunks/{chart-areachart-BtH3SvAM.js → chart-areachart-DLdolSnU.js} +3 -3
- package/dist/client/chunks/{chart-areachart-BtH3SvAM.js.map → chart-areachart-DLdolSnU.js.map} +1 -1
- package/dist/client/chunks/{chart-areachart-config-D8taXdn1.js → chart-areachart-config-DWN1E5ej.js} +2 -2
- package/dist/client/chunks/{chart-areachart-config-D8taXdn1.js.map → chart-areachart-config-DWN1E5ej.js.map} +1 -1
- package/dist/client/chunks/chart-barchart-Bdjz8DJp.js +171 -0
- package/dist/client/chunks/chart-barchart-Bdjz8DJp.js.map +1 -0
- package/dist/client/chunks/{chart-barchart-config-DjRZBtLb.js → chart-barchart-config-DZA0xTns.js} +2 -2
- package/dist/client/chunks/{chart-barchart-config-DjRZBtLb.js.map → chart-barchart-config-DZA0xTns.js.map} +1 -1
- package/dist/client/chunks/{chart-bubblechart-Lj_PnppP.js → chart-bubblechart-BlQkmqkI.js} +2 -2
- package/dist/client/chunks/{chart-bubblechart-Lj_PnppP.js.map → chart-bubblechart-BlQkmqkI.js.map} +1 -1
- package/dist/client/chunks/{chart-bubblechart-config-C6ck2qmg.js → chart-bubblechart-config-C79lfDSO.js} +2 -2
- package/dist/client/chunks/{chart-bubblechart-config-C6ck2qmg.js.map → chart-bubblechart-config-C79lfDSO.js.map} +1 -1
- package/dist/client/chunks/{chart-charttooltip-D9BKscsw.js → chart-charttooltip-k8soCd2n.js} +2 -2
- package/dist/client/chunks/{chart-charttooltip-D9BKscsw.js.map → chart-charttooltip-k8soCd2n.js.map} +1 -1
- package/dist/client/chunks/chart-datatable-Mo4gYCwa.js +249 -0
- package/dist/client/chunks/chart-datatable-Mo4gYCwa.js.map +1 -0
- package/dist/client/chunks/{chart-datatable-config-B5z0SlOJ.js → chart-datatable-config-DqGw99R3.js} +2 -2
- package/dist/client/chunks/{chart-datatable-config-B5z0SlOJ.js.map → chart-datatable-config-DqGw99R3.js.map} +1 -1
- package/dist/client/chunks/{chart-kpidelta-Bx-stIIk.js → chart-kpidelta-CTcuIO9G.js} +3 -3
- package/dist/client/chunks/{chart-kpidelta-Bx-stIIk.js.map → chart-kpidelta-CTcuIO9G.js.map} +1 -1
- package/dist/client/chunks/{chart-kpidelta-config-CnZfi_P2.js → chart-kpidelta-config-B-Y-LHmd.js} +2 -2
- package/dist/client/chunks/{chart-kpidelta-config-CnZfi_P2.js.map → chart-kpidelta-config-B-Y-LHmd.js.map} +1 -1
- package/dist/client/chunks/{chart-kpinumber-config-CVikHojM.js → chart-kpinumber-config-BaNaJMI6.js} +2 -2
- package/dist/client/chunks/{chart-kpinumber-config-CVikHojM.js.map → chart-kpinumber-config-BaNaJMI6.js.map} +1 -1
- package/dist/client/chunks/{chart-kpinumber-BrXgyKGP.js → chart-kpinumber-slEXt8C-.js} +5 -5
- package/dist/client/chunks/{chart-kpinumber-BrXgyKGP.js.map → chart-kpinumber-slEXt8C-.js.map} +1 -1
- package/dist/client/chunks/{chart-kpitext-config-B2MovXSw.js → chart-kpitext-config-BNywYqEW.js} +2 -2
- package/dist/client/chunks/{chart-kpitext-config-B2MovXSw.js.map → chart-kpitext-config-BNywYqEW.js.map} +1 -1
- package/dist/client/chunks/{chart-kpitext-_2tnYN_z.js → chart-kpitext-giq03TOK.js} +3 -3
- package/dist/client/chunks/{chart-kpitext-_2tnYN_z.js.map → chart-kpitext-giq03TOK.js.map} +1 -1
- package/dist/client/chunks/{chart-linechart-DBdIULsM.js → chart-linechart-BfnU6L-D.js} +4 -4
- package/dist/client/chunks/{chart-linechart-DBdIULsM.js.map → chart-linechart-BfnU6L-D.js.map} +1 -1
- package/dist/client/chunks/{chart-linechart-config-CVBVB7nS.js → chart-linechart-config-BL_1mjHF.js} +2 -2
- package/dist/client/chunks/{chart-linechart-config-CVBVB7nS.js.map → chart-linechart-config-BL_1mjHF.js.map} +1 -1
- package/dist/client/chunks/{chart-markdownchart-config-Cq5Sxrgq.js → chart-markdownchart-config-DtZOfYu4.js} +2 -2
- package/dist/client/chunks/{chart-markdownchart-config-Cq5Sxrgq.js.map → chart-markdownchart-config-DtZOfYu4.js.map} +1 -1
- package/dist/client/chunks/{chart-piechart-CzesCpZ_.js → chart-piechart-CZRDQxeB.js} +3 -3
- package/dist/client/chunks/{chart-piechart-CzesCpZ_.js.map → chart-piechart-CZRDQxeB.js.map} +1 -1
- package/dist/client/chunks/{chart-piechart-config-Bdd31Gdi.js → chart-piechart-config-Bg4jeIFo.js} +2 -2
- package/dist/client/chunks/{chart-piechart-config-Bdd31Gdi.js.map → chart-piechart-config-Bg4jeIFo.js.map} +1 -1
- package/dist/client/chunks/{chart-radarchart-B3WUEiTh.js → chart-radarchart-D5yRnY9j.js} +3 -3
- package/dist/client/chunks/{chart-radarchart-B3WUEiTh.js.map → chart-radarchart-D5yRnY9j.js.map} +1 -1
- package/dist/client/chunks/{chart-radarchart-config-BWyfn0ij.js → chart-radarchart-config-d6dLkI7B.js} +2 -2
- package/dist/client/chunks/{chart-radarchart-config-BWyfn0ij.js.map → chart-radarchart-config-d6dLkI7B.js.map} +1 -1
- package/dist/client/chunks/{chart-radialbarchart-DBiRcLd9.js → chart-radialbarchart-Djtcn7aH.js} +3 -3
- package/dist/client/chunks/{chart-radialbarchart-DBiRcLd9.js.map → chart-radialbarchart-Djtcn7aH.js.map} +1 -1
- package/dist/client/chunks/{chart-radialbarchart-config-lU2_NQCD.js → chart-radialbarchart-config-BGf97-BV.js} +2 -2
- package/dist/client/chunks/{chart-radialbarchart-config-lU2_NQCD.js.map → chart-radialbarchart-config-BGf97-BV.js.map} +1 -1
- package/dist/client/chunks/{chart-scatterchart-C_D9OqA1.js → chart-scatterchart-C83KgqYY.js} +2 -2
- package/dist/client/chunks/{chart-scatterchart-C_D9OqA1.js.map → chart-scatterchart-C83KgqYY.js.map} +1 -1
- package/dist/client/chunks/{chart-scatterchart-config-DtLnut1M.js → chart-scatterchart-config-DEIB74ot.js} +2 -2
- package/dist/client/chunks/{chart-scatterchart-config-DtLnut1M.js.map → chart-scatterchart-config-DEIB74ot.js.map} +1 -1
- package/dist/client/chunks/{chart-treemapchart-DJqy3Sy7.js → chart-treemapchart-BDKnKGTz.js} +3 -3
- package/dist/client/chunks/{chart-treemapchart-DJqy3Sy7.js.map → chart-treemapchart-BDKnKGTz.js.map} +1 -1
- package/dist/client/chunks/{chart-treemapchart-config-BEiIWQnR.js → chart-treemapchart-config-ppKPTB96.js} +2 -2
- package/dist/client/chunks/{chart-treemapchart-config-BEiIWQnR.js.map → chart-treemapchart-config-ppKPTB96.js.map} +1 -1
- package/dist/client/chunks/{charts-DFbr7EGW.js → charts-MJLpxe3r.js} +42 -42
- package/dist/client/chunks/{charts-DFbr7EGW.js.map → charts-MJLpxe3r.js.map} +1 -1
- package/dist/client/chunks/components-CXA6-jJq.js +9845 -0
- package/dist/client/chunks/components-CXA6-jJq.js.map +1 -0
- package/dist/client/chunks/{icons-D6z-_9sa.js → icons-B2XSxpVK.js} +213 -181
- package/dist/client/chunks/icons-B2XSxpVK.js.map +1 -0
- package/dist/client/chunks/{index-_pVwmFVW.js → index-CSeLP8gq.js} +2 -2
- package/dist/client/chunks/{index-_pVwmFVW.js.map → index-CSeLP8gq.js.map} +1 -1
- package/dist/client/components/AnalysisBuilder/AnalysisAxisDropZone.d.ts +27 -0
- package/dist/client/components/AnalysisBuilder/AnalysisChartConfigPanel.d.ts +21 -0
- package/dist/client/components/AnalysisBuilder/AnalysisFilterGroup.d.ts +20 -0
- package/dist/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +16 -0
- package/dist/client/components/AnalysisBuilder/AnalysisFilterSection.d.ts +12 -0
- package/dist/client/components/AnalysisBuilder/AnalysisQueryPanel.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/AnalysisResultsPanel.d.ts +12 -0
- package/dist/client/components/AnalysisBuilder/BreakdownItemCard.d.ts +10 -0
- package/dist/client/components/AnalysisBuilder/BreakdownSection.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/FieldDetailPanel.d.ts +4 -0
- package/dist/client/components/AnalysisBuilder/FieldSearchItem.d.ts +6 -0
- package/dist/client/components/AnalysisBuilder/FieldSearchModal.d.ts +2 -0
- package/dist/client/components/AnalysisBuilder/MetricItemCard.d.ts +9 -0
- package/dist/client/components/AnalysisBuilder/MetricsSection.d.ts +8 -0
- package/dist/client/components/AnalysisBuilder/index.d.ts +3 -0
- package/dist/client/components/AnalysisBuilder/types.d.ts +366 -0
- package/dist/client/components/AnalysisBuilder/utils.d.ts +103 -0
- package/dist/client/components/ChartTypeSelector.d.ts +6 -1
- package/dist/client/components/DashboardGrid.d.ts +3 -2
- package/dist/client/components/DashboardPortletCard.d.ts +63 -0
- package/dist/client/components/QueryBuilder/CubeMetaExplorer.d.ts +2 -2
- package/dist/client/components/QueryBuilder/QueryPanel.d.ts +2 -2
- package/dist/client/components/QueryBuilder/types.d.ts +7 -138
- package/dist/client/components/RowManagedLayout.d.ts +19 -0
- package/dist/client/components/charts/DataTable.d.ts +1 -1
- package/dist/client/components.js +16 -9148
- package/dist/client/components.js.map +1 -1
- package/dist/client/hooks.js +2 -2
- package/dist/client/icons/types.d.ts +6 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +3202 -49
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers/CubeProvider.d.ts +4 -2
- package/dist/client/providers.js +1 -1
- package/dist/client/shared/chartDefaults.d.ts +64 -0
- package/dist/client/shared/components/QueryAnalysisPanel.d.ts +7 -0
- package/dist/client/shared/index.d.ts +10 -0
- package/dist/client/shared/types.d.ts +134 -0
- package/dist/client/shared/utils.d.ts +101 -0
- package/dist/client/styles.css +1 -1
- package/dist/client/types.d.ts +20 -0
- package/dist/client/utils/index.d.ts +1 -0
- package/dist/client/utils/pivotUtils.d.ts +78 -0
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +1 -1
- package/dist/client/chunks/chart-activitygridchart-BzL97Vnm.js.map +0 -1
- package/dist/client/chunks/chart-activitygridchart-config-48WqIofo.js.map +0 -1
- package/dist/client/chunks/chart-barchart-DX6DIoIp.js +0 -177
- package/dist/client/chunks/chart-barchart-DX6DIoIp.js.map +0 -1
- package/dist/client/chunks/chart-datatable-BaECYDn2.js +0 -57
- package/dist/client/chunks/chart-datatable-BaECYDn2.js.map +0 -1
- package/dist/client/chunks/icons-D6z-_9sa.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AxisDropZoneConfig } from '../../charts/chartConfigs';
|
|
3
|
+
interface FieldMeta {
|
|
4
|
+
title?: string;
|
|
5
|
+
shortTitle?: string;
|
|
6
|
+
cubeName: string;
|
|
7
|
+
type: 'measure' | 'dimension' | 'timeDimension';
|
|
8
|
+
measureType?: string;
|
|
9
|
+
}
|
|
10
|
+
interface AnalysisAxisDropZoneProps {
|
|
11
|
+
config: AxisDropZoneConfig;
|
|
12
|
+
fields: string[];
|
|
13
|
+
onDrop: (e: React.DragEvent<HTMLDivElement>, toKey: string) => void;
|
|
14
|
+
onRemove: (field: string, fromKey: string) => void;
|
|
15
|
+
onDragStart: (e: React.DragEvent<HTMLDivElement>, field: string, fromKey: string, fromIndex?: number) => void;
|
|
16
|
+
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
17
|
+
onDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
18
|
+
onReorder?: (fromIndex: number, toIndex: number, axisKey: string) => void;
|
|
19
|
+
draggedItem?: {
|
|
20
|
+
field: string;
|
|
21
|
+
fromAxis: string;
|
|
22
|
+
fromIndex?: number;
|
|
23
|
+
} | null;
|
|
24
|
+
getFieldMeta?: (field: string) => FieldMeta;
|
|
25
|
+
}
|
|
26
|
+
export default function AnalysisAxisDropZone({ config, fields, onDrop, onRemove, onDragStart, onDragEnd, onDragOver, onReorder, draggedItem, getFieldMeta }: AnalysisAxisDropZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartType, ChartAxisConfig, ChartDisplayConfig, ColorPalette } from '../../types';
|
|
2
|
+
import { MetricItem, BreakdownItem } from './types';
|
|
3
|
+
import { ChartAvailabilityMap } from '../../shared/chartDefaults';
|
|
4
|
+
import { MetaResponse } from '../../shared/types';
|
|
5
|
+
interface AnalysisChartConfigPanelProps {
|
|
6
|
+
chartType: ChartType;
|
|
7
|
+
chartConfig: ChartAxisConfig;
|
|
8
|
+
displayConfig: ChartDisplayConfig;
|
|
9
|
+
metrics: MetricItem[];
|
|
10
|
+
breakdowns: BreakdownItem[];
|
|
11
|
+
colorPalette?: ColorPalette;
|
|
12
|
+
/** Schema metadata for resolving field titles */
|
|
13
|
+
schema?: MetaResponse | null;
|
|
14
|
+
/** Map of chart type availability for disabling unavailable chart types */
|
|
15
|
+
chartAvailability?: ChartAvailabilityMap;
|
|
16
|
+
onChartTypeChange: (type: ChartType) => void;
|
|
17
|
+
onChartConfigChange: (config: ChartAxisConfig) => void;
|
|
18
|
+
onDisplayConfigChange: (config: ChartDisplayConfig) => void;
|
|
19
|
+
}
|
|
20
|
+
export default function AnalysisChartConfigPanel({ chartType, chartConfig, displayConfig, metrics, breakdowns, colorPalette, schema, chartAvailability, onChartTypeChange, onChartConfigChange, onDisplayConfigChange }: AnalysisChartConfigPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GroupFilter } from '../../types';
|
|
2
|
+
import { MetaResponse } from '../../shared/types';
|
|
3
|
+
interface AnalysisFilterGroupProps {
|
|
4
|
+
/** The group filter to render */
|
|
5
|
+
group: GroupFilter;
|
|
6
|
+
/** Schema for field metadata */
|
|
7
|
+
schema: MetaResponse | null;
|
|
8
|
+
/** Callback when group changes */
|
|
9
|
+
onUpdate: (group: GroupFilter) => void;
|
|
10
|
+
/** Callback to remove this group */
|
|
11
|
+
onRemove: () => void;
|
|
12
|
+
/** Callback to add a new filter - receives path relative to this group */
|
|
13
|
+
onAddFilter: (relativePath?: number[]) => void;
|
|
14
|
+
/** Depth level for styling */
|
|
15
|
+
depth?: number;
|
|
16
|
+
/** Whether to hide the remove button (for top-level groups) */
|
|
17
|
+
hideRemoveButton?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export default function AnalysisFilterGroup({ group, schema, onUpdate, onRemove, onAddFilter, depth, hideRemoveButton }: AnalysisFilterGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SimpleFilter } from '../../types';
|
|
2
|
+
import { MetaResponse } from '../../shared/types';
|
|
3
|
+
interface AnalysisFilterItemProps {
|
|
4
|
+
/** The filter to display */
|
|
5
|
+
filter: SimpleFilter;
|
|
6
|
+
/** Schema for field metadata */
|
|
7
|
+
schema: MetaResponse | null;
|
|
8
|
+
/** Callback to remove this filter */
|
|
9
|
+
onRemove: () => void;
|
|
10
|
+
/** Callback to update this filter */
|
|
11
|
+
onUpdate: (filter: SimpleFilter) => void;
|
|
12
|
+
/** Optional depth for nested styling */
|
|
13
|
+
depth?: number;
|
|
14
|
+
}
|
|
15
|
+
export default function AnalysisFilterItem({ filter, schema, onRemove, onUpdate, depth }: AnalysisFilterItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Filter } from '../../types';
|
|
2
|
+
import { MetaResponse } from '../../shared/types';
|
|
3
|
+
interface AnalysisFilterSectionProps {
|
|
4
|
+
/** Current filters */
|
|
5
|
+
filters: Filter[];
|
|
6
|
+
/** Schema for field metadata */
|
|
7
|
+
schema: MetaResponse | null;
|
|
8
|
+
/** Callback when filters change */
|
|
9
|
+
onFiltersChange: (filters: Filter[]) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function AnalysisFilterSection({ filters, schema, onFiltersChange }: AnalysisFilterSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnalysisQueryPanelProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* AnalysisQueryPanel displays the right-side query builder with:
|
|
4
|
+
* - Query/Chart tab switcher
|
|
5
|
+
* - Metrics section (measures)
|
|
6
|
+
* - Filter section
|
|
7
|
+
* - Breakdown section (dimensions)
|
|
8
|
+
* - Chart configuration (in Chart tab)
|
|
9
|
+
*/
|
|
10
|
+
export default function AnalysisQueryPanel({ metrics, breakdowns, filters, schema, activeTab, onActiveTabChange, onAddMetric, onRemoveMetric, onAddBreakdown, onRemoveBreakdown, onBreakdownGranularityChange, onFiltersChange, order, onOrderChange, chartType, chartConfig, displayConfig, chartAvailability, onChartTypeChange, onChartConfigChange, onDisplayConfigChange }: AnalysisQueryPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnalysisResultsPanelProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* AnalysisResultsPanel displays query results with chart/table toggle.
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Chart visualization with LazyChart
|
|
7
|
+
* - Table view with DataTable
|
|
8
|
+
* - Loading, error, and empty states
|
|
9
|
+
* - Stale results indicator
|
|
10
|
+
* - Display limit control for tables
|
|
11
|
+
*/
|
|
12
|
+
export default function AnalysisResultsPanel({ executionStatus, executionResults, executionError, totalRowCount, resultsStale, chartType, chartConfig, displayConfig, query, activeView, onActiveViewChange, displayLimit, onDisplayLimitChange, hasMetrics, debugQuery, debugSql, debugAnalysis, debugLoading, debugError }: AnalysisResultsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BreakdownItemCardProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* BreakdownItemCard displays a selected breakdown with:
|
|
4
|
+
* - Field icon (dimension or time dimension)
|
|
5
|
+
* - Field title or full name
|
|
6
|
+
* - Granularity dropdown (for time dimensions)
|
|
7
|
+
* - Sort toggle button (visible on hover, or always visible when sorted)
|
|
8
|
+
* - Remove button (visible on hover)
|
|
9
|
+
*/
|
|
10
|
+
export default function BreakdownItemCard({ breakdown, fieldMeta, onRemove, onGranularityChange, sortDirection, sortPriority, onToggleSort }: BreakdownItemCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BreakdownSectionProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* BreakdownSection displays a collapsible section with:
|
|
4
|
+
* - Header with title and add button
|
|
5
|
+
* - List of selected breakdowns (using BreakdownItemCard)
|
|
6
|
+
* - Empty state with add button
|
|
7
|
+
*/
|
|
8
|
+
export default function BreakdownSection({ breakdowns, schema, onAdd, onRemove, onGranularityChange, order, onOrderChange }: BreakdownSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FieldDetailPanelProps } from './types';
|
|
2
|
+
declare function FieldDetailPanel({ field }: FieldDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const _default: import('react').MemoExoticComponent<typeof FieldDetailPanel>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FieldSearchItemProps } from './types';
|
|
2
|
+
declare function FieldSearchItem({ field, isSelected, isFocused, onClick, onMouseEnter, ...props }: FieldSearchItemProps & {
|
|
3
|
+
'data-field-index'?: number;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const _default: import('react').MemoExoticComponent<typeof FieldSearchItem>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MetricItemCardProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* MetricItemCard displays a selected metric with:
|
|
4
|
+
* - Field icon based on measure type
|
|
5
|
+
* - Field title or full name
|
|
6
|
+
* - Sort toggle button (visible on hover, or always visible when sorted)
|
|
7
|
+
* - Remove button (visible on hover)
|
|
8
|
+
*/
|
|
9
|
+
export default function MetricItemCard({ metric, fieldMeta, onRemove, sortDirection, sortPriority, onToggleSort }: MetricItemCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MetricsSectionProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* MetricsSection displays a collapsible section with:
|
|
4
|
+
* - Header with title and add button
|
|
5
|
+
* - List of selected metrics (using MetricItemCard)
|
|
6
|
+
* - Empty state with add button
|
|
7
|
+
*/
|
|
8
|
+
export default function MetricsSection({ metrics, schema, onAdd, onRemove, order, onOrderChange }: MetricsSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeQuery, Filter, ChartType, ChartAxisConfig, ChartDisplayConfig } from '../../types';
|
|
3
|
+
import { MetaResponse, MetaField, MetaCube, QueryAnalysis } from '../../shared/types';
|
|
4
|
+
import { ChartAvailabilityMap } from '../../shared/chartDefaults';
|
|
5
|
+
export type { MetaResponse, MetaField, MetaCube, QueryAnalysis };
|
|
6
|
+
/**
|
|
7
|
+
* A selected metric (measure) with a letter label (A, B, C, ...)
|
|
8
|
+
*/
|
|
9
|
+
export interface MetricItem {
|
|
10
|
+
/** Unique identifier for this metric selection */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Full field name, e.g., "Employees.count" */
|
|
13
|
+
field: string;
|
|
14
|
+
/** Display label (A, B, C, ...) */
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A selected breakdown (dimension or time dimension)
|
|
19
|
+
*/
|
|
20
|
+
export interface BreakdownItem {
|
|
21
|
+
/** Unique identifier for this breakdown selection */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Full field name, e.g., "Employees.departmentName" */
|
|
24
|
+
field: string;
|
|
25
|
+
/** Granularity for time dimensions (day, week, month, quarter, year) */
|
|
26
|
+
granularity?: string;
|
|
27
|
+
/** Whether this is a time dimension */
|
|
28
|
+
isTimeDimension: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Validation status for query building */
|
|
31
|
+
export type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid';
|
|
32
|
+
/** Execution status for query results */
|
|
33
|
+
export type ExecutionStatus = 'idle' | 'loading' | 'refreshing' | 'success' | 'error';
|
|
34
|
+
/**
|
|
35
|
+
* Main state for the AnalysisBuilder component
|
|
36
|
+
*/
|
|
37
|
+
export interface AnalysisBuilderState {
|
|
38
|
+
/** Selected metrics (measures) */
|
|
39
|
+
metrics: MetricItem[];
|
|
40
|
+
/** Selected breakdowns (dimensions and time dimensions) */
|
|
41
|
+
breakdowns: BreakdownItem[];
|
|
42
|
+
/** Applied filters */
|
|
43
|
+
filters: Filter[];
|
|
44
|
+
validationStatus: ValidationStatus;
|
|
45
|
+
validationError: string | null;
|
|
46
|
+
executionStatus: ExecutionStatus;
|
|
47
|
+
executionResults: any[] | null;
|
|
48
|
+
executionError: string | null;
|
|
49
|
+
totalRowCount: number | null;
|
|
50
|
+
resultsStale: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Mode for the field search modal - determines which field types are shown
|
|
54
|
+
*/
|
|
55
|
+
export type FieldSearchMode = 'metrics' | 'breakdown' | 'filter';
|
|
56
|
+
/**
|
|
57
|
+
* Field type categorization
|
|
58
|
+
*/
|
|
59
|
+
export type FieldType = 'measure' | 'dimension' | 'timeDimension';
|
|
60
|
+
/**
|
|
61
|
+
* A field option for display in the search modal
|
|
62
|
+
*/
|
|
63
|
+
export interface FieldOption {
|
|
64
|
+
/** Full field name, e.g., "Employees.count" */
|
|
65
|
+
name: string;
|
|
66
|
+
/** Display title */
|
|
67
|
+
title: string;
|
|
68
|
+
/** Short title for compact display */
|
|
69
|
+
shortTitle: string;
|
|
70
|
+
/** Field type (count, sum, avg, string, time, number, etc.) */
|
|
71
|
+
type: string;
|
|
72
|
+
/** Optional description */
|
|
73
|
+
description?: string;
|
|
74
|
+
/** Parent cube name */
|
|
75
|
+
cubeName: string;
|
|
76
|
+
/** Categorized field type */
|
|
77
|
+
fieldType: FieldType;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Props for the FieldSearchModal component
|
|
81
|
+
*/
|
|
82
|
+
export interface FieldSearchModalProps {
|
|
83
|
+
/** Whether the modal is open */
|
|
84
|
+
isOpen: boolean;
|
|
85
|
+
/** Callback to close the modal */
|
|
86
|
+
onClose: () => void;
|
|
87
|
+
/** Callback when a field is selected. keepOpen=true when shift-click multi-selecting */
|
|
88
|
+
onSelect: (field: MetaField, fieldType: FieldType, cubeName: string, keepOpen?: boolean) => void;
|
|
89
|
+
/** Mode determines which field types to show */
|
|
90
|
+
mode: FieldSearchMode;
|
|
91
|
+
/** Schema metadata */
|
|
92
|
+
schema: MetaResponse | null;
|
|
93
|
+
/** Already selected field names (to show checkmarks) */
|
|
94
|
+
selectedFields: string[];
|
|
95
|
+
/** Recently used field names */
|
|
96
|
+
recentFields?: string[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Props for the FieldSearchItem component
|
|
100
|
+
*/
|
|
101
|
+
export interface FieldSearchItemProps {
|
|
102
|
+
/** Field data */
|
|
103
|
+
field: FieldOption;
|
|
104
|
+
/** Whether this field is selected */
|
|
105
|
+
isSelected: boolean;
|
|
106
|
+
/** Whether this field is focused/highlighted */
|
|
107
|
+
isFocused: boolean;
|
|
108
|
+
/** Click handler - receives mouse event for shift-click multi-select */
|
|
109
|
+
onClick: (e: React.MouseEvent) => void;
|
|
110
|
+
/** Mouse enter handler (for detail panel) */
|
|
111
|
+
onMouseEnter: () => void;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Props for the FieldDetailPanel component
|
|
115
|
+
*/
|
|
116
|
+
export interface FieldDetailPanelProps {
|
|
117
|
+
/** Field to display details for */
|
|
118
|
+
field: FieldOption | null;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Tab options for the query panel
|
|
122
|
+
*/
|
|
123
|
+
export type QueryPanelTab = 'query' | 'chart';
|
|
124
|
+
/**
|
|
125
|
+
* Props for the AnalysisQueryPanel component
|
|
126
|
+
*/
|
|
127
|
+
export interface AnalysisQueryPanelProps {
|
|
128
|
+
/** Selected metrics */
|
|
129
|
+
metrics: MetricItem[];
|
|
130
|
+
/** Selected breakdowns */
|
|
131
|
+
breakdowns: BreakdownItem[];
|
|
132
|
+
/** Applied filters */
|
|
133
|
+
filters: Filter[];
|
|
134
|
+
/** Schema metadata */
|
|
135
|
+
schema: MetaResponse | null;
|
|
136
|
+
/** Currently active tab */
|
|
137
|
+
activeTab: QueryPanelTab;
|
|
138
|
+
/** Callback when active tab changes */
|
|
139
|
+
onActiveTabChange: (tab: QueryPanelTab) => void;
|
|
140
|
+
onAddMetric: () => void;
|
|
141
|
+
onRemoveMetric: (id: string) => void;
|
|
142
|
+
onAddBreakdown: () => void;
|
|
143
|
+
onRemoveBreakdown: (id: string) => void;
|
|
144
|
+
onBreakdownGranularityChange: (id: string, granularity: string) => void;
|
|
145
|
+
onFiltersChange: (filters: Filter[]) => void;
|
|
146
|
+
/** Current sort order */
|
|
147
|
+
order?: Record<string, 'asc' | 'desc'>;
|
|
148
|
+
/** Callback when sort order changes */
|
|
149
|
+
onOrderChange: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
|
|
150
|
+
chartType: ChartType;
|
|
151
|
+
chartConfig: ChartAxisConfig;
|
|
152
|
+
displayConfig: ChartDisplayConfig;
|
|
153
|
+
/** Map of chart type availability for disabling unavailable chart types */
|
|
154
|
+
chartAvailability?: ChartAvailabilityMap;
|
|
155
|
+
onChartTypeChange: (type: ChartType) => void;
|
|
156
|
+
onChartConfigChange: (config: ChartAxisConfig) => void;
|
|
157
|
+
onDisplayConfigChange: (config: ChartDisplayConfig) => void;
|
|
158
|
+
validationStatus: ValidationStatus;
|
|
159
|
+
validationError: string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Props for the AnalysisResultsPanel component
|
|
163
|
+
*/
|
|
164
|
+
export interface AnalysisResultsPanelProps {
|
|
165
|
+
/** Current execution status */
|
|
166
|
+
executionStatus: ExecutionStatus;
|
|
167
|
+
/** Execution results (raw data) */
|
|
168
|
+
executionResults: any[] | null;
|
|
169
|
+
/** Execution error message */
|
|
170
|
+
executionError: string | null;
|
|
171
|
+
/** Total row count (before limit) */
|
|
172
|
+
totalRowCount: number | null;
|
|
173
|
+
/** Whether results are stale (query changed) */
|
|
174
|
+
resultsStale: boolean;
|
|
175
|
+
/** Chart type for visualization */
|
|
176
|
+
chartType: ChartType;
|
|
177
|
+
/** Chart axis configuration */
|
|
178
|
+
chartConfig: ChartAxisConfig;
|
|
179
|
+
/** Chart display configuration */
|
|
180
|
+
displayConfig: ChartDisplayConfig;
|
|
181
|
+
/** Current query object (for annotation/metadata) */
|
|
182
|
+
query: CubeQuery;
|
|
183
|
+
/** Schema metadata */
|
|
184
|
+
schema: MetaResponse | null;
|
|
185
|
+
/** Active view (table or chart) */
|
|
186
|
+
activeView: 'table' | 'chart';
|
|
187
|
+
/** Callback when active view changes */
|
|
188
|
+
onActiveViewChange: (view: 'table' | 'chart') => void;
|
|
189
|
+
/** Display limit for table */
|
|
190
|
+
displayLimit: number;
|
|
191
|
+
/** Callback when display limit changes */
|
|
192
|
+
onDisplayLimitChange: (limit: number) => void;
|
|
193
|
+
/** Whether the query has metrics (measures) - needed to enable/disable chart view */
|
|
194
|
+
hasMetrics: boolean;
|
|
195
|
+
debugQuery?: CubeQuery | null;
|
|
196
|
+
debugSql?: {
|
|
197
|
+
sql: string;
|
|
198
|
+
params: any[];
|
|
199
|
+
} | null;
|
|
200
|
+
debugAnalysis?: QueryAnalysis | null;
|
|
201
|
+
debugLoading?: boolean;
|
|
202
|
+
debugError?: string | null;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Props for the MetricsSection component
|
|
206
|
+
*/
|
|
207
|
+
export interface MetricsSectionProps {
|
|
208
|
+
/** Selected metrics */
|
|
209
|
+
metrics: MetricItem[];
|
|
210
|
+
/** Schema for resolving field titles */
|
|
211
|
+
schema: MetaResponse | null;
|
|
212
|
+
/** Add metric handler */
|
|
213
|
+
onAdd: () => void;
|
|
214
|
+
/** Remove metric handler */
|
|
215
|
+
onRemove: (id: string) => void;
|
|
216
|
+
/** Whether the section is expanded */
|
|
217
|
+
isExpanded?: boolean;
|
|
218
|
+
/** Toggle expansion */
|
|
219
|
+
onToggleExpanded?: () => void;
|
|
220
|
+
/** Current sort order */
|
|
221
|
+
order?: Record<string, 'asc' | 'desc'>;
|
|
222
|
+
/** Callback when sort order changes */
|
|
223
|
+
onOrderChange?: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Props for the BreakdownSection component
|
|
227
|
+
*/
|
|
228
|
+
export interface BreakdownSectionProps {
|
|
229
|
+
/** Selected breakdowns */
|
|
230
|
+
breakdowns: BreakdownItem[];
|
|
231
|
+
/** Schema for resolving field titles */
|
|
232
|
+
schema: MetaResponse | null;
|
|
233
|
+
/** Add breakdown handler */
|
|
234
|
+
onAdd: () => void;
|
|
235
|
+
/** Remove breakdown handler */
|
|
236
|
+
onRemove: (id: string) => void;
|
|
237
|
+
/** Change granularity for time dimension */
|
|
238
|
+
onGranularityChange: (id: string, granularity: string) => void;
|
|
239
|
+
/** Whether the section is expanded */
|
|
240
|
+
isExpanded?: boolean;
|
|
241
|
+
/** Toggle expansion */
|
|
242
|
+
onToggleExpanded?: () => void;
|
|
243
|
+
/** Current sort order */
|
|
244
|
+
order?: Record<string, 'asc' | 'desc'>;
|
|
245
|
+
/** Callback when sort order changes */
|
|
246
|
+
onOrderChange?: (fieldName: string, direction: 'asc' | 'desc' | null) => void;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Props for MetricItemCard component
|
|
250
|
+
*/
|
|
251
|
+
export interface MetricItemCardProps {
|
|
252
|
+
/** Metric item data */
|
|
253
|
+
metric: MetricItem;
|
|
254
|
+
/** Field metadata (for title, description) */
|
|
255
|
+
fieldMeta: MetaField | null;
|
|
256
|
+
/** Remove handler */
|
|
257
|
+
onRemove: () => void;
|
|
258
|
+
/** Current sort direction for this field */
|
|
259
|
+
sortDirection?: 'asc' | 'desc' | null;
|
|
260
|
+
/** Sort priority (1, 2, 3...) if sorted */
|
|
261
|
+
sortPriority?: number;
|
|
262
|
+
/** Toggle sort handler */
|
|
263
|
+
onToggleSort?: () => void;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Props for BreakdownItemCard component
|
|
267
|
+
*/
|
|
268
|
+
export interface BreakdownItemCardProps {
|
|
269
|
+
/** Breakdown item data */
|
|
270
|
+
breakdown: BreakdownItem;
|
|
271
|
+
/** Field metadata (for title, description) */
|
|
272
|
+
fieldMeta: MetaField | null;
|
|
273
|
+
/** Remove handler */
|
|
274
|
+
onRemove: () => void;
|
|
275
|
+
/** Granularity change handler (for time dimensions) */
|
|
276
|
+
onGranularityChange?: (granularity: string) => void;
|
|
277
|
+
/** Current sort direction for this field */
|
|
278
|
+
sortDirection?: 'asc' | 'desc' | null;
|
|
279
|
+
/** Sort priority (1, 2, 3...) if sorted */
|
|
280
|
+
sortPriority?: number;
|
|
281
|
+
/** Toggle sort handler */
|
|
282
|
+
onToggleSort?: () => void;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Props for the main AnalysisBuilder component
|
|
286
|
+
*/
|
|
287
|
+
export interface AnalysisBuilderProps {
|
|
288
|
+
/** Additional CSS classes */
|
|
289
|
+
className?: string;
|
|
290
|
+
/** Maximum height for the component (e.g., '800px', '100vh', 'calc(100vh - 64px)') */
|
|
291
|
+
maxHeight?: string;
|
|
292
|
+
/** Initial query to load */
|
|
293
|
+
initialQuery?: CubeQuery;
|
|
294
|
+
/** Disable localStorage persistence */
|
|
295
|
+
disableLocalStorage?: boolean;
|
|
296
|
+
/** Hide settings button */
|
|
297
|
+
hideSettings?: boolean;
|
|
298
|
+
/** Callback when query changes (for modal integration) */
|
|
299
|
+
onQueryChange?: (query: CubeQuery) => void;
|
|
300
|
+
/** Callback when chart config changes */
|
|
301
|
+
onChartConfigChange?: (config: {
|
|
302
|
+
chartType: ChartType;
|
|
303
|
+
chartConfig: ChartAxisConfig;
|
|
304
|
+
displayConfig: ChartDisplayConfig;
|
|
305
|
+
}) => void;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Ref interface for AnalysisBuilder (for external access)
|
|
309
|
+
*/
|
|
310
|
+
export interface AnalysisBuilderRef {
|
|
311
|
+
/** Get the current query object */
|
|
312
|
+
getCurrentQuery: () => CubeQuery;
|
|
313
|
+
/** Get current chart configuration */
|
|
314
|
+
getChartConfig: () => {
|
|
315
|
+
chartType: ChartType;
|
|
316
|
+
chartConfig: ChartAxisConfig;
|
|
317
|
+
displayConfig: ChartDisplayConfig;
|
|
318
|
+
};
|
|
319
|
+
/** Execute the current query */
|
|
320
|
+
executeQuery: () => void;
|
|
321
|
+
/** Clear the current query */
|
|
322
|
+
clearQuery: () => void;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Local storage state shape for persistence
|
|
326
|
+
*/
|
|
327
|
+
export interface AnalysisBuilderStorageState {
|
|
328
|
+
metrics: MetricItem[];
|
|
329
|
+
breakdowns: BreakdownItem[];
|
|
330
|
+
filters: Filter[];
|
|
331
|
+
order?: Record<string, 'asc' | 'desc'>;
|
|
332
|
+
chartType: ChartType;
|
|
333
|
+
chartConfig: ChartAxisConfig;
|
|
334
|
+
displayConfig: ChartDisplayConfig;
|
|
335
|
+
activeView: 'table' | 'chart';
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Recent fields storage shape
|
|
339
|
+
*/
|
|
340
|
+
export interface RecentFieldsStorage {
|
|
341
|
+
metrics: string[];
|
|
342
|
+
breakdowns: string[];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Time granularity options
|
|
346
|
+
*/
|
|
347
|
+
export declare const TIME_GRANULARITIES: readonly [{
|
|
348
|
+
readonly value: "hour";
|
|
349
|
+
readonly label: "Hour";
|
|
350
|
+
}, {
|
|
351
|
+
readonly value: "day";
|
|
352
|
+
readonly label: "Day";
|
|
353
|
+
}, {
|
|
354
|
+
readonly value: "week";
|
|
355
|
+
readonly label: "Week";
|
|
356
|
+
}, {
|
|
357
|
+
readonly value: "month";
|
|
358
|
+
readonly label: "Month";
|
|
359
|
+
}, {
|
|
360
|
+
readonly value: "quarter";
|
|
361
|
+
readonly label: "Quarter";
|
|
362
|
+
}, {
|
|
363
|
+
readonly value: "year";
|
|
364
|
+
readonly label: "Year";
|
|
365
|
+
}];
|
|
366
|
+
export type TimeGranularity = typeof TIME_GRANULARITIES[number]['value'];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { MetricItem, BreakdownItem, FieldOption, FieldType, RecentFieldsStorage } from './types';
|
|
2
|
+
import { MetaResponse, MetaField } from '../../shared/types';
|
|
3
|
+
import { CubeQuery, Filter } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Generate a unique ID for items
|
|
6
|
+
*/
|
|
7
|
+
export declare function generateId(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Generate letter label for metrics (A, B, C, ..., AA, AB, ...)
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateMetricLabel(index: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Convert metrics and breakdowns to CubeQuery format
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildCubeQuery(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[]): CubeQuery;
|
|
16
|
+
/**
|
|
17
|
+
* Check if a query has any content
|
|
18
|
+
*/
|
|
19
|
+
export declare function hasQueryContent(metrics: MetricItem[], breakdowns: BreakdownItem[], filters: Filter[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get cube name from a field name (e.g., "Employees.count" -> "Employees")
|
|
22
|
+
*/
|
|
23
|
+
export declare function getCubeNameFromField(fieldName: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get field short name from full name (e.g., "Employees.count" -> "count")
|
|
26
|
+
*/
|
|
27
|
+
export declare function getFieldShortName(fieldName: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Find field metadata from schema
|
|
30
|
+
*/
|
|
31
|
+
export declare function findFieldInSchema(fieldName: string, schema: MetaResponse | null): {
|
|
32
|
+
field: MetaField;
|
|
33
|
+
cubeName: string;
|
|
34
|
+
fieldType: FieldType;
|
|
35
|
+
} | null;
|
|
36
|
+
/**
|
|
37
|
+
* Get display title for a field
|
|
38
|
+
*/
|
|
39
|
+
export declare function getFieldTitle(fieldName: string, schema: MetaResponse | null): string;
|
|
40
|
+
/**
|
|
41
|
+
* Determine field type from metadata
|
|
42
|
+
*/
|
|
43
|
+
export declare function getFieldType(field: MetaField): FieldType;
|
|
44
|
+
/**
|
|
45
|
+
* Convert schema to flat list of field options
|
|
46
|
+
*/
|
|
47
|
+
export declare function schemaToFieldOptions(schema: MetaResponse | null, mode: 'metrics' | 'breakdown' | 'filter'): FieldOption[];
|
|
48
|
+
/**
|
|
49
|
+
* Filter field options by search term
|
|
50
|
+
*/
|
|
51
|
+
export declare function filterFieldOptions(options: FieldOption[], searchTerm: string, selectedCube?: string | null): FieldOption[];
|
|
52
|
+
/**
|
|
53
|
+
* Group field options by cube
|
|
54
|
+
*/
|
|
55
|
+
export declare function groupFieldsByCube(options: FieldOption[]): Map<string, FieldOption[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Get recent fields from localStorage
|
|
58
|
+
*/
|
|
59
|
+
export declare function getRecentFields(): RecentFieldsStorage;
|
|
60
|
+
/**
|
|
61
|
+
* Add a field to recent fields
|
|
62
|
+
*/
|
|
63
|
+
export declare function addRecentField(fieldName: string, mode: 'metrics' | 'breakdowns'): void;
|
|
64
|
+
/**
|
|
65
|
+
* Get recent field options from schema
|
|
66
|
+
*/
|
|
67
|
+
export declare function getRecentFieldOptions(schema: MetaResponse | null, mode: 'metrics' | 'breakdown' | 'filter', recentFieldNames: string[]): FieldOption[];
|
|
68
|
+
/**
|
|
69
|
+
* Get list of cube names from schema
|
|
70
|
+
*/
|
|
71
|
+
export declare function getCubeNames(schema: MetaResponse | null): string[];
|
|
72
|
+
/**
|
|
73
|
+
* Get cube title by name
|
|
74
|
+
*/
|
|
75
|
+
export declare function getCubeTitle(cubeName: string, schema: MetaResponse | null): string;
|
|
76
|
+
/**
|
|
77
|
+
* Save state to localStorage
|
|
78
|
+
*/
|
|
79
|
+
export declare function saveStateToStorage(state: {
|
|
80
|
+
metrics: MetricItem[];
|
|
81
|
+
breakdowns: BreakdownItem[];
|
|
82
|
+
filters: Filter[];
|
|
83
|
+
chartType: string;
|
|
84
|
+
chartConfig: object;
|
|
85
|
+
displayConfig: object;
|
|
86
|
+
activeView: string;
|
|
87
|
+
}): void;
|
|
88
|
+
/**
|
|
89
|
+
* Load state from localStorage
|
|
90
|
+
*/
|
|
91
|
+
export declare function loadStateFromStorage(): {
|
|
92
|
+
metrics: MetricItem[];
|
|
93
|
+
breakdowns: BreakdownItem[];
|
|
94
|
+
filters: Filter[];
|
|
95
|
+
chartType: string;
|
|
96
|
+
chartConfig: object;
|
|
97
|
+
displayConfig: object;
|
|
98
|
+
activeView: string;
|
|
99
|
+
} | null;
|
|
100
|
+
/**
|
|
101
|
+
* Clear state from localStorage
|
|
102
|
+
*/
|
|
103
|
+
export declare function clearStateFromStorage(): void;
|