@redsift/dashboard 11.6.0-muiv5-alpha.10 → 11.6.0-muiv5-alpha.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 (75) hide show
  1. package/{_internal/context.js → _virtual/_internal/_rollupPluginBabelHelpers.js} +2 -11
  2. package/_virtual/_internal/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/components/ChartEmptyState/_internal/ChartEmptyState.js +2 -0
  4. package/{_internal → components/ChartEmptyState/_internal}/ChartEmptyState2.js +2 -33
  5. package/components/ChartEmptyState/_internal/ChartEmptyState2.js.map +1 -0
  6. package/components/ChartEmptyState/_internal/styles.js +35 -0
  7. package/components/ChartEmptyState/_internal/styles.js.map +1 -0
  8. package/components/CrossfilterRegistry/_internal/CrossfilterRegistry.js +2 -0
  9. package/{_internal → components/CrossfilterRegistry/_internal}/CrossfilterRegistry2.js +1 -1
  10. package/components/CrossfilterRegistry/_internal/CrossfilterRegistry2.js.map +1 -0
  11. package/components/Dashboard/_internal/Dashboard.js +5 -0
  12. package/{_internal → components/Dashboard/_internal}/Dashboard.js.map +1 -1
  13. package/components/Dashboard/_internal/Dashboard2.js +46 -0
  14. package/components/Dashboard/_internal/Dashboard2.js.map +1 -0
  15. package/components/Dashboard/_internal/context.js +11 -0
  16. package/components/Dashboard/_internal/context.js.map +1 -0
  17. package/{_internal/Dashboard2.js → components/Dashboard/_internal/reducer.js} +4 -44
  18. package/components/Dashboard/_internal/reducer.js.map +1 -0
  19. package/{_internal → components/Dashboard/_internal}/types.js +1 -1
  20. package/components/Dashboard/_internal/types.js.map +1 -0
  21. package/components/PdfExportButton/_internal/PdfDocument.js +173 -0
  22. package/components/PdfExportButton/_internal/PdfDocument.js.map +1 -0
  23. package/components/PdfExportButton/_internal/PdfExportButton.js +2 -0
  24. package/components/PdfExportButton/_internal/PdfExportButton2.js +110 -0
  25. package/components/PdfExportButton/_internal/PdfExportButton2.js.map +1 -0
  26. package/components/PdfExportButton/_internal/styles.js +146 -0
  27. package/components/PdfExportButton/_internal/styles.js.map +1 -0
  28. package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart.js +3 -0
  29. package/{_internal → components/TimeSeriesBarChart/_internal}/TimeSeriesBarChart.js.map +1 -1
  30. package/{_internal → components/TimeSeriesBarChart/_internal}/TimeSeriesBarChart2.js +10 -119
  31. package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart2.js.map +1 -0
  32. package/components/TimeSeriesBarChart/_internal/styles.js +98 -0
  33. package/components/TimeSeriesBarChart/_internal/styles.js.map +1 -0
  34. package/components/TimeSeriesBarChart/_internal/types.js +22 -0
  35. package/components/TimeSeriesBarChart/_internal/types.js.map +1 -0
  36. package/components/WithFilters/_internal/FilterableBarChart.js +152 -0
  37. package/components/WithFilters/_internal/FilterableBarChart.js.map +1 -0
  38. package/components/WithFilters/_internal/FilterableDataGrid.js +51 -0
  39. package/components/WithFilters/_internal/FilterableDataGrid.js.map +1 -0
  40. package/components/WithFilters/_internal/FilterablePieChart.js +160 -0
  41. package/components/WithFilters/_internal/FilterablePieChart.js.map +1 -0
  42. package/components/WithFilters/_internal/FilterableScatterPlot.js +252 -0
  43. package/components/WithFilters/_internal/FilterableScatterPlot.js.map +1 -0
  44. package/components/WithFilters/_internal/WithFilters.js +2 -0
  45. package/components/WithFilters/_internal/WithFilters2.js +36 -0
  46. package/components/WithFilters/_internal/WithFilters2.js.map +1 -0
  47. package/hooks/_internal/useCategoricalChartAsListbox.js +94 -0
  48. package/hooks/_internal/useCategoricalChartAsListbox.js.map +1 -0
  49. package/index.js +11 -15
  50. package/index.js.map +1 -1
  51. package/package.json +2 -2
  52. package/utils/groupReducers/_internal/groupReduceCount.js +5 -0
  53. package/utils/groupReducers/_internal/groupReduceCount.js.map +1 -0
  54. package/utils/groupReducers/_internal/groupReduceSum.js +5 -0
  55. package/utils/groupReducers/_internal/groupReduceSum.js.map +1 -0
  56. package/_internal/ChartEmptyState.js +0 -2
  57. package/_internal/ChartEmptyState2.js.map +0 -1
  58. package/_internal/CrossfilterRegistry.js +0 -2
  59. package/_internal/CrossfilterRegistry2.js.map +0 -1
  60. package/_internal/Dashboard.js +0 -4
  61. package/_internal/Dashboard2.js.map +0 -1
  62. package/_internal/PdfExportButton.js +0 -2
  63. package/_internal/PdfExportButton2.js +0 -417
  64. package/_internal/PdfExportButton2.js.map +0 -1
  65. package/_internal/TimeSeriesBarChart.js +0 -2
  66. package/_internal/TimeSeriesBarChart2.js.map +0 -1
  67. package/_internal/WithFilters.js +0 -2
  68. package/_internal/WithFilters2.js +0 -701
  69. package/_internal/WithFilters2.js.map +0 -1
  70. package/_internal/context.js.map +0 -1
  71. package/_internal/types.js.map +0 -1
  72. /package/{_internal → components/ChartEmptyState/_internal}/ChartEmptyState.js.map +0 -0
  73. /package/{_internal → components/CrossfilterRegistry/_internal}/CrossfilterRegistry.js.map +0 -0
  74. /package/{_internal → components/PdfExportButton/_internal}/PdfExportButton.js.map +0 -0
  75. /package/{_internal → components/WithFilters/_internal}/WithFilters.js.map +0 -0
