@redsift/dashboard 7.8.0 → 8.0.0-alpha.0

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/CONTRIBUTING.md CHANGED
@@ -48,11 +48,11 @@ The Design System is following a monorepo architecture, providing multiple packa
48
48
 
49
49
  - `@redsift/charts`
50
50
 
51
- This package provides charts components. Charts are based on [d3.js](https://d3js.org/) and are mainly static. For filterable charts, see `@redsift/dashboard`.
51
+ This package provides charts components. Charts are based on [d3.js](https://d3js.org/) for computation, [react](https://react.dev/) for rendering and events and [react-spring](https://www.react-spring.dev/) for animations and transitions.
52
52
 
53
53
  - `@redsift/dashboard`
54
54
 
55
- This package provides dashboard-related components. Charts are based on [dc.js](https://dc-js.github.io/dc.js/), [d3fc](https://d3fc.io/) and [crossfilter](https://crossfilter.github.io/crossfilter/) and datagrids are based on `@redsift/table`. It contains every filterable elements to use inside a dashboard. For static charts, see `@redsift/charts`.
55
+ This package provides dashboard-related components and decorators to make charts and datagrid filterable using [crossfilter](https://crossfilter.github.io/crossfilter/).
56
56
 
57
57
  - _Deprecated_ `@redsift/design-system-legacy`
58
58
 
package/index.d.ts CHANGED
@@ -1,17 +1,11 @@
1
1
  import * as crossfilter2 from 'crossfilter2';
2
2
  import { Crossfilter, Group as Group$1, NaturallyOrderedValue, Dimension as Dimension$1, ComparableObject, OrderedValueSelector } from 'crossfilter2';
3
- import { PieChartLabelVariant, PieChartSize, PieChartTheme, PieChartVariant } from '@redsift/charts';
4
- export { ColorTheme, PieChartLabelVariant, PieChartSize, PieChartTheme, PieChartVariant } from '@redsift/charts';
5
- import $k7QOs$react, { Ref, ReactElement, ComponentProps, RefObject, MutableRefObject, Dispatch } from 'react';
3
+ export { ChartSize, ColorTheme } from '@redsift/charts';
4
+ import { Comp, ButtonProps, ValueOf } from '@redsift/design-system';
5
+ import React, { ComponentProps, RefObject, MutableRefObject, Dispatch } from 'react';
6
6
  import { GridFilterItem, DataGridProps as DataGridProps$1, GridFilterModel } from '@redsift/table';
7
7
  import { GridApi } from '@mui/x-data-grid-pro';
8
8
 
9
- type SuccessDangerColorTheme = {
10
- success: string;
11
- warning: string;
12
- danger: string;
13
- neutral?: string;
14
- };
15
9
  type JSONValue = string | number | boolean | {
16
10
  [x: string]: JSONValue;
17
11
  } | Array<JSONValue> | undefined | null;
@@ -24,226 +18,12 @@ type Group = Group$1<any, NaturallyOrderedValue, unknown>;
24
18
  type GroupSelector = (group: Group) => Group;
25
19
  type Dimension = Dimension$1<any, string | number | boolean | ComparableObject>;
26
20
  type DimensionSelector = OrderedValueSelector<any, NaturallyOrderedValue | NaturallyOrderedValue[]>;
27
- type ChartDimensions = {
28
- width: number;
29
- height: number;
30
- marginTop?: number;
31
- marginRight?: number;
32
- marginBottom?: number;
33
- marginLeft?: number;
34
- };
35
21
 
36
22
  declare const COUNT: (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
37
23
 
38
24
  declare const groupReduceSum: (field: string) => (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
39
25
  declare const SUM: (field: string) => (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
40
26
 
41
- /** Component Type. */
42
- type Comp<P, T = HTMLElement> = {
43
- (props: P & {
44
- ref?: Ref<T>;
45
- }): ReactElement | null;
46
- /** React component type. */
47
- readonly $$typeof: symbol;
48
- /** Component default props. */
49
- defaultProps?: Partial<P>;
50
- /** Component name. */
51
- displayName?: string;
52
- /** Component base class name. */
53
- className?: string;
54
- };
55
- /** Get types of the values of a record. */
56
- type ValueOf<T extends Record<any, any>> = T[keyof T];
57
-
58
- /**
59
- * Color palette.
60
- */
61
- declare const ColorPalette: {
62
- readonly default: "default";
63
- readonly success: "success";
64
- readonly error: "error";
65
- readonly warning: "warning";
66
- readonly info: "info";
67
- readonly question: "question";
68
- readonly 'no-data': "no-data";
69
- };
70
- type ColorPalette = ValueOf<typeof ColorPalette>;
71
- declare const ProductColorPalette: {
72
- readonly website: "website";
73
- readonly ondmarc: "ondmarc";
74
- readonly oninbox: "oninbox";
75
- readonly ondomain: "ondomain";
76
- readonly hardenize: "hardenize";
77
- readonly tools: "tools";
78
- };
79
- type ProductColorPalette = ValueOf<typeof ProductColorPalette>;
80
-
81
- declare const AlignSelf: {
82
- readonly auto: "auto";
83
- readonly normal: "normal";
84
- readonly start: "start";
85
- readonly end: "end";
86
- readonly center: "center";
87
- readonly 'flex-start': "flex-start";
88
- readonly 'flex-end': "flex-end";
89
- readonly 'self-start': "self-start";
90
- readonly 'self-end': "self-end";
91
- readonly baseline: "baseline";
92
- readonly stretch: "stretch";
93
- };
94
- type AlignSelf = ValueOf<typeof AlignSelf>;
95
- interface LayoutProps {
96
- /** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex">MDN</a>. */
97
- flex?: string;
98
- /** When used in a flex layout, specifies how the element will grow to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow">MDN</a>. */
99
- flexGrow?: number;
100
- /** When used in a flex layout, specifies how the element will shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink">MDN</a>. */
101
- flexShrink?: number;
102
- /** When used in a flex layout, specifies the initial main size of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex_basis">MDN</a>. */
103
- flexBasis?: string;
104
- /** Overrides the alignItems property of a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-self">MDN</a>. */
105
- alignSelf?: AlignSelf;
106
- /** Specifies how the element is justified inside a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self">MDN</a>. */
107
- justifySelf?: string;
108
- /** The layout order for the element within a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/order">MDN</a>. */
109
- order?: number;
110
- /** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area">MDN</a>. */
111
- gridArea?: string;
112
- /** When used in a grid layout, specifies the column the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column">MDN</a>. */
113
- gridColumn?: string;
114
- /** When used in a grid layout, specifies the row the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row">MDN</a>. */
115
- gridRow?: string;
116
- /** When used in a grid layout, specifies the starting column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start">MDN</a>. */
117
- gridColumnStart?: string;
118
- /** When used in a grid layout, specifies the ending column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end">MDN</a>. */
119
- gridColumnEnd?: string;
120
- /** When used in a grid layout, specifies the starting row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start">MDN</a>. */
121
- gridRowStart?: string;
122
- /** When used in a grid layout, specifies the ending row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end">MDN</a>. */
123
- gridRowEnd?: string;
124
- }
125
- interface SpacingProps {
126
- /** The margin for all four sides of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin">MDN</a>. */
127
- margin?: string;
128
- /** The margin for the bottom side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom">MDN</a>. */
129
- marginBottom?: string;
130
- /** The margin for the left side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left">MDN</a>. */
131
- marginLeft?: string;
132
- /** The margin for the right side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right">MDN</a>. */
133
- marginRight?: string;
134
- /** The margin for the top side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top">MDN</a>. */
135
- marginTop?: string;
136
- }
137
- interface SizingProps {
138
- /** The height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/height">MDN</a>. */
139
- height?: string | number;
140
- /** The maximum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-height">MDN</a>. */
141
- maxHeight?: string;
142
- /** The maximum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-width">MDN</a>. */
143
- maxWidth?: string;
144
- /** The minimum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-height">MDN</a>. */
145
- minHeight?: string;
146
- /** The minimum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-width">MDN</a>. */
147
- minWidth?: string;
148
- /** The width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/width">MDN</a>. */
149
- width?: string | number;
150
- }
151
- interface PositioningProps {
152
- /** Specifies how the element is positioned. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN</a>. */
153
- position?: string;
154
- /** The top position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/top">MDN</a>. */
155
- top?: string;
156
- /** The bottom position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/bottom">MDN</a>. */
157
- bottom?: string;
158
- /** The left position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/left">MDN</a>. Consider using start instead for RTL support. */
159
- left?: string;
160
- /** The right position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/right">MDN</a>. Consider using start instead for RTL support. */
161
- right?: string;
162
- /** The stacking order for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index">MDN</a>. */
163
- zIndex?: string;
164
- }
165
- interface StylingProps extends LayoutProps, SpacingProps, SizingProps, PositioningProps {
166
- }
167
-
168
- /*
169
- * Copyright 2020 Adobe. All rights reserved.
170
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
171
- * you may not use this file except in compliance with the License. You may obtain a copy
172
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
173
- *
174
- * Unless required by applicable law or agreed to in writing, software distributed under
175
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
176
- * OF ANY KIND, either express or implied. See the License for the specific language
177
- * governing permissions and limitations under the License.
178
- */
179
-
180
-
181
- type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual';
182
-
183
- interface PressEvent {
184
- /** The type of press event being fired. */
185
- type: 'pressstart' | 'pressend' | 'pressup' | 'press',
186
- /** The pointer type that triggered the press event. */
187
- pointerType: PointerType,
188
- /** The target element of the press event. */
189
- target: Element,
190
- /** Whether the shift keyboard modifier was held during the press event. */
191
- shiftKey: boolean,
192
- /** Whether the ctrl keyboard modifier was held during the press event. */
193
- ctrlKey: boolean,
194
- /** Whether the meta keyboard modifier was held during the press event. */
195
- metaKey: boolean,
196
- /** Whether the alt keyboard modifier was held during the press event. */
197
- altKey: boolean
198
- }
199
-
200
- /**
201
- * Component variant.
202
- */
203
- declare const ButtonVariant: {
204
- readonly primary: "primary";
205
- readonly secondary: "secondary";
206
- readonly unstyled: "unstyled";
207
- };
208
- type ButtonVariant = ValueOf<typeof ButtonVariant>;
209
- /**
210
- * Component color.
211
- */
212
- type ButtonColor = ColorPalette | ProductColorPalette;
213
- /**
214
- * Component props.
215
- */
216
- interface ButtonProps extends ComponentProps<'button'>, StylingProps {
217
- /** Color variant. The product colors are available but should only be used to display the Button in the color of another product. To display a Button with a color of the current product, use `default`. */
218
- color?: ButtonColor;
219
- /** Whether the component take the full width or not. */
220
- fullWidth?: boolean;
221
- /** Whether the component is active or not. */
222
- isActive?: boolean;
223
- /** Whether the component is disabled or not. */
224
- isDisabled?: boolean;
225
- /** Whether the component is in a loading state or not. */
226
- isLoading?: boolean;
227
- /**
228
- * Icon path data (`d` property of the `path` SVG element).<br />
229
- * See <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths</a>.<br />
230
- * Recommended path data come from mdi/js.<br />
231
- * See <a href="https://www.npmjs.com/package/@mdi/js">https://www.npmjs.com/package/@mdi/js</a>.
232
- */
233
- leftIcon?: string;
234
- /** Preferred method to handle click, press and touch. */
235
- onPress?: (e: PressEvent) => void;
236
- /**
237
- * Icon path data (`d` property of the `path` SVG element).<br />
238
- * See <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths</a>.<br />
239
- * Recommended path data come from mdi/js.<br />
240
- * See <a href="https://www.npmjs.com/package/@mdi/js">https://www.npmjs.com/package/@mdi/js</a>.
241
- */
242
- rightIcon?: string;
243
- /** Button variant. */
244
- variant?: ButtonVariant;
245
- }
246
-
247
27
  /**
248
28
  * Component props.
249
29
  */
@@ -265,11 +45,11 @@ declare const ChartEmptyState: Comp<ChartEmptyStateProps, HTMLDivElement>;
265
45
  */
266
46
  type DashboardContextProps = {
267
47
  dashboardRef?: RefObject<HTMLDivElement>;
268
- data?: JSONArray;
48
+ data: JSONArray;
269
49
  dataGridApiRef?: MutableRefObject<GridApi>;
270
- dispatch?: Dispatch<DashboardReducerAction>;
271
- ndx?: TNdx;
50
+ dispatch: Dispatch<DashboardReducerAction>;
272
51
  state: DashboardReducerState;
52
+ toggleUpdateContext?: () => void;
273
53
  };
274
54
  /**
275
55
  * Reducer props.
@@ -299,7 +79,7 @@ interface DashboardProps extends ComponentProps<'div'> {
299
79
  declare const Dashboard: Comp<DashboardProps, HTMLDivElement>;
300
80
 
301
81
  declare const initialState: DashboardReducerState;
302
- declare const DashboardContext: $k7QOs$react.Context<DashboardContextProps>;
82
+ declare const DashboardContext: React.Context<DashboardContextProps>;
303
83
 
304
84
  declare const DashboardReducer: (state: DashboardReducerState, action: DashboardReducerAction) => DashboardReducerState;
305
85
 
@@ -311,83 +91,9 @@ interface DataGridProps extends Omit<DataGridProps$1, 'rows'> {
311
91
  onFilter?: (filterModel: GridFilterModel) => void;
312
92
  }
313
93
 
314
- declare const DataGrid: $k7QOs$react.FC<DataGridProps>;
315
-
316
- /**
317
- * Component size.
318
- */
319
- declare const HorizontalBarChartSize: {
320
- readonly large: "large";
321
- readonly medium: "medium";
322
- readonly small: "small";
323
- };
324
- type HorizontalBarChartSize = ValueOf<typeof HorizontalBarChartSize>;
325
- /**
326
- * Component theme.
327
- */
328
- declare const HorizontalBarChartTheme: {
329
- readonly default: "default";
330
- /**
331
- * Component theme.
332
- */
333
- readonly dark: "dark";
334
- readonly darker: "darker";
335
- readonly monochrome: "monochrome";
336
- };
337
- type HorizontalBarChartTheme = ValueOf<typeof HorizontalBarChartTheme>;
338
- interface LocaleText$4 {
339
- emptyChartTitle?: string;
340
- emptyChartSubtitle?: string;
341
- emptyChartResetLabel?: string;
342
- resetLabel?: string;
343
- }
344
- /**
345
- * Component props.
346
- */
347
- interface HorizontalBarChartProps extends ComponentProps<'div'> {
348
- /** Whether the x axis labels are rotated or not. */
349
- areXLabelsRotated?: boolean;
350
- /** Number of categories to use, the rest being put into a new category called "Others". */
351
- caping?: number;
352
- /** Caption. */
353
- caption?: string;
354
- /** Dataset to use to generate the chart, if no context is provided. */
355
- data?: JSONArray;
356
- /** Which datagrid column the chart is filtering and using which operation. */
357
- datagridFilter?: {
358
- field: string;
359
- operator: 'containsAnyOf' | 'endsWithAnyOf' | 'isAnyOf';
360
- };
361
- /** Method that will be used by crossfilter to compute the dimensions of the charts. */
362
- dimension: DimensionSelector;
363
- /** Reset function that is triggered when reset button is pressed in the empty state chart. */
364
- emptyChartResetFn?: () => void;
365
- /** Method that will be used by crossfilter to compute the groups of the charts. */
366
- group: (d: Dimension) => Group;
367
- /** Whether the dimension field is an array or not. */
368
- isDimensionArray?: boolean;
369
- /** Whether the reset button is hidden or not. */
370
- isResetable?: boolean;
371
- /** Overriden values for internal labels and texts. */
372
- localeText?: LocaleText$4;
373
- /** Method to call when a filter occured on the chart. */
374
- onFilter?: (filters?: string[]) => void;
375
- /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
376
- others?: boolean | string;
377
- /** Method to override the data labels. */
378
- setLabels?: (key: string) => string | undefined;
379
- /** HorizontalBarChart size. */
380
- size?: HorizontalBarChartSize;
381
- /** 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. */
382
- theme?: HorizontalBarChartTheme | SuccessDangerColorTheme;
383
- /** Title. */
384
- title?: string;
385
- }
386
- type StyledHorizontalBarChartProps = Omit<HorizontalBarChartProps, 'columnToFilter' | 'data' | 'dimension' | 'group' | 'localeText'> & {};
387
-
388
- declare const HorizontalBarChart: Comp<HorizontalBarChartProps, HTMLDivElement>;
94
+ declare const DataGrid: React.FC<DataGridProps>;
389
95
 
390
- interface LocaleText$3 {
96
+ interface LocaleText$2 {
391
97
  maxSizeDisclaimer?: string;
392
98
  }
393
99
  interface PdfExportButtonProps extends ButtonProps {
@@ -398,7 +104,7 @@ interface PdfExportButtonProps extends ButtonProps {
398
104
  /** Text to display at the beginning of the PDF. */
399
105
  introduction?: string;
400
106
  /** Labels and texts. */
401
- localeText?: LocaleText$3;
107
+ localeText?: LocaleText$2;
402
108
  /** Image to put at the top of the PDF (SVG format not supported). */
403
109
  logo?: string;
404
110
  /** Function to be executed when button is clicked. */
@@ -409,67 +115,12 @@ interface PdfExportButtonProps extends ButtonProps {
409
115
 
410
116
  declare const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement>;
411
117
 
412
- interface LocaleText$2 {
413
- emptyChartTitle?: string;
414
- emptyChartSubtitle?: string;
415
- emptyChartResetLabel?: string;
416
- resetLabel?: string;
417
- }
418
- /**
419
- * Component props.
420
- */
421
- interface PieChartProps extends ComponentProps<'div'> {
422
- /** Number of categories to use, the rest being put into a new category called "Others". */
423
- caping?: number;
424
- /** Caption. */
425
- caption?: string;
426
- /** Dataset to use to generate the chart, if no context is provided. */
427
- data?: JSONArray;
428
- /** Which datagrid column the chart is filtering and using which operation. */
429
- datagridFilter?: {
430
- field: string;
431
- operator: 'containsAnyOf' | 'endsWithAnyOf' | 'isAnyOf';
432
- };
433
- /** Method that will be used by crossfilter to compute the dimensions of the charts. */
434
- dimension: DimensionSelector;
435
- /** Method that will be used by crossfilter to compute the groups of the charts. */
436
- group: (d: Dimension) => Group;
437
- /** Whether the dimension field is an array or not. */
438
- isDimensionArray?: boolean;
439
- /** Whether the reset button is hidden or not. */
440
- isResetable?: boolean;
441
- /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. */
442
- labelVariant?: PieChartLabelVariant;
443
- /** Overriden values for internal labels and texts. */
444
- localeText?: LocaleText$2;
445
- /** Method to call when a filter occured on the chart. */
446
- onFilter?: (filters?: string[]) => void;
447
- /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
448
- others?: boolean | string;
449
- /** Method to override the data labels. */
450
- setLabels?: (key: string) => string | undefined;
451
- /** PieChart size. */
452
- size?: PieChartSize;
453
- /** Main text to be displayed in the middle of the chart. Only for donut variant. */
454
- text?: string;
455
- /** Secondary text to be displayed in the middle of the chart, between the main text and subtext. Recommended to be used with donut variants only. */
456
- middleText?: string;
457
- /** Secondary text to be displayed in the middle of the chart, above the main text. Only for donut variant. */
458
- subtext?: string;
459
- /** 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. */
460
- theme?: PieChartTheme | SuccessDangerColorTheme;
461
- /** Title. */
462
- title?: string;
463
- /** PieChart variant. */
464
- variant?: PieChartVariant;
465
- }
466
- type StyledPieChartProps = Omit<PieChartProps, 'columnToFilter' | 'dimension' | 'group' | 'localeText'> & {
467
- $showLabels: boolean;
468
- $spaced: boolean;
118
+ type SuccessDangerColorTheme = {
119
+ success: string;
120
+ warning: string;
121
+ danger: string;
122
+ neutral?: string;
469
123
  };
470
-
471
- declare const PieChart: Comp<PieChartProps, HTMLDivElement>;
472
-
473
124
  /**
474
125
  * Component size.
475
126
  */
@@ -483,12 +134,13 @@ type TimeSeriesBarChartSize = ValueOf<typeof TimeSeriesBarChartSize>;
483
134
  * Component theme.
484
135
  */
485
136
  declare const TimeSeriesBarChartTheme: {
486
- /**
487
- * Component theme.
488
- */
489
137
  readonly default: "default";
490
138
  readonly dark: "dark";
491
139
  readonly darker: "darker";
140
+ readonly darkerer: "darkerer";
141
+ readonly light: "light";
142
+ readonly lighter: "lighter";
143
+ readonly lighterer: "lighterer";
492
144
  readonly monochrome: "monochrome";
493
145
  };
494
146
  type TimeSeriesBarChartTheme = ValueOf<typeof TimeSeriesBarChartTheme>;
@@ -542,100 +194,43 @@ type StyledTimeSeriesBarChartProps = Omit<TimeSeriesBarChartProps, 'dimension' |
542
194
 
543
195
  declare const TimeSeriesBarChart: Comp<TimeSeriesBarChartProps, HTMLDivElement>;
544
196
 
545
- /**
546
- * Component size.
547
- */
548
- declare const ScatterPlotSize: {
549
- readonly xlarge: "xlarge";
550
- readonly large: "large";
551
- readonly medium: "medium";
552
- readonly small: "small";
553
- };
554
- type ScatterPlotSize = ValueOf<typeof ScatterPlotSize>;
555
- /**
556
- * Component's labels variant.
557
- */
558
- declare const ScatterPlotLabelVariant: {
559
- readonly none: "none";
560
- readonly label: "label";
561
- readonly labelValue: "labelValue";
562
- readonly labelPercent: "labelPercent";
563
- };
564
- type ScatterPlotLabelVariant = ValueOf<typeof ScatterPlotLabelVariant>;
565
- /**
566
- * Component theme.
567
- */
568
- declare const ScatterPlotTheme: {
569
- readonly default: "default";
570
- readonly dark: "dark";
571
- readonly darker: "darker";
572
- readonly monochrome: "monochrome";
573
- };
574
- type ScatterPlotTheme = ValueOf<typeof ScatterPlotTheme>;
575
197
  interface LocaleText {
576
198
  emptyChartTitle?: string;
577
199
  emptyChartSubtitle?: string;
578
200
  emptyChartResetLabel?: string;
579
201
  resetLabel?: string;
580
202
  }
581
- /**
582
- * Component props.
583
- */
584
- interface ScatterPlotProps extends ComponentProps<'div'> {
585
- /** Defines the fields to display on hover. An array of key/value will indicate which field to display and how to name it. An object of selectable fields and default selected fields can be used to make the annotations customizable by the user. */
586
- annotations?: {
587
- key: string;
588
- value: string;
589
- }[] | {
590
- /** List of fields selected by default. Should only contain values that are keys in selectableFields prop. */
591
- defaultSelectedFields?: string[];
592
- /** List of fields to display inside the tooltip. keys should match the ones in the dataset and values would be the one used to label the checkboxes. */
593
- selectableFields: {
594
- key: string;
595
- value: string;
596
- }[];
597
- };
598
- /** Caption. */
599
- caption?: string;
600
- /** Dataset to use to generate the chart, if no context is provided. */
601
- data?: JSONArray;
602
- /** Which datagrid column the chart is filtering for x and y but also for category if provided. */
603
- datagridFilter?: {
604
- x: string;
605
- y: string;
606
- category?: string;
203
+ interface WithFiltersProps extends ComponentProps<'div'> {
204
+ /** In case of a chart based on one dimension (category), which datagrid column the chart is filtering and using which operator. */
205
+ datagridCategoryDimFilter?: {
206
+ field: string;
207
+ operator: 'containsAnyOf' | 'endsWithAnyOf' | 'isAnyOf' | 'startsWithAnyOf';
607
208
  };
209
+ /** In case of a chart based on two dimension coordinates (x, y), which datagrid columns the chart is filtering. */
210
+ datagridCoordinatesCategoryDimFilter?: [
211
+ {
212
+ field: string;
213
+ operator: 'isBetween';
214
+ },
215
+ {
216
+ field: string;
217
+ operator: 'isBetween';
218
+ }
219
+ ];
608
220
  /** Method that will be used by crossfilter to compute the dimensions of the charts. */
609
- dimension: OrderedValueSelector<any, [number, number, string]> | OrderedValueSelector<any, [number, number]>;
610
- /** Reset function that is triggered when reset button is pressed in the empty state chart. */
611
- emptyChartResetFn?: () => void;
221
+ dimension: DimensionSelector;
222
+ /** Method that will be used by crossfilter to compute the groups of the charts. */
223
+ group: (d: Dimension) => Group;
612
224
  /** Whether the dimension field is an array or not. */
613
225
  isDimensionArray?: boolean;
614
226
  /** Whether the reset button is hidden or not. */
615
227
  isResetable?: boolean;
616
- /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. */
617
- labelVariant?: ScatterPlotLabelVariant;
618
228
  /** Overriden values for internal labels and texts. */
619
229
  localeText?: LocaleText;
620
230
  /** Method to call when a filter occured on the chart. */
621
- onFilter?: (filters?: string[]) => void;
622
- /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
623
- others?: boolean | string;
624
- /** Method to override the data labels. */
625
- setLabels?: (key: string) => string | undefined;
626
- /** ScatterPlot size. */
627
- size?: ScatterPlotSize | {
628
- width: number;
629
- height: number;
630
- dotSize: number;
631
- };
632
- /** 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. */
633
- theme?: ScatterPlotTheme | SuccessDangerColorTheme;
634
- /** Title. */
635
- title?: string;
231
+ onFilter?: (filters?: NaturallyOrderedValue[] | any) => void;
636
232
  }
637
- type StyledScatterPlotProps = Omit<ScatterPlotProps, 'columnToFilter' | 'data' | 'dimension' | 'group' | 'localeText'> & {};
638
233
 
639
- declare const ScatterPlot: Comp<ScatterPlotProps, HTMLDivElement>;
234
+ declare const WithFilters: React.FC<WithFiltersProps>;
640
235
 
641
- export { COUNT, ChartDimensions, ChartEmptyState, ChartEmptyStateProps, Dashboard, DashboardContext, DashboardContextProps, DashboardProps, DashboardReducer, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState, DataGrid, DataGridProps, Dimension, DimensionSelector, Group, GroupSelector, HorizontalBarChart, HorizontalBarChartProps, HorizontalBarChartSize, HorizontalBarChartTheme, JSONArray, JSONObject, JSONValue, PdfExportButton, PieChart, PieChartProps, SUM, ScatterPlot, ScatterPlotLabelVariant, ScatterPlotProps, ScatterPlotSize, ScatterPlotTheme, StyledHorizontalBarChartProps, StyledPieChartProps, StyledScatterPlotProps, StyledTimeSeriesBarChartProps, SuccessDangerColorTheme, TNdx, TimeSeriesBarChart, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, datetimeEnum, groupReduceSum, initialState };
236
+ export { COUNT, ChartEmptyState, ChartEmptyStateProps, Dashboard, DashboardContext, DashboardContextProps, DashboardProps, DashboardReducer, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState, DataGrid, DataGridProps, Dimension, DimensionSelector, Group, GroupSelector, JSONArray, JSONObject, JSONValue, PdfExportButton, SUM, StyledTimeSeriesBarChartProps, TNdx, TimeSeriesBarChart, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, WithFilters, WithFiltersProps, datetimeEnum, groupReduceSum, initialState };