drizzle-cube 0.1.10 → 0.1.11

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.
Files changed (29) hide show
  1. package/dist/client/charts/chartConfigRegistry.d.ts +5 -0
  2. package/dist/client/charts/chartConfigs.d.ts +60 -0
  3. package/dist/client/components/AxisDropZone.d.ts +20 -0
  4. package/dist/client/components/ChartConfigPanel.d.ts +15 -0
  5. package/dist/client/components/ChartTypeSelector.d.ts +8 -0
  6. package/dist/client/components/DebugModal.d.ts +9 -0
  7. package/dist/client/components/charts/AreaChart.config.d.ts +5 -0
  8. package/dist/client/components/charts/BarChart.config.d.ts +5 -0
  9. package/dist/client/components/charts/BubbleChart.config.d.ts +5 -0
  10. package/dist/client/components/charts/BubbleChart.d.ts +2 -0
  11. package/dist/client/components/charts/DataTable.config.d.ts +5 -0
  12. package/dist/client/components/charts/DataTable.d.ts +1 -1
  13. package/dist/client/components/charts/LineChart.config.d.ts +5 -0
  14. package/dist/client/components/charts/PieChart.config.d.ts +5 -0
  15. package/dist/client/components/charts/RadarChart.config.d.ts +5 -0
  16. package/dist/client/components/charts/RadialBarChart.config.d.ts +5 -0
  17. package/dist/client/components/charts/ScatterChart.config.d.ts +5 -0
  18. package/dist/client/components/charts/TreeMapChart.config.d.ts +5 -0
  19. package/dist/client/components/charts/index.d.ts +1 -0
  20. package/dist/client/hooks/useCubeMeta.d.ts +29 -0
  21. package/dist/client/index.d.ts +0 -1
  22. package/dist/client/index.js +14905 -11387
  23. package/dist/client/providers/CubeProvider.d.ts +7 -0
  24. package/dist/client/styles.css +1 -1
  25. package/dist/client/types.d.ts +14 -2
  26. package/dist/client/utils/chartConstants.d.ts +1 -0
  27. package/dist/client/utils/chartUtils.d.ts +6 -2
  28. package/package.json +5 -1
  29. package/dist/client/components/ChartConfigEditor.d.ts +0 -8