@@ -1,417 +0,0 @@
1
- import { a as _objectWithoutProperties, D as DashboardContext, b as _extends } from './context.js';
2
- import React, { forwardRef, useState, useContext, useEffect } from 'react';
3
- import { gridFilteredSortedRowEntriesSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector } from '@mui/x-data-grid-pro';
4
- import classNames from 'classnames';
5
- import { saveAs } from 'file-saver';
6
- import { Font, StyleSheet, Document, Page, View, Image, Text, pdf } from '@react-pdf/renderer';
7
- import domToImage from 'dom-to-image';
8
- import { Button, Spinner, RedsiftColorBlueD1 } from '@redsift/design-system';
9
-
10
- // istanbul ignore file
11
- const BACKGROUND_COLOR = '#F8F8F8';
12
- const GREY_1 = '#E2E6EA';
13
- const GREY_2 = '#bff0fd';
14
- const getPdfStyles = primaryColor => {
15
- Font.register({
16
- family: 'Source Code Pro',
17
- fonts: [{
18
- src: 'https://fonts.gstatic.com/s/sourcecodepro/v7/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vT.ttf'
19
- }]
20
- });
21
- Font.register({
22
- family: 'Roboto',
23
- fonts: [{
24
- fontWeight: 700,
25
- src: 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/fonts/roboto/Roboto-Regular.ttf'
26
- }, {
27
- fontWeight: 400,
28
- src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf'
29
- }]
30
- });
31
- return StyleSheet.create({
32
- page: {
33
- borderTopStyle: 'solid',
34
- borderTopWidth: 32,
35
- borderTopColor: primaryColor,
36
- borderBottomStyle: 'solid',
37
- borderBottomWidth: 6,
38
- borderBottomColor: primaryColor,
39
- backgroundColor: BACKGROUND_COLOR,
40
- paddingTop: 20,
41
- paddingBottom: 40
42
- },
43
- logoContainer: {
44
- margin: 0,
45
- paddingBottom: 10,
46
- alignItems: 'center',
47
- width: '100%'
48
- },
49
- logo: {
50
- width: 'auto',
51
- height: 30
52
- },
53
- introductionContainer: {
54
- lineHeight: 1.4,
55
- textAlign: 'center',
56
- marginHorizontal: 40,
57
- marginVertical: 10
58
- },
59
- introductionText: {
60
- fontSize: 8,
61
- fontFamily: 'Roboto',
62
- fontWeight: 400,
63
- color: 'black'
64
- },
65
- pageNumber: {
66
- fontFamily: 'Source Code Pro',
67
- position: 'absolute',
68
- fontSize: 6,
69
- bottom: 5,
70
- right: 20,
71
- left: 0,
72
- textAlign: 'right',
73
- color: 'black'
74
- },
75
- pageContinue: {
76
- fontSize: 8,
77
- fontFamily: 'Roboto',
78
- fontWeight: 400,
79
- top: -10,
80
- left: 20
81
- },
82
- tableContainer: {
83
- backgroundColor: 'white',
84
- marginHorizontal: 20,
85
- marginVertical: 10,
86
- paddingTop: 10,
87
- paddingLeft: 10,
88
- borderRightWidth: 1,
89
- borderBottomWidth: 1,
90
- borderRightColor: BACKGROUND_COLOR,
91
- borderBottomColor: GREY_1,
92
- width: 'auto'
93
- },
94
- tableRowContainer: {
95
- flexDirection: 'row',
96
- borderBottomColor: GREY_2,
97
- alignItems: 'flex-start',
98
- fontSize: 8,
99
- marginLeft: 16,
100
- marginRight: 24,
101
- height: 'auto'
102
- },
103
- tableHeaderContainer: {
104
- flexDirection: 'row',
105
- alignItems: 'flex-start',
106
- fontSize: 7,
107
- fontFamily: 'Roboto',
108
- fontWeight: 700,
109
- marginLeft: 16,
110
- marginRight: 24,
111
- marginBottom: 12,
112
- paddingTop: 12,
113
- paddingBottom: 12,
114
- borderBottomWidth: 2,
115
- borderBottomColor: primaryColor
116
- },
117
- tableCellHeaderText: {
118
- fontSize: 7,
119
- fontFamily: 'Roboto',
120
- fontWeight: 700,
121
- color: 'black',
122
- overflow: 'hidden'
123
- },
124
- tableCellText: {
125
- fontSize: 6,
126
- lineHeight: 1.5,
127
- fontFamily: 'Roboto',
128
- fontWeight: 400,
129
- color: 'black',
130
- overflow: 'hidden'
131
- },
132
- dashboardImageContainer: {
133
- marginHorizontal: 20,
134
- marginTop: 0,
135
- marginBottom: 10
136
- },
137
- constraintsContainer: {
138
- width: 'auto',
139
- height: 'auto',
140
- paddingVertical: 30,
141
- textAlign: 'center'
142
- },
143
- constraints: {
144
- fontSize: 6,
145
- fontFamily: 'Roboto',
146
- fontWeight: 700,
147
- color: 'black'
148
- }
149
- });
150
- };
151
-
152
- // istanbul ignore file
153
- const DEFAULT_COLUMN_WIDTH = 100;
154
- const getWidthColumn = (width, totalW, nrColumns) => {
155
- // calculation width column where the 7px margin between the columns is included
156
- return `${Math.round(width * 100 / (totalW - 7 * (nrColumns - 1)))}%`;
157
- };
158
- const PdfTableRow = _ref => {
159
- let {
160
- rowIndex,
161
- rowData,
162
- columns,
163
- styles,
164
- totalWidth
165
- } = _ref;
166
- return /*#__PURE__*/React.createElement(View, {
167
- style: styles.tableRowContainer,
168
- key: `row-${rowIndex}`
169
- }, columns.map((column, index) => {
170
- const {
171
- field,
172
- width
173
- } = column;
174
- let totalW = totalWidth;
175
- let nrColumns = columns.length;
176
-
177
- // The checkbox in the table will not be printed
178
- if (field === '__check__') {
179
- totalW = totalW - (width || 50);
180
- nrColumns = nrColumns - 1;
181
- return;
182
- }
183
- const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);
184
-
185
- // Empty value will print '-'
186
- if (!rowData[field]) {
187
- return /*#__PURE__*/React.createElement(View, {
188
- style: {
189
- width: widthColumn,
190
- paddingVertical: 2,
191
- marginRight: 7
192
- },
193
- key: `cell-${rowIndex}-${index}`
194
- }, /*#__PURE__*/React.createElement(Text, {
195
- style: styles.tableCellText
196
- }, '-'));
197
- }
198
- return /*#__PURE__*/React.createElement(View, {
199
- style: {
200
- width: widthColumn,
201
- paddingVertical: 2,
202
- marginRight: 7
203
- },
204
- key: `cell-${rowIndex}-${index}`
205
- }, /*#__PURE__*/React.createElement(Text, {
206
- style: styles.tableCellText
207
- }, Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]));
208
- }));
209
- };
210
- const PdfTable = _ref2 => {
211
- let {
212
- dataTable,
213
- styles,
214
- localeText
215
- } = _ref2;
216
- const {
217
- data,
218
- columns,
219
- totalWidth
220
- } = dataTable;
221
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
222
- style: styles.tableHeaderContainer
223
- }, columns.map(column => {
224
- let totalW = totalWidth;
225
- let nrColumns = columns.length;
226
- const {
227
- field,
228
- headerName,
229
- width
230
- } = column;
231
-
232
- // The checkbox in the table will not be printed
233
- if (field === '__check__') {
234
- totalW = totalW - (width || 50);
235
- nrColumns = nrColumns - 1;
236
- return;
237
- }
238
- const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);
239
- return /*#__PURE__*/React.createElement(View, {
240
- style: {
241
- width: widthColumn,
242
- paddingVertical: 2,
243
- marginRight: 7
244
- },
245
- key: `heading-${field}`
246
- }, /*#__PURE__*/React.createElement(Text, {
247
- style: styles.tableCellHeaderText
248
- }, headerName));
249
- })), /*#__PURE__*/React.createElement(View, null, data.map((row, index) => {
250
- if (index < 1000) {
251
- return /*#__PURE__*/React.createElement(PdfTableRow, {
252
- key: index,
253
- rowIndex: index,
254
- rowData: data[index],
255
- columns: columns,
256
- styles: styles,
257
- totalWidth: totalWidth
258
- });
259
- }
260
- })), data.length >= 1000 ? /*#__PURE__*/React.createElement(View, {
261
- style: styles.constraintsContainer
262
- }, /*#__PURE__*/React.createElement(Text, {
263
- style: styles.constraints
264
- }, (localeText === null || localeText === void 0 ? void 0 : localeText.maxSizeDisclaimer) || 'Due to processing constraints this pdf is limited to the first 1000 rows of data.')) : null);
265
- };
266
- const Pagination = _ref3 => {
267
- let {
268
- styles
269
- } = _ref3;
270
- return /*#__PURE__*/React.createElement(Text, {
271
- style: styles.pageNumber,
272
- render: _ref4 => {
273
- let {
274
- pageNumber,
275
- totalPages
276
- } = _ref4;
277
- return `${pageNumber}/${totalPages}`;
278
- },
279
- fixed: true
280
- });
281
- };
282
- const PdfDocument = _ref5 => {
283
- let {
284
- dashboardImage,
285
- introduction,
286
- localeText,
287
- logo,
288
- dataTable,
289
- primaryColor
290
- } = _ref5;
291
- const styles = getPdfStyles(primaryColor);
292
- return /*#__PURE__*/React.createElement(Document, null, /*#__PURE__*/React.createElement(Page, {
293
- size: "A4",
294
- style: styles.page
295
- }, /*#__PURE__*/React.createElement(React.Fragment, null, logo ? /*#__PURE__*/React.createElement(View, {
296
- style: styles.logoContainer
297
- }, /*#__PURE__*/React.createElement(Image, {
298
- src: logo,
299
- style: styles.logo
300
- })) : null, introduction ? /*#__PURE__*/React.createElement(View, {
301
- style: styles.introductionContainer
302
- }, /*#__PURE__*/React.createElement(Text, {
303
- style: styles.introductionText
304
- }, introduction)) : null, dashboardImage ? /*#__PURE__*/React.createElement(View, {
305
- style: styles.dashboardImageContainer
306
- }, /*#__PURE__*/React.createElement(Image, {
307
- src: dashboardImage
308
- })) : null, dataTable ? /*#__PURE__*/React.createElement(View, {
309
- style: styles.tableContainer
310
- }, /*#__PURE__*/React.createElement(PdfTable, {
311
- dataTable: dataTable,
312
- styles: styles,
313
- localeText: localeText
314
- })) : null, /*#__PURE__*/React.createElement(Pagination, {
315
- styles: styles
316
- }))));
317
- };
318
-
319
- const _excluded = ["children", "className", "componentRef", "fileName", "introduction", "localeText", "logo", "onClick", "primaryColor"];
320
- const COMPONENT_NAME = 'PdfExportButton';
321
- const CLASSNAME = 'redsift-pdf-export-button';
322
- const getDashboardImage = async componentRef => {
323
- var _componentRef$current, _componentRef$current2, _componentRef$current3, _componentRef$current4;
324
- const filter = el => {
325
- const classList = el.classList;
326
- return !(classList !== null && classList !== void 0 && classList.contains('redsift-datagrid') || classList !== null && classList !== void 0 && classList.contains('redsift-button'));
327
- };
328
- const dashboardHeight = componentRef.current.getBoundingClientRect().height;
329
- const datagridHeight = ((_componentRef$current = componentRef.current) === null || _componentRef$current === void 0 ? void 0 : (_componentRef$current2 = _componentRef$current.getElementsByClassName('redsift-datagrid')) === null || _componentRef$current2 === void 0 ? void 0 : (_componentRef$current3 = _componentRef$current2[0]) === null || _componentRef$current3 === void 0 ? void 0 : (_componentRef$current4 = _componentRef$current3.getBoundingClientRect()) === null || _componentRef$current4 === void 0 ? void 0 : _componentRef$current4.height) || 0;
330
- return new Promise(resolve => {
331
- domToImage.toPng(componentRef.current, {
332
- filter,
333
- height: dashboardHeight - datagridHeight
334
- }).then(function (dataUrl) {
335
- resolve(dataUrl);
336
- }).catch(() => {
337
- resolve('');
338
- });
339
- });
340
- };
341
- const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
342
- const {
343
- children,
344
- className,
345
- componentRef: propComponentRef,
346
- fileName,
347
- introduction,
348
- localeText,
349
- logo,
350
- onClick,
351
- primaryColor
352
- } = props,
353
- forwardedProps = _objectWithoutProperties(props, _excluded);
354
- const [componentRef, setComponentRef] = useState(propComponentRef);
355
- const [isLoading, setIsLoading] = useState(false);
356
- const {
357
- dashboardRef,
358
- dataGridApiRef
359
- } = useContext(DashboardContext);
360
- useEffect(() => {
361
- if (!componentRef || !componentRef.current) {
362
- setComponentRef(dashboardRef);
363
- }
364
- }, [dashboardRef]);
365
- const exportPdf = async () => {
366
- if (onClick) {
367
- onClick();
368
- }
369
- setIsLoading(true);
370
- try {
371
- const dashboardImage = await getDashboardImage(componentRef || dashboardRef);
372
- let dataTable;
373
- if (dataGridApiRef && dataGridApiRef.current && Object.keys(dataGridApiRef.current).length) {
374
- dataTable = {
375
- data: gridFilteredSortedRowEntriesSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId).slice(0, 1000).map(_ref => {
376
- let {
377
- model
378
- } = _ref;
379
- return model;
380
- }),
381
- columns: gridVisibleColumnDefinitionsSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId),
382
- totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId)
383
- };
384
- }
385
- const doc = /*#__PURE__*/React.createElement(PdfDocument, {
386
- localeText: localeText,
387
- dashboardImage: dashboardImage,
388
- introduction: introduction,
389
- logo: logo,
390
- primaryColor: primaryColor || RedsiftColorBlueD1,
391
- dataTable: dataTable
392
- });
393
- const asPdf = pdf([]);
394
- asPdf.updateContainer(doc);
395
- const blob = await asPdf.toBlob();
396
- saveAs(blob, fileName || 'redsift-dashboard.pdf');
397
- } catch (e) {
398
- console.log('error:', e);
399
- }
400
- setIsLoading(false);
401
- };
402
- return /*#__PURE__*/React.createElement(Button, _extends({
403
- className: classNames(PdfExportButton.className, className),
404
- onClick: exportPdf,
405
- isDisabled: isLoading
406
- }, forwardedProps, {
407
- ref: ref
408
- }), isLoading ? /*#__PURE__*/React.createElement(Spinner, {
409
- size: "xsmall",
410
- isColored: false
411
- }) : null, " ", children);
412
- });
413
- PdfExportButton.className = CLASSNAME;
414
- PdfExportButton.displayName = COMPONENT_NAME;
415
-
416
- export { PdfExportButton as P };
417
- //# sourceMappingURL=PdfExportButton2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PdfExportButton2.js","sources":["../../src/components/PdfExportButton/styles.ts","../../src/components/PdfExportButton/PdfDocument.tsx","../../src/components/PdfExportButton/PdfExportButton.tsx"],"sourcesContent":["// istanbul ignore file\n\nimport { Font, StyleSheet } from '@react-pdf/renderer';\nconst BACKGROUND_COLOR = '#F8F8F8';\nconst GREY_1 = '#E2E6EA';\nconst GREY_2 = '#bff0fd';\n\nexport const getPdfStyles = (primaryColor: string) => {\n Font.register({\n family: 'Source Code Pro',\n fonts: [\n {\n src: 'https://fonts.gstatic.com/s/sourcecodepro/v7/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vT.ttf',\n },\n ],\n });\n\n Font.register({\n family: 'Roboto',\n fonts: [\n {\n fontWeight: 700,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/fonts/roboto/Roboto-Regular.ttf',\n },\n {\n fontWeight: 400,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf',\n },\n ],\n });\n\n return StyleSheet.create({\n page: {\n borderTopStyle: 'solid',\n borderTopWidth: 32,\n borderTopColor: primaryColor,\n borderBottomStyle: 'solid',\n borderBottomWidth: 6,\n borderBottomColor: primaryColor,\n backgroundColor: BACKGROUND_COLOR,\n paddingTop: 20,\n paddingBottom: 40,\n },\n logoContainer: {\n margin: 0,\n paddingBottom: 10,\n alignItems: 'center',\n width: '100%',\n },\n logo: {\n width: 'auto',\n height: 30,\n },\n introductionContainer: {\n lineHeight: 1.4,\n textAlign: 'center',\n marginHorizontal: 40,\n marginVertical: 10,\n },\n introductionText: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n },\n pageNumber: {\n fontFamily: 'Source Code Pro',\n position: 'absolute',\n fontSize: 6,\n bottom: 5,\n right: 20,\n left: 0,\n textAlign: 'right',\n color: 'black',\n },\n pageContinue: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n top: -10,\n left: 20,\n },\n tableContainer: {\n backgroundColor: 'white',\n marginHorizontal: 20,\n marginVertical: 10,\n paddingTop: 10,\n paddingLeft: 10,\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderRightColor: BACKGROUND_COLOR,\n borderBottomColor: GREY_1,\n width: 'auto',\n },\n tableRowContainer: {\n flexDirection: 'row',\n borderBottomColor: GREY_2,\n alignItems: 'flex-start',\n fontSize: 8,\n marginLeft: 16,\n marginRight: 24,\n height: 'auto',\n },\n tableHeaderContainer: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n marginLeft: 16,\n marginRight: 24,\n marginBottom: 12,\n paddingTop: 12,\n paddingBottom: 12,\n borderBottomWidth: 2,\n borderBottomColor: primaryColor,\n },\n tableCellHeaderText: {\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n overflow: 'hidden',\n },\n tableCellText: {\n fontSize: 6,\n lineHeight: 1.5,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n overflow: 'hidden',\n },\n dashboardImageContainer: {\n marginHorizontal: 20,\n marginTop: 0,\n marginBottom: 10,\n },\n constraintsContainer: {\n width: 'auto',\n height: 'auto',\n paddingVertical: 30,\n textAlign: 'center',\n },\n constraints: {\n fontSize: 6,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n },\n });\n};\n","// istanbul ignore file\n\nimport React from 'react';\nimport { Document, Image, Page, Text, View } from '@react-pdf/renderer';\nimport { GridValidRowModel } from '@mui/x-data-grid-pro';\nimport { PdfTableColumn, PdfTableRowProps, PdfTableProps, PdfDocumentProps, PdfStyles } from './types';\nimport { getPdfStyles } from './styles';\n\nconst DEFAULT_COLUMN_WIDTH = 100;\n\nconst getWidthColumn = (width: number, totalW: number, nrColumns: number) => {\n // calculation width column where the 7px margin between the columns is included\n return `${Math.round((width * 100) / (totalW - 7 * (nrColumns - 1)))}%`;\n};\n\nconst PdfTableRow = ({ rowIndex, rowData, columns, styles, totalWidth }: PdfTableRowProps) => {\n return (\n <View style={styles.tableRowContainer} key={`row-${rowIndex}`}>\n {columns.map((column: PdfTableColumn, index: number) => {\n const { field, width } = column;\n let totalW = totalWidth;\n let nrColumns = columns.length;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n // Empty value will print '-'\n if (!rowData[field]) {\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>{'-'}</Text>\n </View>\n );\n }\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>\n {Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]}\n </Text>\n </View>\n );\n })}\n </View>\n );\n};\n\nconst PdfTable = ({ dataTable, styles, localeText }: PdfTableProps) => {\n const { data, columns, totalWidth } = dataTable;\n\n return (\n <>\n <View style={styles.tableHeaderContainer}>\n {columns.map((column: PdfTableColumn) => {\n let totalW = totalWidth;\n let nrColumns = columns.length;\n const { field, headerName, width } = column;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`heading-${field}`}\n >\n <Text style={styles.tableCellHeaderText}>{headerName}</Text>\n </View>\n );\n })}\n </View>\n <View>\n {data.map((row: GridValidRowModel, index: number) => {\n if (index < 1000) {\n return (\n <PdfTableRow\n key={index}\n rowIndex={index}\n rowData={data[index]}\n columns={columns}\n styles={styles}\n totalWidth={totalWidth}\n />\n );\n }\n })}\n </View>\n {data.length >= 1000 ? (\n <View style={styles.constraintsContainer}>\n <Text style={styles.constraints}>\n {localeText?.maxSizeDisclaimer ||\n 'Due to processing constraints this pdf is limited to the first 1000 rows of data.'}\n </Text>\n </View>\n ) : null}\n </>\n );\n};\n\nconst Pagination = ({ styles }: { styles: PdfStyles }) => {\n return (\n <Text style={styles.pageNumber} render={({ pageNumber, totalPages }) => `${pageNumber}/${totalPages}`} fixed />\n );\n};\n\nexport const PdfDocument = ({\n dashboardImage,\n introduction,\n localeText,\n logo,\n dataTable,\n primaryColor,\n}: PdfDocumentProps) => {\n const styles = getPdfStyles(primaryColor);\n\n return (\n <Document>\n <Page size=\"A4\" style={styles.page}>\n <>\n {logo ? (\n <View style={styles.logoContainer}>\n <Image src={logo} style={styles.logo} />\n </View>\n ) : null}\n {introduction ? (\n <View style={styles.introductionContainer}>\n <Text style={styles.introductionText}>{introduction}</Text>\n </View>\n ) : null}\n {dashboardImage ? (\n <View style={styles.dashboardImageContainer}>\n <Image src={dashboardImage as unknown as string} />\n </View>\n ) : null}\n {dataTable ? (\n <View style={styles.tableContainer}>\n <PdfTable dataTable={dataTable} styles={styles} localeText={localeText} />\n </View>\n ) : null}\n\n <Pagination styles={styles} />\n </>\n </Page>\n </Document>\n );\n};\n","// istanbul ignore file\n\nimport React, {\n forwardRef,\n JSXElementConstructor,\n ReactElement,\n RefObject,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n gridFilteredSortedRowEntriesSelector,\n gridVisibleColumnDefinitionsSelector,\n gridColumnsTotalWidthSelector,\n} from '@mui/x-data-grid-pro';\nimport classNames from 'classnames';\nimport { saveAs } from 'file-saver';\nimport { pdf } from '@react-pdf/renderer';\nimport domToImage from 'dom-to-image';\n\nimport { Comp, Button, Spinner, RedsiftColorBlueD1 } from '@redsift/design-system';\n\nimport { PdfExportButtonProps } from './types';\nimport { PdfDocument } from './PdfDocument';\nimport { DashboardContext } from '../Dashboard';\n\nconst COMPONENT_NAME = 'PdfExportButton';\nconst CLASSNAME = 'redsift-pdf-export-button';\n\nconst getDashboardImage = async (componentRef: RefObject<HTMLElement>): Promise<string> => {\n const filter = (el: Node) => {\n const classList = (el as HTMLElement).classList;\n return !(classList?.contains('redsift-datagrid') || classList?.contains('redsift-button'));\n };\n\n const dashboardHeight = (componentRef.current as HTMLElement).getBoundingClientRect().height;\n const datagridHeight =\n (componentRef.current as HTMLElement)?.getElementsByClassName('redsift-datagrid')?.[0]?.getBoundingClientRect()\n ?.height || 0;\n\n return new Promise((resolve) => {\n domToImage\n .toPng(componentRef.current as HTMLElement, {\n filter,\n height: dashboardHeight - datagridHeight,\n })\n .then(function (dataUrl: string) {\n resolve(dataUrl);\n })\n .catch(() => {\n resolve('');\n });\n });\n};\n\nexport const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n componentRef: propComponentRef,\n fileName,\n introduction,\n localeText,\n logo,\n onClick,\n primaryColor,\n ...forwardedProps\n } = props;\n const [componentRef, setComponentRef] = useState(propComponentRef);\n const [isLoading, setIsLoading] = useState(false);\n\n const { dashboardRef, dataGridApiRef } = useContext(DashboardContext);\n\n useEffect(() => {\n if (!componentRef || !componentRef.current) {\n setComponentRef(dashboardRef);\n }\n }, [dashboardRef]);\n\n const exportPdf = async () => {\n if (onClick) {\n onClick();\n }\n setIsLoading(true);\n try {\n const dashboardImage = await getDashboardImage(componentRef || dashboardRef!);\n\n let dataTable;\n if (dataGridApiRef && dataGridApiRef.current && Object.keys(dataGridApiRef.current).length) {\n dataTable = {\n data: gridFilteredSortedRowEntriesSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId)\n .slice(0, 1000)\n .map(({ model }) => model),\n columns: gridVisibleColumnDefinitionsSelector(\n dataGridApiRef.current.state,\n dataGridApiRef.current.instanceId\n ),\n totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId),\n };\n }\n\n const doc = (\n <PdfDocument\n localeText={localeText}\n dashboardImage={dashboardImage}\n introduction={introduction}\n logo={logo}\n primaryColor={primaryColor || RedsiftColorBlueD1}\n dataTable={dataTable}\n />\n );\n const asPdf = pdf([] as unknown as ReactElement<any, string | JSXElementConstructor<any>>);\n asPdf.updateContainer(doc);\n const blob = await asPdf.toBlob();\n saveAs(blob, fileName || 'redsift-dashboard.pdf');\n } catch (e) {\n console.log('error:', e);\n }\n setIsLoading(false);\n };\n\n return (\n <Button\n className={classNames(PdfExportButton.className, className)}\n onClick={exportPdf}\n isDisabled={isLoading}\n {...forwardedProps}\n ref={ref as RefObject<HTMLButtonElement>}\n >\n {isLoading ? <Spinner size=\"xsmall\" isColored={false} /> : null} {children}\n </Button>\n );\n});\nPdfExportButton.className = CLASSNAME;\nPdfExportButton.displayName = COMPONENT_NAME;\n"],"names":["BACKGROUND_COLOR","GREY_1","GREY_2","getPdfStyles","primaryColor","Font","register","family","fonts","src","fontWeight","StyleSheet","create","page","borderTopStyle","borderTopWidth","borderTopColor","borderBottomStyle","borderBottomWidth","borderBottomColor","backgroundColor","paddingTop","paddingBottom","logoContainer","margin","alignItems","width","logo","height","introductionContainer","lineHeight","textAlign","marginHorizontal","marginVertical","introductionText","fontSize","fontFamily","color","pageNumber","position","bottom","right","left","pageContinue","top","tableContainer","paddingLeft","borderRightWidth","borderRightColor","tableRowContainer","flexDirection","marginLeft","marginRight","tableHeaderContainer","marginBottom","tableCellHeaderText","overflow","tableCellText","dashboardImageContainer","marginTop","constraintsContainer","paddingVertical","constraints","DEFAULT_COLUMN_WIDTH","getWidthColumn","totalW","nrColumns","Math","round","PdfTableRow","_ref","rowIndex","rowData","columns","styles","totalWidth","React","createElement","View","style","key","map","column","index","field","length","widthColumn","Text","Array","isArray","join","PdfTable","_ref2","dataTable","localeText","data","Fragment","headerName","row","maxSizeDisclaimer","Pagination","_ref3","render","_ref4","totalPages","fixed","PdfDocument","_ref5","dashboardImage","introduction","Document","Page","size","Image","COMPONENT_NAME","CLASSNAME","getDashboardImage","componentRef","_componentRef$current","_componentRef$current2","_componentRef$current3","_componentRef$current4","filter","el","classList","contains","dashboardHeight","current","getBoundingClientRect","datagridHeight","getElementsByClassName","Promise","resolve","domToImage","toPng","then","dataUrl","catch","PdfExportButton","forwardRef","props","ref","children","className","propComponentRef","fileName","onClick","forwardedProps","_objectWithoutProperties","_excluded","setComponentRef","useState","isLoading","setIsLoading","dashboardRef","dataGridApiRef","useContext","DashboardContext","useEffect","exportPdf","Object","keys","gridFilteredSortedRowEntriesSelector","state","instanceId","slice","model","gridVisibleColumnDefinitionsSelector","gridColumnsTotalWidthSelector","doc","RedsiftColorBlueD1","asPdf","pdf","updateContainer","blob","toBlob","saveAs","e","console","log","Button","_extends","classNames","isDisabled","Spinner","isColored","displayName"],"mappings":";;;;;;;;;AAAA;AAGA,MAAMA,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAMC,MAAM,GAAG,SAAS,CAAA;AACxB,MAAMC,MAAM,GAAG,SAAS,CAAA;AAEjB,MAAMC,YAAY,GAAIC,YAAoB,IAAK;EACpDC,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,iBAAiB;AACzBC,IAAAA,KAAK,EAAE,CACL;AACEC,MAAAA,GAAG,EAAE,mFAAA;KACN,CAAA;AAEL,GAAC,CAAC,CAAA;EAEFJ,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,KAAK,EAAE,CACL;AACEE,MAAAA,UAAU,EAAE,GAAG;AACfD,MAAAA,GAAG,EAAE,2FAAA;AACP,KAAC,EACD;AACEC,MAAAA,UAAU,EAAE,GAAG;AACfD,MAAAA,GAAG,EAAE,yFAAA;KACN,CAAA;AAEL,GAAC,CAAC,CAAA;EAEF,OAAOE,UAAU,CAACC,MAAM,CAAC;AACvBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,cAAc,EAAE,OAAO;AACvBC,MAAAA,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OACtB,CACF,CAAA;AACD,MAAA,MAAM8E,KAAK,GAAGC,GAAG,CAAC,EAAuE,CAAC,CAAA;AAC1FD,MAAAA,KAAK,CAACE,eAAe,CAACJ,GAAG,CAAC,CAAA;AAC1B,MAAA,MAAMK,IAAI,GAAG,MAAMH,KAAK,CAACI,MAAM,EAAE,CAAA;AACjCC,MAAAA,MAAM,CAACF,IAAI,EAAE7B,QAAQ,IAAI,uBAAuB,CAAC,CAAA;KAClD,CAAC,OAAOgC,CAAC,EAAE;AACVC,MAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAEF,CAAC,CAAC,CAAA;AAC1B,KAAA;IACAxB,YAAY,CAAC,KAAK,CAAC,CAAA;GACpB,CAAA;AAED,EAAA,oBACE7E,KAAA,CAAAC,aAAA,CAACuG,MAAM,EAAAC,QAAA,CAAA;IACLtC,SAAS,EAAEuC,UAAU,CAAC5C,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DG,IAAAA,OAAO,EAAEa,SAAU;AACnBwB,IAAAA,UAAU,EAAE/B,SAAAA;AAAU,GAAA,EAClBL,cAAc,EAAA;AAClBN,IAAAA,GAAG,EAAEA,GAAAA;AAAoC,GAAA,CAAA,EAExCW,SAAS,gBAAG5E,KAAA,CAAAC,aAAA,CAAC2G,OAAO,EAAA;AAACxE,IAAAA,IAAI,EAAC,QAAQ;AAACyE,IAAAA,SAAS,EAAE,KAAA;AAAM,GAAE,CAAC,GAAG,IAAI,EAAC,GAAC,EAAC3C,QAC5D,CAAC,CAAA;AAEb,CAAC,EAAC;AACFJ,eAAe,CAACK,SAAS,GAAG5B,SAAS,CAAA;AACrCuB,eAAe,CAACgD,WAAW,GAAGxE,cAAc;;;;"}
@@ -1,2 +0,0 @@
1
- export { T as TimeSeriesBarChart, a as TimeSeriesBarChartSize, b as TimeSeriesBarChartTheme } from './TimeSeriesBarChart2.js';
2
- //# sourceMappingURL=TimeSeriesBarChart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeSeriesBarChart2.js","sources":["../../src/components/TimeSeriesBarChart/types.ts","../../src/components/TimeSeriesBarChart/styles.ts","../../src/components/TimeSeriesBarChart/TimeSeriesBarChart.tsx"],"sourcesContent":["// istanbul ignore file\n\nimport { ComponentProps } from 'react';\nimport { Theme, ValueOf } from '@redsift/design-system';\nimport { ColorTheme, DimensionSelector, JSONArray } from '../../types';\n\ntype SuccessDangerColorTheme = {\n success: string;\n warning: string;\n danger: string;\n neutral?: string;\n};\n\n/**\n * Component size.\n */\nexport const TimeSeriesBarChartSize = {\n large: 'large',\n medium: 'medium',\n small: 'small',\n} as const;\nexport type TimeSeriesBarChartSize = ValueOf<typeof TimeSeriesBarChartSize>;\n\n/**\n * Component theme.\n */\nexport const TimeSeriesBarChartTheme = ColorTheme;\nexport type TimeSeriesBarChartTheme = ValueOf<typeof TimeSeriesBarChartTheme>;\n\nexport type datetimeEnum = 'hour' | 'day' | 'week' | 'month' | 'year';\n\ninterface LocaleText {\n emptyChartTitle?: string;\n emptyChartSubtitle?: string;\n emptyChartResetLabel?: string;\n resetLabel?: string;\n}\n\n/**\n * Component props.\n */\nexport interface TimeSeriesBarChartProps extends ComponentProps<'div'> {\n /** Caption. */\n caption?: string;\n /** Whether the x axis labels are rotated or not. */\n areXLabelsRotated?: boolean;\n /** Field value of the DataGrid column to filter. */\n columnToFilter?: string;\n /** Dataset to use to generate the chart, if no context is provided. */\n data?: JSONArray;\n /** Name of the dataset field that contains the datetime value. */\n dateTimeFieldName: string;\n /** 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. */\n dateTimeFormat?: string;\n /** Datetime unit to used to group values and for x units. */\n dateTimeGroup?: datetimeEnum;\n /** Method that will be used by crossfilter to compute the dimensions of the charts. */\n dimension: DimensionSelector;\n /** Whether the reset button is hidden or not. */\n isResetable?: boolean;\n /** Overriden values for internal labels and texts. */\n localeText?: LocaleText;\n /** Method to call when a filter occured on the chart. */\n onFilter?: (filters?: string[], allFiltered?: JSONArray) => void;\n /** TimeSeriesChart size. */\n size?: TimeSeriesBarChartSize;\n /** 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. */\n colorTheme?: TimeSeriesBarChartTheme | SuccessDangerColorTheme;\n /** Title. */\n title?: string;\n /** Dataset key to use to stack values. */\n stackedCategory?: string;\n /** X Axis Label. */\n xAxisLabel?: string;\n /** Y Axis Label. */\n yAxisLabel?: string;\n}\n\nexport type StyledTimeSeriesBarChartProps = Omit<TimeSeriesBarChartProps, 'dimension' | 'dateTimeFieldName'> & {\n $theme: Theme;\n};\n","// istanbul ignore file\n\nimport styled, { css } from 'styled-components';\nimport { Flexbox } from '@redsift/design-system';\nimport { StyledTimeSeriesBarChartProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledTimeSeriesBarChart = styled.div<StyledTimeSeriesBarChartProps>`\n margin: 16px;\n padding: 16px;\n\n text {\n fill: ${({ $theme }) => `var(--redsift-color-${$theme}-components-text-primary)`};\n }\n\n .redsift-timeseries-barchart__chart {\n display: flex;\n font-family: var(--redsift-typography-font-family-poppins);\n font-size: 12px;\n justify-content: center;\n margin: 8px 0;\n }\n\n svg > g {\n margin: 8px;\n }\n\n .grid-line,\n .axis .grid-line,\n .grid-line line,\n .axis .grid-line line {\n fill: none;\n stroke: #ccc;\n shape-rendering: crispEdges;\n }\n\n .axis text {\n font-family: var(--redsift-typography-font-family-poppins);\n font-size: 10px;\n }\n\n g.stack rect.bar.deselected {\n fill-opacity: 0.5;\n fill: var(--redsift-color-neutral-mid-grey);\n }\n\n .brush .custom-brush-handle {\n fill: #eee;\n stroke: #666;\n cursor: ew-resize;\n }\n\n text {\n user-select: none;\n }\n`;\n\nexport const StyledTimeSeriesBarChartTitle = styled(Flexbox)<StyledTimeSeriesBarChartProps>`\n font-family: var(--redsift-typography-h4-font-family);\n font-size: var(--redsift-typography-h4-font-size);\n font-weight: var(--redsift-typography-h4-font-weight);\n line-height: var(--redsift-typography-h4-line-height);\n`;\n\nexport const StyledTimeSeriesBarChartCaption = styled.p<StyledTimeSeriesBarChartProps>`\n font-family: var(--redsift-typography-caption-font-family);\n font-size: var(--redsift-typography-caption-font-size);\n font-weight: var(--redsift-typography-caption-font-weight);\n line-height: var(--redsift-typography-caption-line-height);\n`;\n\nexport const StyledTimeSeriesBarChartContainer = styled.div<{\n $isEmpty: boolean;\n}>`\n display: flex;\n align-items: center;\n gap: 16px;\n font-family: var(--redsift-typography-font-family-poppins);\n font-size: 11px;\n justify-content: center;\n margin: 8px 0;\n position: relative;\n\n .redsift-timeseries-barchart-container__chart {\n position: relative;\n ${({ $isEmpty }) =>\n $isEmpty\n ? css`\n display: none;\n `\n : ''};\n }\n`;\n","// istanbul ignore file\n\nimport React, { forwardRef, RefObject, useContext, useEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport {\n config as dcconfig,\n filterAll as dcfilterAll,\n filters as dcfilters,\n redrawAll as dcredrawAll,\n barChart as dcbarChart,\n BarChart as dcBarChart,\n UnitFunction as dcUnitFunction,\n} from 'dc';\nimport {\n scaleTime as d3scaleTime,\n timeFormat as d3timeFormat,\n isoParse as d3isoParse,\n utcParse as d3utcParse,\n timeHour as d3timeHour,\n timeHours as d3timeHours,\n timeDay as d3timeDay,\n timeDays as d3timeDays,\n timeWeek as d3timeWeek,\n timeWeeks as d3timeWeeks,\n timeMonth as d3timeMonth,\n timeMonths as d3timeMonths,\n timeYear as d3timeYear,\n timeYears as d3timeYears,\n} from 'd3';\n\nimport { Button, Comp, useId, useTheme } from '@redsift/design-system';\nimport { scheme, useColor } from '@redsift/charts';\n\nimport { DashboardContext, DashboardReducerActionType } from '../Dashboard';\nimport { TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme } from './types';\nimport { JSONObject, JSONArray } from '../../types';\nimport {\n StyledTimeSeriesBarChart,\n StyledTimeSeriesBarChartCaption,\n StyledTimeSeriesBarChartTitle,\n StyledTimeSeriesBarChartContainer,\n} from './styles';\nimport { GridFilterItem } from '@redsift/table';\nimport { ChartEmptyState } from '../ChartEmptyState';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\n\nconst COMPONENT_NAME = 'TimeSeriesBarChart';\nconst CLASSNAME = 'redsift-timeseries-barchart';\n\ntype ChartDimensions = {\n width: number;\n height: number;\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n};\n\nconst getStartDate = (dates: Date[]) => new Date(Math.min(...dates.map(Number)));\nconst getEndDate = (dates: Date[]) => new Date(Math.max(...dates.map(Number)));\n\nconst sizeToDimension = (size: TimeSeriesBarChartSize): ChartDimensions => {\n switch (size) {\n case TimeSeriesBarChartSize.small:\n return {\n width: 400,\n height: 200,\n marginLeft: 16,\n marginTop: 16,\n marginRight: 16,\n marginBottom: 32,\n };\n case TimeSeriesBarChartSize.large:\n return {\n width: 1000,\n height: 300,\n marginLeft: 16,\n marginTop: 16,\n marginRight: 16,\n marginBottom: 32,\n };\n case TimeSeriesBarChartSize.medium:\n default:\n return {\n width: 600,\n height: 250,\n marginLeft: 16,\n marginTop: 16,\n marginRight: 16,\n marginBottom: 32,\n };\n }\n};\n\nconst parseDateTimeGroup = (\n data: JSONArray,\n dateTimeGroup: TimeSeriesBarChartProps['dateTimeGroup'],\n dateTimeFieldName: string\n) => {\n const dates = [...data.map((d: (typeof data)[number]) => new Date(d[dateTimeFieldName] as string))];\n const startDate = getStartDate(dates);\n const endDate = getEndDate(dates);\n\n switch (dateTimeGroup) {\n case 'hour':\n return {\n group: (g: Date) => d3timeHour(g),\n round: (x: Date) => d3timeHour(x),\n x: d3scaleTime().domain([d3timeHour.offset(startDate, -1), d3timeHour.offset(endDate, 2)]),\n xUnits: d3timeHours,\n };\n case 'day':\n return {\n group: (g: Date) => d3timeDay(g),\n round: (x: Date) => d3timeDay(x),\n x: d3scaleTime().domain([d3timeDay.offset(startDate, -1), d3timeDay.offset(endDate, 2)]),\n xUnits: d3timeDays,\n };\n case 'week':\n return {\n group: (g: Date) => d3timeWeek(g),\n round: (x: Date) => d3timeWeek(x),\n x: d3scaleTime().domain([d3timeWeek.offset(startDate, -1), d3timeWeek.offset(endDate, 2)]),\n xUnits: d3timeWeeks,\n };\n case 'year':\n return {\n group: (g: Date) => d3timeYear(g),\n round: (x: Date) => d3timeYear(x),\n x: d3scaleTime().domain([d3timeYear.offset(startDate, -2), d3timeYear.offset(endDate, 2)]),\n xUnits: d3timeYears,\n };\n case 'month':\n default:\n return {\n group: (g: Date) => d3timeMonth(g),\n round: (x: Date) => d3timeMonth(x),\n x: d3scaleTime().domain([d3timeMonth.offset(startDate, -1), d3timeMonth.offset(endDate, 2)]),\n xUnits: d3timeMonths,\n };\n }\n};\n\nexport const TimeSeriesBarChart: Comp<TimeSeriesBarChartProps, HTMLDivElement> = forwardRef((props, ref) => {\n const containerRef = (ref || useRef<HTMLDivElement>()) as RefObject<HTMLDivElement>;\n const chartRef = useRef<HTMLDivElement>() as RefObject<HTMLDivElement>;\n\n const [id] = useId();\n const [chart, setChart] = useState<dcBarChart>();\n\n const {\n areXLabelsRotated,\n caption,\n className,\n colorTheme = props.stackedCategory ? TimeSeriesBarChartTheme.default : TimeSeriesBarChartTheme.monochrome,\n columnToFilter,\n data: propsData,\n dateTimeFieldName,\n dateTimeFormat = '%Y-%m-%d %H:%M:%S',\n dateTimeGroup = 'month',\n dimension,\n isResetable = true,\n localeText,\n onFilter,\n size = TimeSeriesBarChartSize.medium,\n stackedCategory,\n title,\n xAxisLabel,\n yAxisLabel,\n ...forwardedProps\n } = props;\n const theme = useTheme();\n\n // Get overriden labels and texts.\n const { emptyChartTitle, emptyChartSubtitle, emptyChartResetLabel, resetLabel } = {\n resetLabel: 'Reset',\n ...localeText,\n };\n\n // Get charts dimensions based on the selected size.\n const chartDimensions = sizeToDimension(size!);\n\n // Get ndx from context or initialize it.\n const { dispatch, state, data } = useContext(DashboardContext);\n const { tableFilters } = state;\n\n // Set color scheme.\n const colorScale = useColor({\n data: propsData ?? data,\n colorTheme: colorTheme!,\n category: stackedCategory ?? '',\n theme,\n });\n\n const ndx = CrossfilterRegistry.get(propsData ? propsData : data);\n\n // useEffect called only once to initialize the chart.\n useEffect(() => {\n if (chartRef.current) {\n dcconfig.defaultColors(scheme.default);\n const parseTime = d3utcParse(dateTimeFormat!);\n const barChart = dcbarChart(chartRef.current as any);\n const dataset = ndx.all();\n\n // Get time methods based on props\n const { group, round, x, xUnits } = parseDateTimeGroup(dataset as JSONArray, dateTimeGroup, dateTimeFieldName);\n\n // Compute dimension and group.\n const computedDimension = ndx.dimension((d: JSONArray) => parseTime(dimension(d) as string) as Date);\n const timeGroup = computedDimension.group(group);\n\n // Initialize the chart.\n barChart\n .width(chartDimensions.width)\n .height(chartDimensions.height - (areXLabelsRotated ? 30 : 0))\n .dimension(computedDimension)\n .x(x)\n .xUnits(xUnits as dcUnitFunction)\n .round(round)\n .centerBar(true)\n .alwaysUseRounding(true)\n .renderHorizontalGridLines(true)\n .margins({\n left: chartDimensions.marginLeft! + (yAxisLabel ? 24 : 0),\n top: chartDimensions.marginTop!,\n right: chartDimensions.marginRight!,\n bottom: chartDimensions.marginBottom!,\n })\n .barPadding(0.2);\n\n barChart.yAxis().ticks(5);\n\n // Add label to axis.\n if (xAxisLabel) {\n barChart.xAxisLabel(xAxisLabel);\n }\n if (yAxisLabel) {\n barChart.yAxisLabel(yAxisLabel);\n }\n\n // Rotate labels and reset the height, if asked for.\n if (areXLabelsRotated) {\n barChart.on('pretransition', (rowChart) => {\n barChart\n .select('.axis')\n .attr('text-anchor', 'end')\n .selectAll('text')\n .attr('transform', 'translate(-6,5) rotate(-45)');\n rowChart.select('svg').attr('height', chartDimensions.height);\n });\n }\n\n // Set group whether the chart is stacked or not.\n if (!stackedCategory) {\n barChart.group(timeGroup).colors(colorScale as any);\n } else if (dataset.length) {\n if (!Array.isArray(dataset[0][stackedCategory])) {\n const categories = dataset.reduce((acc: string[], curr: JSONObject) => {\n if (acc.indexOf(curr[stackedCategory] as string) === -1) {\n acc.push(curr[stackedCategory] as string);\n }\n return acc;\n }, []);\n const stackedTimeGroup = timeGroup.reduce(\n (p, v) => {\n (p as JSONObject)[v[stackedCategory]] = (((p as JSONObject)[v[stackedCategory]] as number) || 0) + 1;\n return p;\n },\n (p, v) => {\n (p as JSONObject)[v[stackedCategory]] = (((p as JSONObject)[v[stackedCategory]] as number) || 0) - 1;\n return p;\n },\n () => ({})\n );\n barChart\n .group(\n stackedTimeGroup,\n categories[0], // @ts-expect-error\n (\n (cat) => (d: { key: Date; value: { [key: string]: number } }) =>\n d.value[cat]\n )(categories[0])\n )\n .colors(colorScale as any);\n for (var i = 1; i < categories.length; ++i) {\n barChart.stack(\n stackedTimeGroup,\n categories[i],\n (\n (cat) => (d) =>\n d.value[cat]\n )(categories[i])\n );\n }\n } else {\n const categories = dataset.reduce((acc: string[], curr: JSONObject) => {\n (curr[stackedCategory] as string[]).forEach((val: string) => {\n if (acc.indexOf(val) === -1) {\n acc.push(val);\n }\n });\n return acc;\n }, []);\n const stackedTimeGroup = timeGroup.reduce(\n (p, v) => {\n v[stackedCategory].forEach((val: string) => {\n (p as JSONObject)[val] = (((p as JSONObject)[val] as number) || 0) + 1;\n });\n return p;\n },\n (p, v) => {\n v[stackedCategory].forEach((val: string) => {\n (p as JSONObject)[val] = (((p as JSONObject)[val] as number) || 0) - 1;\n });\n return p;\n },\n () => ({})\n );\n barChart\n .group(\n stackedTimeGroup,\n categories[0], // @ts-expect-error\n (\n (cat) => (d: { key: Date; value: { [key: string]: number } }) =>\n d.value[cat]\n )(categories[0])\n )\n .colors(colorScale as any);\n for (var i = 1; i < categories.length; ++i) {\n barChart.stack(\n stackedTimeGroup,\n categories[i],\n (\n (cat) => (d: { key: Date; value: { [key: string]: number } }) =>\n d.value[cat]\n )(categories[i])\n );\n }\n }\n }\n\n // Dispatch filters to datagrid when a value is selected or unselected.\n const formatTime = d3timeFormat('%Y-%m-%dT%H:%M');\n barChart.on('filtered', () => {\n if (columnToFilter) {\n const dateArray = barChart.filters()?.[0];\n if (Array.isArray(dateArray) && dateArray.length === 2) {\n dispatch?.({\n type: DashboardReducerActionType.FilterTableBatch,\n filter: [\n {\n id: `${barChart.anchorName()}-start`,\n columnField: columnToFilter,\n operatorValue: 'after',\n value: formatTime(dateArray[0]),\n },\n {\n id: `${barChart.anchorName()}-end`,\n columnField: columnToFilter,\n operatorValue: 'onOrBefore',\n value: formatTime(dateArray[1]),\n },\n ],\n });\n }\n }\n\n onFilter?.(barChart.filters(), ndx.allFiltered());\n });\n\n // Render the chart.\n barChart.render();\n\n // Store chart for further use.\n setChart(barChart);\n }\n }, [propsData, data]);\n\n // Filter chart if context is updated by an external component.\n const filterStart = tableFilters.find(\n (filter) => filter.columnField === columnToFilter && filter.operatorValue === 'after'\n );\n const filterEnd = tableFilters.find(\n (filter) => filter.columnField === columnToFilter && filter.operatorValue === 'onOrBefore'\n );\n useEffect(() => {\n if (chart && filterStart && filterEnd && filterStart.value && filterEnd.value) {\n const chartFiltersObj = chart.filters();\n const chartFilters = chartFiltersObj?.[0];\n const chartFilterStart = chartFilters?.[0];\n const chartFilterEnd = chartFilters?.[1];\n if (chartFilterStart !== d3isoParse(filterStart.value) && chartFilterEnd !== d3isoParse(filterEnd.value)) {\n chart.filter(null);\n chart.filter(\n dcfilters.RangedFilter(\n d3isoParse(filterStart.value)?.getTime() || 0,\n d3isoParse(filterEnd.value)?.getTime() || 0\n )\n );\n dcredrawAll();\n }\n }\n }, [filterStart?.value, filterEnd?.value]);\n\n return (\n <StyledTimeSeriesBarChart\n {...forwardedProps}\n className={classNames(TimeSeriesBarChart.className, className)}\n ref={containerRef as RefObject<HTMLDivElement>}\n $theme={theme}\n >\n <StyledTimeSeriesBarChartTitle\n className={`${TimeSeriesBarChart.className}__title`}\n alignItems=\"center\"\n $theme={theme}\n >\n {title ? <div id={`id${id}__title`}>{title}</div> : null}\n {chart && isResetable ? (\n <Button\n variant=\"unstyled\"\n onClick={() => {\n chart.filter(null);\n dcredrawAll();\n\n if (columnToFilter) {\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: `${chart.anchorName()}-start`,\n columnField: columnToFilter,\n operatorValue: 'after',\n } as GridFilterItem,\n });\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: `${chart.anchorName()}-end`,\n columnField: columnToFilter,\n operatorValue: 'onOrBefore',\n } as GridFilterItem,\n });\n }\n }}\n >\n {resetLabel}\n </Button>\n ) : null}\n </StyledTimeSeriesBarChartTitle>\n\n <StyledTimeSeriesBarChartContainer\n className={`${TimeSeriesBarChart.className}__container`}\n $isEmpty={ndx.all().length === 0}\n >\n <div\n className={`${TimeSeriesBarChart.className}-container__chart`}\n ref={chartRef as RefObject<HTMLDivElement>}\n />\n {ndx.all().length === 0 ? (\n <ChartEmptyState\n title={emptyChartTitle!}\n subtitle={emptyChartSubtitle}\n resetLabel={emptyChartResetLabel}\n onReset={() => {\n dcfilterAll();\n dcredrawAll();\n dispatch?.({\n type: DashboardReducerActionType.ResetFilters,\n });\n }}\n />\n ) : null}\n </StyledTimeSeriesBarChartContainer>\n\n {caption ? (\n <StyledTimeSeriesBarChartCaption\n className={`${TimeSeriesBarChart.className}__caption`}\n id={`id${id}__caption`}\n $theme={theme}\n >\n {caption}\n </StyledTimeSeriesBarChartCaption>\n ) : null}\n </StyledTimeSeriesBarChart>\n );\n});\nTimeSeriesBarChart.className = CLASSNAME;\nTimeSeriesBarChart.displayName = COMPONENT_NAME;\n"],"names":["TimeSeriesBarChartSize","large","medium","small","TimeSeriesBarChartTheme","ColorTheme","StyledTimeSeriesBarChart","styled","div","_ref","$theme","StyledTimeSeriesBarChartTitle","Flexbox","StyledTimeSeriesBarChartCaption","p","StyledTimeSeriesBarChartContainer","_ref2","$isEmpty","css","COMPONENT_NAME","CLASSNAME","getStartDate","dates","Date","Math","min","map","Number","getEndDate","max","sizeToDimension","size","width","height","marginLeft","marginTop","marginRight","marginBottom","parseDateTimeGroup","data","dateTimeGroup","dateTimeFieldName","d","startDate","endDate","group","g","d3timeHour","round","x","d3scaleTime","domain","offset","xUnits","d3timeHours","d3timeDay","d3timeDays","d3timeWeek","d3timeWeeks","d3timeYear","d3timeYears","d3timeMonth","d3timeMonths","TimeSeriesBarChart","forwardRef","props","ref","containerRef","useRef","chartRef","id","useId","chart","setChart","useState","areXLabelsRotated","caption","className","colorTheme","stackedCategory","default","monochrome","columnToFilter","propsData","dateTimeFormat","dimension","isResetable","localeText","onFilter","title","xAxisLabel","yAxisLabel","forwardedProps","_objectWithoutProperties","_excluded","theme","useTheme","emptyChartTitle","emptyChartSubtitle","emptyChartResetLabel","resetLabel","_objectSpread","chartDimensions","dispatch","state","useContext","DashboardContext","tableFilters","colorScale","useColor","category","ndx","CrossfilterRegistry","get","useEffect","current","dcconfig","defaultColors","scheme","parseTime","d3utcParse","barChart","dcbarChart","dataset","all","computedDimension","timeGroup","centerBar","alwaysUseRounding","renderHorizontalGridLines","margins","left","top","right","bottom","barPadding","yAxis","ticks","on","rowChart","select","attr","selectAll","colors","length","Array","isArray","categories","reduce","acc","curr","indexOf","push","stackedTimeGroup","v","cat","value","i","stack","forEach","val","formatTime","d3timeFormat","_barChart$filters","dateArray","filters","type","DashboardReducerActionType","FilterTableBatch","filter","anchorName","columnField","operatorValue","allFiltered","render","filterStart","find","filterEnd","chartFiltersObj","chartFilters","chartFilterStart","chartFilterEnd","d3isoParse","_d3isoParse","_d3isoParse2","dcfilters","RangedFilter","getTime","dcredrawAll","React","createElement","_extends","classNames","alignItems","Button","variant","onClick","ResetFilter","ChartEmptyState","subtitle","onReset","dcfilterAll","ResetFilters","displayName"],"mappings":";;;;;;;;;;;;AAAA;AAaA;AACA;AACA;AACO,MAAMA,sBAAsB,GAAG;AACpCC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAU;AAGV;AACA;AACA;AACO,MAAMC,uBAAuB,GAAGC,WAAU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