drizzle-cube 0.1.3 → 0.1.5
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/README.md +24 -2
- package/dist/adapters/hono/index.d.ts +5 -1
- package/dist/adapters/hono/index.js +259 -96
- package/dist/client/client/CubeClient.d.ts +15 -0
- package/dist/client/components/AnalyticsDashboard.d.ts +2 -0
- package/dist/client/components/AnalyticsPage.d.ts +1 -0
- package/dist/client/components/AnalyticsPortlet.d.ts +6 -0
- package/dist/client/components/ChartConfigEditor.d.ts +8 -0
- package/dist/client/components/ChartErrorBoundary.d.ts +21 -0
- package/dist/client/components/DashboardEditModal.d.ts +14 -0
- package/dist/client/components/DashboardGrid.d.ts +11 -0
- package/dist/client/components/Modal.d.ts +16 -0
- package/dist/client/components/PortletContainer.d.ts +10 -0
- package/dist/client/components/PortletEditModal.d.ts +12 -0
- package/dist/client/components/QueryBuilder/CubeMetaExplorer.d.ts +4 -0
- package/dist/client/components/QueryBuilder/QueryPanel.d.ts +4 -0
- package/dist/client/components/QueryBuilder/ResultsPanel.d.ts +4 -0
- package/dist/client/components/QueryBuilder/SetupPanel.d.ts +11 -0
- package/dist/client/components/QueryBuilder/index.d.ts +3 -0
- package/dist/client/components/QueryBuilder/types.d.ts +132 -0
- package/dist/client/components/QueryBuilder/utils.d.ts +42 -0
- package/dist/client/components/charts/AreaChart.d.ts +2 -0
- package/dist/client/components/charts/BarChart.d.ts +2 -0
- package/dist/client/components/charts/ChartContainer.d.ts +7 -0
- package/dist/client/components/charts/ChartLegend.d.ts +7 -0
- package/dist/client/components/charts/ChartTooltip.d.ts +7 -0
- package/dist/client/components/charts/DataTable.d.ts +2 -0
- package/dist/client/components/charts/LineChart.d.ts +2 -0
- package/dist/client/components/charts/PieChart.d.ts +2 -0
- package/dist/client/components/charts/RadarChart.d.ts +2 -0
- package/dist/client/components/charts/RadialBarChart.d.ts +2 -0
- package/dist/client/components/charts/ScatterChart.d.ts +2 -0
- package/dist/client/components/charts/TreeMapChart.d.ts +2 -0
- package/dist/client/components/charts/index.d.ts +13 -0
- package/dist/client/hooks/useCubeQuery.d.ts +8 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/index.js +25439 -4
- package/dist/client/providers/CubeProvider.d.ts +15 -0
- package/dist/client/styles.css +1 -0
- package/dist/client/types.d.ts +111 -0
- package/dist/client/utils/chartConstants.d.ts +15 -0
- package/dist/client/utils/chartUtils.d.ts +9 -0
- package/dist/client/utils/index.d.ts +87 -0
- package/dist/server/index.d.ts +84 -1155
- package/dist/server/index.js +1046 -2826
- package/package.json +14 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CubeClient } from '../client/CubeClient';
|
|
3
|
+
import { CubeQueryOptions } from '../types';
|
|
4
|
+
interface CubeContextValue {
|
|
5
|
+
cubeApi: CubeClient;
|
|
6
|
+
options?: CubeQueryOptions;
|
|
7
|
+
}
|
|
8
|
+
interface CubeProviderProps {
|
|
9
|
+
cubeApi: CubeClient;
|
|
10
|
+
options?: CubeQueryOptions;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function CubeProvider({ cubeApi, options, children }: CubeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useCubeContext(): CubeContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.react-grid-layout{transition:height .2s;position:relative}.react-grid-item{transition:left .2s,top .2s,width .2s,height .2s}.react-grid-item img{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform,width,height}.react-grid-item.resizing{z-index:1;will-change:width,height;transition:none}.react-grid-item.react-draggable-dragging{z-index:3;will-change:transform;transition:none}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{opacity:.2;z-index:2;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-user-select:none;background:red;transition-duration:.1s}.react-grid-item.react-grid-placeholder.placeholder-resizing{transition:none}.react-grid-item>.react-resizable-handle{width:20px;height:20px;position:absolute}.react-grid-item>.react-resizable-handle:after{content:"";border-bottom:2px solid #0006;border-right:2px solid #0006;width:5px;height:5px;position:absolute;bottom:3px;right:3px}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{cursor:sw-resize;bottom:0;left:0;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{cursor:se-resize;bottom:0;right:0}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{cursor:nw-resize;top:0;left:0;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{cursor:ne-resize;top:0;right:0;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{cursor:ew-resize;margin-top:-10px;top:50%}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{cursor:ns-resize;margin-left:-10px;left:50%}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.react-resizable{position:relative}.react-resizable-handle{box-sizing:border-box;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);background-position:100% 100%;background-repeat:no-repeat;background-origin:content-box;width:20px;height:20px;padding:0 3px 3px 0;position:absolute}.react-resizable-handle-sw{cursor:sw-resize;bottom:0;left:0;transform:rotate(90deg)}.react-resizable-handle-se{cursor:se-resize;bottom:0;right:0}.react-resizable-handle-nw{cursor:nw-resize;top:0;left:0;transform:rotate(180deg)}.react-resizable-handle-ne{cursor:ne-resize;top:0;right:0;transform:rotate(270deg)}.react-resizable-handle-w,.react-resizable-handle-e{cursor:ew-resize;margin-top:-10px;top:50%}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{cursor:ns-resize;margin-left:-10px;left:50%}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.top-1\/2{top:50%}.isolate{isolation:isolate}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}.mx-auto{margin-inline:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-\[90vh\]{height:90vh}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[90vh\]{max-height:90vh}.min-h-\[50vh\]{min-height:50vh}.min-h-\[60px\]{min-height:60px}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-\[90vw\]{width:90vw}.w-full{width:100%}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-current{border-color:currentColor}.border-transparent{border-color:#0000}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.text-center{text-align:center}.text-left{text-align:left}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\:underline:hover{text-decoration-line:underline}}.focus\:underline:focus{text-decoration-line:underline}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for drizzle-cube client components
|
|
3
|
+
*/
|
|
4
|
+
export type ChartType = 'line' | 'bar' | 'pie' | 'table' | 'area' | 'scatter' | 'radar' | 'radialBar' | 'treemap';
|
|
5
|
+
export interface ChartAxisConfig {
|
|
6
|
+
xAxis?: string[];
|
|
7
|
+
yAxis?: string[];
|
|
8
|
+
series?: string[];
|
|
9
|
+
x?: string;
|
|
10
|
+
y?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface ChartDisplayConfig {
|
|
13
|
+
showLegend?: boolean;
|
|
14
|
+
showGrid?: boolean;
|
|
15
|
+
showTooltip?: boolean;
|
|
16
|
+
colors?: string[];
|
|
17
|
+
orientation?: 'horizontal' | 'vertical';
|
|
18
|
+
stacked?: boolean;
|
|
19
|
+
stackedBarChart?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface PortletConfig {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
query: string;
|
|
25
|
+
chartType: ChartType;
|
|
26
|
+
chartConfig?: ChartAxisConfig;
|
|
27
|
+
displayConfig?: ChartDisplayConfig;
|
|
28
|
+
w: number;
|
|
29
|
+
h: number;
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}
|
|
33
|
+
export interface DashboardConfig {
|
|
34
|
+
portlets: PortletConfig[];
|
|
35
|
+
layouts?: {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface CubeQuery {
|
|
40
|
+
measures?: string[];
|
|
41
|
+
dimensions?: string[];
|
|
42
|
+
timeDimensions?: Array<{
|
|
43
|
+
dimension: string;
|
|
44
|
+
granularity?: string;
|
|
45
|
+
dateRange?: string[] | string;
|
|
46
|
+
}>;
|
|
47
|
+
filters?: Array<{
|
|
48
|
+
member: string;
|
|
49
|
+
operator: string;
|
|
50
|
+
values: any[];
|
|
51
|
+
}>;
|
|
52
|
+
order?: {
|
|
53
|
+
[key: string]: 'asc' | 'desc';
|
|
54
|
+
};
|
|
55
|
+
limit?: number;
|
|
56
|
+
offset?: number;
|
|
57
|
+
segments?: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface CubeQueryOptions {
|
|
60
|
+
skip?: boolean;
|
|
61
|
+
resetResultSetOnChange?: boolean;
|
|
62
|
+
subscribe?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface CubeApiOptions {
|
|
65
|
+
apiUrl?: string;
|
|
66
|
+
token?: string;
|
|
67
|
+
headers?: Record<string, string>;
|
|
68
|
+
}
|
|
69
|
+
export interface CubeResultSet {
|
|
70
|
+
rawData(): any[];
|
|
71
|
+
tablePivot(): any[];
|
|
72
|
+
series(): any[];
|
|
73
|
+
annotation(): any;
|
|
74
|
+
loadResponse?: any;
|
|
75
|
+
}
|
|
76
|
+
export interface AnalyticsPortletProps {
|
|
77
|
+
query: string;
|
|
78
|
+
chartType: ChartType;
|
|
79
|
+
chartConfig?: ChartAxisConfig;
|
|
80
|
+
displayConfig?: ChartDisplayConfig;
|
|
81
|
+
height?: string | number;
|
|
82
|
+
title?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface AnalyticsDashboardProps {
|
|
85
|
+
config: DashboardConfig;
|
|
86
|
+
apiUrl?: string;
|
|
87
|
+
apiOptions?: CubeApiOptions;
|
|
88
|
+
editable?: boolean;
|
|
89
|
+
onConfigChange?: (config: DashboardConfig) => void;
|
|
90
|
+
onSave?: (config: DashboardConfig) => Promise<void> | void;
|
|
91
|
+
onDirtyStateChange?: (isDirty: boolean) => void;
|
|
92
|
+
}
|
|
93
|
+
export interface ChartProps {
|
|
94
|
+
data: any[];
|
|
95
|
+
chartConfig?: ChartAxisConfig;
|
|
96
|
+
displayConfig?: ChartDisplayConfig;
|
|
97
|
+
queryObject?: CubeQuery;
|
|
98
|
+
height?: string | number;
|
|
99
|
+
}
|
|
100
|
+
export interface GridLayout {
|
|
101
|
+
i: string;
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
w: number;
|
|
105
|
+
h: number;
|
|
106
|
+
minW?: number;
|
|
107
|
+
minH?: number;
|
|
108
|
+
}
|
|
109
|
+
export interface ResponsiveLayout {
|
|
110
|
+
[breakpoint: string]: GridLayout[];
|
|
111
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const CHART_COLORS: string[];
|
|
2
|
+
export declare const POSITIVE_COLOR = "#10b981";
|
|
3
|
+
export declare const NEGATIVE_COLOR = "#ef4444";
|
|
4
|
+
export declare const CHART_MARGINS: {
|
|
5
|
+
top: number;
|
|
6
|
+
right: number;
|
|
7
|
+
left: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const RESPONSIVE_CHART_MARGINS: {
|
|
11
|
+
top: number;
|
|
12
|
+
right: number;
|
|
13
|
+
left: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function formatTimeValue(value: any, granularity?: string): string;
|
|
2
|
+
export declare function getFieldGranularity(queryObject: any, fieldName: string): string | undefined;
|
|
3
|
+
export declare function transformChartData(data: any[], xAxisField: string, yAxisFields: string[], queryObject: any): any[];
|
|
4
|
+
export interface ChartSeriesResult {
|
|
5
|
+
data: any[];
|
|
6
|
+
seriesKeys: string[];
|
|
7
|
+
hasDimensions: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function transformChartDataWithSeries(data: any[], xAxisField: string, yAxisFields: string[], queryObject: any, seriesFields?: string[]): ChartSeriesResult;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { PortletConfig, DashboardConfig } from '../types';
|
|
2
|
+
export * from './chartUtils';
|
|
3
|
+
export * from './chartConstants';
|
|
4
|
+
/**
|
|
5
|
+
* Create a dashboard layout from portlet configurations
|
|
6
|
+
*/
|
|
7
|
+
export declare function createDashboardLayout(portlets: PortletConfig[]): DashboardConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Generate responsive layouts for different breakpoints
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateResponsiveLayouts(portlets: PortletConfig[]): {
|
|
12
|
+
lg: {
|
|
13
|
+
i: string;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
w: number;
|
|
17
|
+
h: number;
|
|
18
|
+
minW: number;
|
|
19
|
+
minH: number;
|
|
20
|
+
}[];
|
|
21
|
+
md: {
|
|
22
|
+
w: number;
|
|
23
|
+
i: string;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
h: number;
|
|
27
|
+
minW: number;
|
|
28
|
+
minH: number;
|
|
29
|
+
}[];
|
|
30
|
+
sm: {
|
|
31
|
+
w: number;
|
|
32
|
+
i: string;
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
h: number;
|
|
36
|
+
minW: number;
|
|
37
|
+
minH: number;
|
|
38
|
+
}[];
|
|
39
|
+
xs: {
|
|
40
|
+
w: number;
|
|
41
|
+
i: string;
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
h: number;
|
|
45
|
+
minW: number;
|
|
46
|
+
minH: number;
|
|
47
|
+
}[];
|
|
48
|
+
xxs: {
|
|
49
|
+
w: number;
|
|
50
|
+
i: string;
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
h: number;
|
|
54
|
+
minW: number;
|
|
55
|
+
minH: number;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Format chart data for display
|
|
60
|
+
*/
|
|
61
|
+
export declare function formatChartData(data: any[], options?: {
|
|
62
|
+
formatNumbers?: boolean;
|
|
63
|
+
precision?: number;
|
|
64
|
+
}): any[];
|
|
65
|
+
/**
|
|
66
|
+
* Generate a unique ID for new portlets
|
|
67
|
+
*/
|
|
68
|
+
export declare function generatePortletId(): string;
|
|
69
|
+
/**
|
|
70
|
+
* Find the next available position in a grid
|
|
71
|
+
*/
|
|
72
|
+
export declare function findNextPosition(existingPortlets: PortletConfig[], _w?: number, _h?: number): {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Validate a cube query JSON string
|
|
78
|
+
*/
|
|
79
|
+
export declare function validateCubeQuery(queryString: string): {
|
|
80
|
+
valid: boolean;
|
|
81
|
+
error?: string;
|
|
82
|
+
query?: any;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Create a sample portlet configuration
|
|
86
|
+
*/
|
|
87
|
+
export declare function createSamplePortlet(): Omit<PortletConfig, 'id'>;
|