@@ -0,0 +1,5 @@
1
+ import { ChartConfigRegistry } from './chartConfigs';
2
+ /**
3
+ * Registry of all chart type configurations
4
+ */
5
+ export declare const chartConfigRegistry: ChartConfigRegistry;
@@ -0,0 +1,60 @@
1
+ import { ComponentType } from 'react';
2
+ /**
3
+ * Configuration for a single axis drop zone in the chart configuration UI
4
+ */
5
+ export interface AxisDropZoneConfig {
6
+ /** The key to store this field in chartConfig (e.g., 'xAxis', 'yAxis', 'sizeField') */
7
+ key: string;
8
+ /** Display label for the drop zone */
9
+ label: string;
10
+ /** Optional description/help text shown below the label */
11
+ description?: string;
12
+ /** Whether at least one field is required in this drop zone */
13
+ mandatory?: boolean;
14
+ /** Maximum number of items allowed in this drop zone */
15
+ maxItems?: number;
16
+ /** Which field types this drop zone accepts */
17
+ acceptTypes?: ('dimension' | 'timeDimension' | 'measure')[];
18
+ /** Optional icon component to display */
19
+ icon?: ComponentType<{
20
+ className?: string;
21
+ }>;
22
+ /** Placeholder text when drop zone is empty */
23
+ emptyText?: string;
24
+ }
25
+ /**
26
+ * Complete configuration for a chart type
27
+ */
28
+ export interface ChartTypeConfig {
29
+ /** Configuration for each drop zone */
30
+ dropZones: AxisDropZoneConfig[];
31
+ /** Which display options to show for this chart type */
32
+ displayOptions?: string[];
33
+ /** Optional custom validation function */
34
+ validate?: (config: any) => {
35
+ isValid: boolean;
36
+ message?: string;
37
+ };
38
+ /** Icon component for the chart type */
39
+ icon?: ComponentType<{
40
+ className?: string;
41
+ }>;
42
+ /** Brief description of the chart */
43
+ description?: string;
44
+ /** When to use this chart type */
45
+ useCase?: string;
46
+ }
47
+ /**
48
+ * Registry of all chart type configurations
49
+ */
50
+ export interface ChartConfigRegistry {
51
+ [chartType: string]: ChartTypeConfig;
52
+ }
53
+ /**
54
+ * Default configuration for charts without specific requirements
55
+ */
56
+ export declare const defaultChartConfig: ChartTypeConfig;
57
+ /**
58
+ * Helper function to get configuration for a chart type
59
+ */
60
+ export declare function getChartConfig(chartType: string, registry: ChartConfigRegistry): ChartTypeConfig;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { AxisDropZoneConfig } from '../charts/chartConfigs';
3
+ interface FieldStyling {
4
+ IconComponent: React.ComponentType<{
5
+ className?: string;
6
+ }>;
7
+ baseClasses: string;
8
+ hoverClasses: string;
9
+ }
10
+ interface AxisDropZoneProps {
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) => void;
16
+ onDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
17
+ getFieldStyling: (field: string) => FieldStyling;
18
+ }
19
+ export default function AxisDropZone({ config, fields, onDrop, onRemove, onDragStart, onDragOver, getFieldStyling }: AxisDropZoneProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ChartType, ChartAxisConfig, ChartDisplayConfig } from '../types';
2
+ interface ChartConfigPanelProps {
3
+ chartType: ChartType;
4
+ chartConfig: ChartAxisConfig;
5
+ displayConfig: ChartDisplayConfig;
6
+ availableFields: {
7
+ dimensions: string[];
8
+ timeDimensions: string[];
9
+ measures: string[];
10
+ } | null;
11
+ onChartConfigChange: (config: ChartAxisConfig) => void;
12
+ onDisplayConfigChange: (config: ChartDisplayConfig) => void;
13
+ }
14
+ export default function ChartConfigPanel({ chartType, chartConfig, displayConfig, availableFields, onChartConfigChange, onDisplayConfigChange }: ChartConfigPanelProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ChartType } from '../types';
2
+ interface ChartTypeSelectorProps {
3
+ selectedType: ChartType;
4
+ onTypeChange: (type: ChartType) => void;
5
+ className?: string;
6
+ }
7
+ export default function ChartTypeSelector({ selectedType, onTypeChange, className }: ChartTypeSelectorProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ interface DebugModalProps {
2
+ chartConfig: any;
3
+ displayConfig: any;
4
+ queryObject: any;
5
+ data: any[];
6
+ chartType: string;
7
+ }
8
+ export default function DebugModal({ chartConfig, displayConfig, queryObject, data, chartType }: DebugModalProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the area chart type
4
+ */
5
+ export declare const areaChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the bar chart type
4
+ */
5
+ export declare const barChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the bubble chart type
4
+ */
5
+ export declare const bubbleChartConfig: ChartTypeConfig;
@@ -0,0 +1,2 @@
1
+ import { ChartProps } from '../../types';
2
+ export default function BubbleChart({ data, chartConfig, displayConfig, queryObject, height }: ChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the data table type
4
+ */
5
+ export declare const dataTableConfig: ChartTypeConfig;
@@ -1,2 +1,2 @@
1
1
  import { ChartProps } from '../../types';
2
- export default function DataTable({ data, height }: ChartProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function DataTable({ data, chartConfig, height }: ChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the line chart type
4
+ */
5
+ export declare const lineChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the pie chart type
4
+ */
5
+ export declare const pieChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the radar chart type
4
+ */
5
+ export declare const radarChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the radial bar chart type
4
+ */
5
+ export declare const radialBarChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the scatter chart type
4
+ */
5
+ export declare const scatterChartConfig: ChartTypeConfig;
@@ -0,0 +1,5 @@
1
+ import { ChartTypeConfig } from '../../charts/chartConfigs';
2
+ /**
3
+ * Configuration for the treemap chart type
4
+ */
5
+ export declare const treemapChartConfig: ChartTypeConfig;
@@ -10,4 +10,5 @@ export { default as RechartsScatterChart } from './ScatterChart';
10
10
  export { default as RechartsRadarChart } from './RadarChart';
11
11
  export { default as RechartsRadialBarChart } from './RadialBarChart';
12
12
  export { default as RechartsTreeMapChart } from './TreeMapChart';
13
+ export { default as BubbleChart } from './BubbleChart';
13
14
  export { default as DataTable } from './DataTable';
@@ -0,0 +1,29 @@
1
+ import { CubeClient } from '../client/CubeClient';
2
+ export interface CubeMetaField {
3
+ name: string;
4
+ title: string;
5
+ shortTitle: string;
6
+ type: string;
7
+ }
8
+ export interface CubeMetaCube {
9
+ name: string;
10
+ title: string;
11
+ description?: string;
12
+ measures: CubeMetaField[];
13
+ dimensions: CubeMetaField[];
14
+ segments: CubeMetaField[];
15
+ }
16
+ export interface CubeMeta {
17
+ cubes: CubeMetaCube[];
18
+ }
19
+ export type FieldLabelMap = Record<string, string>;
20
+ interface UseCubeMetaResult {
21
+ meta: CubeMeta | null;
22
+ labelMap: FieldLabelMap;
23
+ loading: boolean;
24
+ error: string | null;
25
+ refetch: () => void;
26
+ getFieldLabel: (fieldName: string) => string;
27
+ }
28
+ export declare function useCubeMeta(cubeApi: CubeClient): UseCubeMetaResult;
29
+ export {};
@@ -6,7 +6,6 @@ export { default as PortletContainer } from './components/PortletContainer';
6
6
  export { default as PortletEditModal } from './components/PortletEditModal';
7
7
  export { default as DashboardEditModal } from './components/DashboardEditModal';
8
8
  export { default as Modal } from './components/Modal';
9
- export { default as ChartConfigEditor } from './components/ChartConfigEditor';
10
9
  export { default as QueryBuilder } from './components/QueryBuilder';
11
10
  export { CubeProvider } from './providers/CubeProvider';
12
11
  export { useCubeQuery } from './hooks/useCubeQuery';