@redsift/dashboard 11.5.0 → 11.6.0-muiv5-alpha.1
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/_virtual/_rollupPluginBabelHelpers.js +93 -0
- package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/components/ChartEmptyState/ChartEmptyState.d.ts +6 -0
- package/components/ChartEmptyState/ChartEmptyState.js +123 -0
- package/components/ChartEmptyState/ChartEmptyState.js.map +1 -0
- package/components/ChartEmptyState/styles.js +35 -0
- package/components/ChartEmptyState/styles.js.map +1 -0
- package/components/ChartEmptyState/types.d.ts +17 -0
- package/components/CrossfilterRegistry/CrossfilterRegistry.js +23 -0
- package/components/CrossfilterRegistry/CrossfilterRegistry.js.map +1 -0
- package/components/Dashboard/Dashboard.d.ts +6 -0
- package/components/Dashboard/Dashboard.js +46 -0
- package/components/Dashboard/Dashboard.js.map +1 -0
- package/components/Dashboard/context.d.ts +7 -0
- package/components/Dashboard/context.js +11 -0
- package/components/Dashboard/context.js.map +1 -0
- package/components/Dashboard/reducer.d.ts +5 -0
- package/components/Dashboard/reducer.js +61 -0
- package/components/Dashboard/reducer.js.map +1 -0
- package/components/Dashboard/types.d.ts +44 -0
- package/components/Dashboard/types.js +23 -0
- package/components/Dashboard/types.js.map +1 -0
- package/components/PdfExportButton/PdfDocument.js +173 -0
- package/components/PdfExportButton/PdfDocument.js.map +1 -0
- package/components/PdfExportButton/PdfExportButton.d.ts +6 -0
- package/components/PdfExportButton/PdfExportButton.js +110 -0
- package/components/PdfExportButton/PdfExportButton.js.map +1 -0
- package/components/PdfExportButton/styles.js +146 -0
- package/components/PdfExportButton/styles.js.map +1 -0
- package/components/PdfExportButton/types.d.ts +24 -0
- package/components/TimeSeriesBarChart/TimeSeriesBarChart.d.ts +6 -0
- package/components/TimeSeriesBarChart/TimeSeriesBarChart.js +365 -0
- package/components/TimeSeriesBarChart/TimeSeriesBarChart.js.map +1 -0
- package/components/TimeSeriesBarChart/styles.js +98 -0
- package/components/TimeSeriesBarChart/styles.js.map +1 -0
- package/components/TimeSeriesBarChart/types.d.ts +84 -0
- package/components/TimeSeriesBarChart/types.js +22 -0
- package/components/TimeSeriesBarChart/types.js.map +1 -0
- package/components/WithFilters/FilterableBarChart.js +152 -0
- package/components/WithFilters/FilterableBarChart.js.map +1 -0
- package/components/WithFilters/FilterableDataGrid.js +51 -0
- package/components/WithFilters/FilterableDataGrid.js.map +1 -0
- package/components/WithFilters/FilterablePieChart.js +160 -0
- package/components/WithFilters/FilterablePieChart.js.map +1 -0
- package/components/WithFilters/FilterableScatterPlot.js +252 -0
- package/components/WithFilters/FilterableScatterPlot.js.map +1 -0
- package/components/WithFilters/WithFilters.d.ts +6 -0
- package/components/WithFilters/WithFilters.js +36 -0
- package/components/WithFilters/WithFilters.js.map +1 -0
- package/components/WithFilters/types.d.ts +40 -0
- package/hooks/useCategoricalChartAsListbox.js +94 -0
- package/hooks/useCategoricalChartAsListbox.js.map +1 -0
- package/index.d.ts +14 -227
- package/index.js +11 -1956
- package/index.js.map +1 -1
- package/package.json +8 -8
- package/types.d.ts +16 -0
- package/utils/groupReducers/groupReduceCount.d.ts +6 -0
- package/utils/groupReducers/groupReduceCount.js +5 -0
- package/utils/groupReducers/groupReduceCount.js.map +1 -0
- package/utils/groupReducers/groupReduceSum.d.ts +7 -0
- package/utils/groupReducers/groupReduceSum.js +5 -0
- package/utils/groupReducers/groupReduceSum.js.map +1 -0
package/index.d.ts
CHANGED
|
@@ -1,228 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import { Crossfilter, Group as Group$1, NaturallyOrderedValue, Dimension as Dimension$1, ComparableObject, OrderedValueSelector } from 'crossfilter2';
|
|
1
|
+
export { Dimension, DimensionSelector, Group, GroupSelector, JSONArray, JSONObject, JSONValue, TNdx } from './types.js';
|
|
3
2
|
export { ChartSize, ColorTheme } from '@redsift/charts';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type Group = Group$1<any, NaturallyOrderedValue, unknown>;
|
|
18
|
-
type GroupSelector = (group: Group) => Group;
|
|
19
|
-
type Dimension = Dimension$1<any, string | number | boolean | ComparableObject>;
|
|
20
|
-
type DimensionSelector = OrderedValueSelector<any, NaturallyOrderedValue | NaturallyOrderedValue[]>;
|
|
21
|
-
|
|
22
|
-
declare const COUNT: (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
|
|
23
|
-
|
|
24
|
-
declare const groupReduceSum: (field: string) => (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
|
|
25
|
-
declare const SUM: (field: string) => (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Component props.
|
|
29
|
-
*/
|
|
30
|
-
interface ChartEmptyStateProps extends ComponentProps<'div'> {
|
|
31
|
-
/** Method to call when the reset button is pressed. Also conditioned whether the button is displayed or not. */
|
|
32
|
-
onReset?: () => void;
|
|
33
|
-
/** Reset button label. */
|
|
34
|
-
resetLabel?: string;
|
|
35
|
-
/** Subtitle. */
|
|
36
|
-
subtitle?: string;
|
|
37
|
-
/** Title. */
|
|
38
|
-
title?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare const ChartEmptyState: Comp<ChartEmptyStateProps, HTMLDivElement>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Context props.
|
|
45
|
-
*/
|
|
46
|
-
type DashboardContextProps = {
|
|
47
|
-
dashboardRef?: RefObject<HTMLDivElement>;
|
|
48
|
-
data: JSONArray;
|
|
49
|
-
dataGridApiRef?: MutableRefObject<GridApi>;
|
|
50
|
-
dispatch: Dispatch<DashboardReducerAction>;
|
|
51
|
-
state: DashboardReducerState;
|
|
52
|
-
toggleUpdateContext?: () => void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Reducer props.
|
|
56
|
-
*/
|
|
57
|
-
type DashboardReducerState = {
|
|
58
|
-
tableFilters: GridFilterItem[];
|
|
59
|
-
};
|
|
60
|
-
declare enum DashboardReducerActionType {
|
|
61
|
-
ResetFilter = "reset-filter",
|
|
62
|
-
ResetFilters = "reset-filters",
|
|
63
|
-
FilterTable = "filter-table",
|
|
64
|
-
FilterTableBatch = "filter-table-batch",
|
|
65
|
-
AppendFilterTableBatch = "append-filter-table-batch"
|
|
66
|
-
}
|
|
67
|
-
type DashboardReducerAction = {
|
|
68
|
-
type: DashboardReducerActionType;
|
|
69
|
-
filter?: GridFilterItem | GridFilterItem[];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Component props.
|
|
73
|
-
*/
|
|
74
|
-
interface DashboardProps extends ComponentProps<'div'> {
|
|
75
|
-
/** Dataset that will be share across every components within the dashboard. */
|
|
76
|
-
data: JSONArray;
|
|
77
|
-
/** Datagrid API Ref. */
|
|
78
|
-
dataGridApiRef?: MutableRefObject<GridApi>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
declare const Dashboard: Comp<DashboardProps, HTMLDivElement>;
|
|
82
|
-
|
|
83
|
-
declare const initialState: DashboardReducerState;
|
|
84
|
-
declare const DashboardContext: React.Context<DashboardContextProps>;
|
|
85
|
-
|
|
86
|
-
declare const DashboardReducer: (state: DashboardReducerState, action: DashboardReducerAction) => DashboardReducerState;
|
|
87
|
-
|
|
88
|
-
interface LocaleText$2 {
|
|
89
|
-
maxSizeDisclaimer?: string;
|
|
90
|
-
}
|
|
91
|
-
interface PdfExportButtonProps extends ButtonProps {
|
|
92
|
-
/** Ref to the DOM component to export. By default, will be the ref to the parent Dashboard. */
|
|
93
|
-
componentRef?: RefObject<HTMLElement>;
|
|
94
|
-
/** Name of the exported PDF file. */
|
|
95
|
-
fileName?: string;
|
|
96
|
-
/** Text to display at the beginning of the PDF. */
|
|
97
|
-
introduction?: string;
|
|
98
|
-
/** Labels and texts. */
|
|
99
|
-
localeText?: LocaleText$2;
|
|
100
|
-
/** Image to put at the top of the PDF (SVG format not supported). */
|
|
101
|
-
logo?: string;
|
|
102
|
-
/** Function to be executed when button is clicked. */
|
|
103
|
-
onClick?: () => void;
|
|
104
|
-
/** Color used for the header and footer of the PDF. */
|
|
105
|
-
primaryColor?: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
declare const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement>;
|
|
109
|
-
|
|
110
|
-
type SuccessDangerColorTheme = {
|
|
111
|
-
success: string;
|
|
112
|
-
warning: string;
|
|
113
|
-
danger: string;
|
|
114
|
-
neutral?: string;
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* Component size.
|
|
118
|
-
*/
|
|
119
|
-
declare const TimeSeriesBarChartSize: {
|
|
120
|
-
readonly large: "large";
|
|
121
|
-
readonly medium: "medium";
|
|
122
|
-
readonly small: "small";
|
|
123
|
-
};
|
|
124
|
-
type TimeSeriesBarChartSize = ValueOf<typeof TimeSeriesBarChartSize>;
|
|
125
|
-
/**
|
|
126
|
-
* Component theme.
|
|
127
|
-
*/
|
|
128
|
-
declare const TimeSeriesBarChartTheme: {
|
|
129
|
-
readonly default: "default";
|
|
130
|
-
readonly dark: "dark";
|
|
131
|
-
readonly darker: "darker";
|
|
132
|
-
readonly darkerer: "darkerer";
|
|
133
|
-
readonly light: "light";
|
|
134
|
-
readonly lighter: "lighter";
|
|
135
|
-
readonly lighterer: "lighterer";
|
|
136
|
-
readonly monochrome: "monochrome";
|
|
137
|
-
};
|
|
138
|
-
type TimeSeriesBarChartTheme = ValueOf<typeof TimeSeriesBarChartTheme>;
|
|
139
|
-
type datetimeEnum = 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
140
|
-
interface LocaleText$1 {
|
|
141
|
-
emptyChartTitle?: string;
|
|
142
|
-
emptyChartSubtitle?: string;
|
|
143
|
-
emptyChartResetLabel?: string;
|
|
144
|
-
resetLabel?: string;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Component props.
|
|
148
|
-
*/
|
|
149
|
-
interface TimeSeriesBarChartProps extends ComponentProps<'div'> {
|
|
150
|
-
/** Caption. */
|
|
151
|
-
caption?: string;
|
|
152
|
-
/** Whether the x axis labels are rotated or not. */
|
|
153
|
-
areXLabelsRotated?: boolean;
|
|
154
|
-
/** Field value of the DataGrid column to filter. */
|
|
155
|
-
columnToFilter?: string;
|
|
156
|
-
/** Dataset to use to generate the chart, if no context is provided. */
|
|
157
|
-
data?: JSONArray;
|
|
158
|
-
/** Name of the dataset field that contains the datetime value. */
|
|
159
|
-
dateTimeFieldName: string;
|
|
160
|
-
/** Format used for the date and time values in the dataset by d3.js. Should follow https://github.com/d3/d3-time-format#locale_format. */
|
|
161
|
-
dateTimeFormat?: string;
|
|
162
|
-
/** Datetime unit to used to group values and for x units. */
|
|
163
|
-
dateTimeGroup?: datetimeEnum;
|
|
164
|
-
/** Method that will be used by crossfilter to compute the dimensions of the charts. */
|
|
165
|
-
dimension: DimensionSelector;
|
|
166
|
-
/** Whether the reset button is hidden or not. */
|
|
167
|
-
isResetable?: boolean;
|
|
168
|
-
/** Overriden values for internal labels and texts. */
|
|
169
|
-
localeText?: LocaleText$1;
|
|
170
|
-
/** Method to call when a filter occured on the chart. */
|
|
171
|
-
onFilter?: (filters?: string[], allFiltered?: JSONArray) => void;
|
|
172
|
-
/** TimeSeriesChart size. */
|
|
173
|
-
size?: TimeSeriesBarChartSize;
|
|
174
|
-
/** Color palette to use. You can choose among the list of available color palette or also choose to use the success/warning/danger theme for which you have to specify which key corresponds to which status. */
|
|
175
|
-
colorTheme?: TimeSeriesBarChartTheme | SuccessDangerColorTheme;
|
|
176
|
-
/** Title. */
|
|
177
|
-
title?: string;
|
|
178
|
-
/** Dataset key to use to stack values. */
|
|
179
|
-
stackedCategory?: string;
|
|
180
|
-
/** X Axis Label. */
|
|
181
|
-
xAxisLabel?: string;
|
|
182
|
-
/** Y Axis Label. */
|
|
183
|
-
yAxisLabel?: string;
|
|
184
|
-
}
|
|
185
|
-
type StyledTimeSeriesBarChartProps = Omit<TimeSeriesBarChartProps, 'dimension' | 'dateTimeFieldName'> & {
|
|
186
|
-
$theme: Theme;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
declare const TimeSeriesBarChart: Comp<TimeSeriesBarChartProps, HTMLDivElement>;
|
|
190
|
-
|
|
191
|
-
interface LocaleText {
|
|
192
|
-
emptyChartTitle?: string;
|
|
193
|
-
emptyChartSubtitle?: string;
|
|
194
|
-
emptyChartResetLabel?: string;
|
|
195
|
-
resetLabel?: string;
|
|
196
|
-
}
|
|
197
|
-
type CategoryFilterType = {
|
|
198
|
-
field: string;
|
|
199
|
-
operator: 'containsAnyOf' | 'endsWithAnyOf' | 'isAnyOf' | 'startsWithAnyOf';
|
|
200
|
-
};
|
|
201
|
-
type CoordinateFilterType = {
|
|
202
|
-
field: string;
|
|
203
|
-
operator: 'isBetween';
|
|
204
|
-
};
|
|
205
|
-
interface WithFiltersProps extends ComponentProps<'div'> {
|
|
206
|
-
/** In case of a chart based on one dimension (category), which datagrid column the chart is filtering and using which operator. */
|
|
207
|
-
datagridCategoryDimFilter?: CategoryFilterType;
|
|
208
|
-
/** In case of a chart based on two dimension coordinates (x, y), which datagrid columns the chart is filtering. */
|
|
209
|
-
datagridCoordinatesCategoryDimFilter?: [CoordinateFilterType, CoordinateFilterType] | [CoordinateFilterType, CoordinateFilterType, CategoryFilterType];
|
|
210
|
-
/** Method that will be used by crossfilter to compute the dimensions of the charts. */
|
|
211
|
-
dimension?: DimensionSelector;
|
|
212
|
-
/** Method that will be used by crossfilter to compute the groups of the charts. */
|
|
213
|
-
group?: (d: Dimension) => Group;
|
|
214
|
-
/** Whether the dimension field is an array or not. */
|
|
215
|
-
isDimensionArray?: boolean;
|
|
216
|
-
/** Whether the reset button is hidden or not. */
|
|
217
|
-
isResetable?: boolean;
|
|
218
|
-
/** Overriden values for internal labels and texts. */
|
|
219
|
-
localeText?: LocaleText;
|
|
220
|
-
/** Method to call when a filter occured on the chart. */
|
|
221
|
-
onFilter?: (filters?: NaturallyOrderedValue[] | any) => void;
|
|
222
|
-
}
|
|
223
|
-
interface ChartsWithFiltersProps extends Required<Pick<WithFiltersProps, 'dimension'>>, Omit<WithFiltersProps, 'dimension'> {
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
declare const WithFilters: React.FC<WithFiltersProps>;
|
|
227
|
-
|
|
228
|
-
export { COUNT, ChartEmptyState, ChartEmptyStateProps, ChartsWithFiltersProps, Dashboard, DashboardContext, DashboardContextProps, DashboardProps, DashboardReducer, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState, Dimension, DimensionSelector, Group, GroupSelector, JSONArray, JSONObject, JSONValue, PdfExportButton, SUM, StyledTimeSeriesBarChartProps, TNdx, TimeSeriesBarChart, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, WithFilters, WithFiltersProps, datetimeEnum, groupReduceSum, initialState };
|
|
3
|
+
export { COUNT } from './utils/groupReducers/groupReduceCount.js';
|
|
4
|
+
export { SUM, groupReduceSum } from './utils/groupReducers/groupReduceSum.js';
|
|
5
|
+
export { ChartEmptyState } from './components/ChartEmptyState/ChartEmptyState.js';
|
|
6
|
+
export { ChartEmptyStateProps } from './components/ChartEmptyState/types.js';
|
|
7
|
+
export { Dashboard } from './components/Dashboard/Dashboard.js';
|
|
8
|
+
export { DashboardContext, initialState } from './components/Dashboard/context.js';
|
|
9
|
+
export { DashboardReducer } from './components/Dashboard/reducer.js';
|
|
10
|
+
export { DashboardContextProps, DashboardProps, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState } from './components/Dashboard/types.js';
|
|
11
|
+
export { PdfExportButton } from './components/PdfExportButton/PdfExportButton.js';
|
|
12
|
+
export { TimeSeriesBarChart } from './components/TimeSeriesBarChart/TimeSeriesBarChart.js';
|
|
13
|
+
export { StyledTimeSeriesBarChartProps, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, datetimeEnum } from './components/TimeSeriesBarChart/types.js';
|
|
14
|
+
export { WithFilters } from './components/WithFilters/WithFilters.js';
|
|
15
|
+
export { ChartsWithFiltersProps, WithFiltersProps } from './components/WithFilters/types.js';
|