@redsift/dashboard 11.6.0-muiv5-alpha.11 → 11.6.0-muiv5-alpha.13

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/ChartEmptyState.js +2 -0
  2. package/{components/ChartEmptyState/_internal → _internal}/ChartEmptyState2.js +33 -2
  3. package/_internal/ChartEmptyState2.js.map +1 -0
  4. package/_internal/CrossfilterRegistry.js +2 -0
  5. package/{components/CrossfilterRegistry/_internal → _internal}/CrossfilterRegistry2.js +1 -1
  6. package/_internal/CrossfilterRegistry2.js.map +1 -0
  7. package/_internal/Dashboard.js +4 -0
  8. package/{components/Dashboard/_internal → _internal}/Dashboard.js.map +1 -1
  9. package/{components/Dashboard/_internal/reducer.js → _internal/Dashboard2.js} +44 -4
  10. package/_internal/Dashboard2.js.map +1 -0
  11. package/_internal/PdfExportButton.js +2 -0
  12. package/_internal/PdfExportButton2.js +417 -0
  13. package/_internal/PdfExportButton2.js.map +1 -0
  14. package/_internal/TimeSeriesBarChart.js +2 -0
  15. package/{components/TimeSeriesBarChart/_internal → _internal}/TimeSeriesBarChart.js.map +1 -1
  16. package/{components/TimeSeriesBarChart/_internal → _internal}/TimeSeriesBarChart2.js +119 -10
  17. package/_internal/TimeSeriesBarChart2.js.map +1 -0
  18. package/_internal/WithFilters.js +2 -0
  19. package/_internal/WithFilters2.js +701 -0
  20. package/_internal/WithFilters2.js.map +1 -0
  21. package/{_virtual/_internal/_rollupPluginBabelHelpers.js → _internal/context.js} +11 -2
  22. package/_internal/context.js.map +1 -0
  23. package/{components/Dashboard/_internal → _internal}/types.js +1 -1
  24. package/_internal/types.js.map +1 -0
  25. package/index.js +15 -11
  26. package/index.js.map +1 -1
  27. package/package.json +2 -2
  28. package/_virtual/_internal/_rollupPluginBabelHelpers.js.map +0 -1
  29. package/components/ChartEmptyState/_internal/ChartEmptyState.js +0 -2
  30. package/components/ChartEmptyState/_internal/ChartEmptyState2.js.map +0 -1
  31. package/components/ChartEmptyState/_internal/styles.js +0 -35
  32. package/components/ChartEmptyState/_internal/styles.js.map +0 -1
  33. package/components/CrossfilterRegistry/_internal/CrossfilterRegistry.js +0 -2
  34. package/components/CrossfilterRegistry/_internal/CrossfilterRegistry2.js.map +0 -1
  35. package/components/Dashboard/_internal/Dashboard.js +0 -5
  36. package/components/Dashboard/_internal/Dashboard2.js +0 -46
  37. package/components/Dashboard/_internal/Dashboard2.js.map +0 -1
  38. package/components/Dashboard/_internal/context.js +0 -11
  39. package/components/Dashboard/_internal/context.js.map +0 -1
  40. package/components/Dashboard/_internal/reducer.js.map +0 -1
  41. package/components/Dashboard/_internal/types.js.map +0 -1
  42. package/components/PdfExportButton/_internal/PdfDocument.js +0 -173
  43. package/components/PdfExportButton/_internal/PdfDocument.js.map +0 -1
  44. package/components/PdfExportButton/_internal/PdfExportButton.js +0 -2
  45. package/components/PdfExportButton/_internal/PdfExportButton2.js +0 -110
  46. package/components/PdfExportButton/_internal/PdfExportButton2.js.map +0 -1
  47. package/components/PdfExportButton/_internal/styles.js +0 -146
  48. package/components/PdfExportButton/_internal/styles.js.map +0 -1
  49. package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart.js +0 -3
  50. package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart2.js.map +0 -1
  51. package/components/TimeSeriesBarChart/_internal/styles.js +0 -98
  52. package/components/TimeSeriesBarChart/_internal/styles.js.map +0 -1
  53. package/components/TimeSeriesBarChart/_internal/types.js +0 -22
  54. package/components/TimeSeriesBarChart/_internal/types.js.map +0 -1
  55. package/components/WithFilters/_internal/FilterableBarChart.js +0 -152
  56. package/components/WithFilters/_internal/FilterableBarChart.js.map +0 -1
  57. package/components/WithFilters/_internal/FilterableDataGrid.js +0 -51
  58. package/components/WithFilters/_internal/FilterableDataGrid.js.map +0 -1
  59. package/components/WithFilters/_internal/FilterablePieChart.js +0 -160
  60. package/components/WithFilters/_internal/FilterablePieChart.js.map +0 -1
  61. package/components/WithFilters/_internal/FilterableScatterPlot.js +0 -252
  62. package/components/WithFilters/_internal/FilterableScatterPlot.js.map +0 -1
  63. package/components/WithFilters/_internal/WithFilters.js +0 -2
  64. package/components/WithFilters/_internal/WithFilters2.js +0 -36
  65. package/components/WithFilters/_internal/WithFilters2.js.map +0 -1
  66. package/hooks/_internal/useCategoricalChartAsListbox.js +0 -94
  67. package/hooks/_internal/useCategoricalChartAsListbox.js.map +0 -1
  68. package/utils/groupReducers/_internal/groupReduceCount.js +0 -5
  69. package/utils/groupReducers/_internal/groupReduceCount.js.map +0 -1
  70. package/utils/groupReducers/_internal/groupReduceSum.js +0 -5
  71. package/utils/groupReducers/_internal/groupReduceSum.js.map +0 -1
  72. /package/{components/ChartEmptyState/_internal → _internal}/ChartEmptyState.js.map +0 -0
  73. /package/{components/CrossfilterRegistry/_internal → _internal}/CrossfilterRegistry.js.map +0 -0
  74. /package/{components/PdfExportButton/_internal → _internal}/PdfExportButton.js.map +0 -0
  75. /package/{components/WithFilters/_internal → _internal}/WithFilters.js.map +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"PdfDocument.js","sources":["../../../../src/components/PdfExportButton/PdfDocument.tsx"],"sourcesContent":["// 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"],"names":["DEFAULT_COLUMN_WIDTH","getWidthColumn","width","totalW","nrColumns","Math","round","PdfTableRow","_ref","rowIndex","rowData","columns","styles","totalWidth","React","createElement","View","style","tableRowContainer","key","map","column","index","field","length","widthColumn","paddingVertical","marginRight","Text","tableCellText","Array","isArray","join","PdfTable","_ref2","dataTable","localeText","data","Fragment","tableHeaderContainer","headerName","tableCellHeaderText","row","constraintsContainer","constraints","maxSizeDisclaimer","Pagination","_ref3","pageNumber","render","_ref4","totalPages","fixed","PdfDocument","_ref5","dashboardImage","introduction","logo","primaryColor","getPdfStyles","Document","Page","size","page","logoContainer","Image","src","introductionContainer","introductionText","dashboardImageContainer","tableContainer"],"mappings":";;;;AAAA;AAQA,MAAMA,oBAAoB,GAAG,GAAG,CAAA;AAEhC,MAAMC,cAAc,GAAGA,CAACC,KAAa,EAAEC,MAAc,EAA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CAACkB,QAAQ,EAAA;AAACE,IAAAA,SAAS,EAAEA,SAAU;AAACvB,IAAAA,MAAM,EAAEA,MAAO;AAACwB,IAAAA,UAAU,EAAEA,UAAAA;GAAa,CACrE,CAAC,GACL,IAAI,eAERtB,KAAA,CAAAC,aAAA,CAAC+B,UAAU,EAAA;AAAClC,IAAAA,MAAM,EAAEA,MAAAA;GAAS,CAC7B,CACE,CACE,CAAC,CAAA;AAEf;;;;"}
@@ -1,2 +0,0 @@
1
- export { PdfExportButton } from './PdfExportButton2.js';
2
- //# sourceMappingURL=PdfExportButton.js.map
@@ -1,110 +0,0 @@
1
- import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.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 { pdf } from '@react-pdf/renderer';
7
- import domToImage from 'dom-to-image';
8
- import { Button, Spinner, RedsiftColorBlueD1 } from '@redsift/design-system';
9
- import { PdfDocument } from './PdfDocument.js';
10
- import { DashboardContext } from '../../Dashboard/_internal/context.js';
11
-
12
- const _excluded = ["children", "className", "componentRef", "fileName", "introduction", "localeText", "logo", "onClick", "primaryColor"];
13
- const COMPONENT_NAME = 'PdfExportButton';
14
- const CLASSNAME = 'redsift-pdf-export-button';
15
- const getDashboardImage = async componentRef => {
16
- var _componentRef$current, _componentRef$current2, _componentRef$current3, _componentRef$current4;
17
- const filter = el => {
18
- const classList = el.classList;
19
- return !(classList !== null && classList !== void 0 && classList.contains('redsift-datagrid') || classList !== null && classList !== void 0 && classList.contains('redsift-button'));
20
- };
21
- const dashboardHeight = componentRef.current.getBoundingClientRect().height;
22
- 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;
23
- return new Promise(resolve => {
24
- domToImage.toPng(componentRef.current, {
25
- filter,
26
- height: dashboardHeight - datagridHeight
27
- }).then(function (dataUrl) {
28
- resolve(dataUrl);
29
- }).catch(() => {
30
- resolve('');
31
- });
32
- });
33
- };
34
- const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
35
- const {
36
- children,
37
- className,
38
- componentRef: propComponentRef,
39
- fileName,
40
- introduction,
41
- localeText,
42
- logo,
43
- onClick,
44
- primaryColor
45
- } = props,
46
- forwardedProps = _objectWithoutProperties(props, _excluded);
47
- const [componentRef, setComponentRef] = useState(propComponentRef);
48
- const [isLoading, setIsLoading] = useState(false);
49
- const {
50
- dashboardRef,
51
- dataGridApiRef
52
- } = useContext(DashboardContext);
53
- useEffect(() => {
54
- if (!componentRef || !componentRef.current) {
55
- setComponentRef(dashboardRef);
56
- }
57
- }, [dashboardRef]);
58
- const exportPdf = async () => {
59
- if (onClick) {
60
- onClick();
61
- }
62
- setIsLoading(true);
63
- try {
64
- const dashboardImage = await getDashboardImage(componentRef || dashboardRef);
65
- let dataTable;
66
- if (dataGridApiRef && dataGridApiRef.current && Object.keys(dataGridApiRef.current).length) {
67
- dataTable = {
68
- data: gridFilteredSortedRowEntriesSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId).slice(0, 1000).map(_ref => {
69
- let {
70
- model
71
- } = _ref;
72
- return model;
73
- }),
74
- columns: gridVisibleColumnDefinitionsSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId),
75
- totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId)
76
- };
77
- }
78
- const doc = /*#__PURE__*/React.createElement(PdfDocument, {
79
- localeText: localeText,
80
- dashboardImage: dashboardImage,
81
- introduction: introduction,
82
- logo: logo,
83
- primaryColor: primaryColor || RedsiftColorBlueD1,
84
- dataTable: dataTable
85
- });
86
- const asPdf = pdf([]);
87
- asPdf.updateContainer(doc);
88
- const blob = await asPdf.toBlob();
89
- saveAs(blob, fileName || 'redsift-dashboard.pdf');
90
- } catch (e) {
91
- console.log('error:', e);
92
- }
93
- setIsLoading(false);
94
- };
95
- return /*#__PURE__*/React.createElement(Button, _extends({
96
- className: classNames(PdfExportButton.className, className),
97
- onClick: exportPdf,
98
- isDisabled: isLoading
99
- }, forwardedProps, {
100
- ref: ref
101
- }), isLoading ? /*#__PURE__*/React.createElement(Spinner, {
102
- size: "xsmall",
103
- isColored: false
104
- }) : null, " ", children);
105
- });
106
- PdfExportButton.className = CLASSNAME;
107
- PdfExportButton.displayName = COMPONENT_NAME;
108
-
109
- export { PdfExportButton };
110
- //# sourceMappingURL=PdfExportButton2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PdfExportButton2.js","sources":["../../../../src/components/PdfExportButton/PdfExportButton.tsx"],"sourcesContent":["// 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":["COMPONENT_NAME","CLASSNAME","getDashboardImage","componentRef","_componentRef$current","_componentRef$current2","_componentRef$current3","_componentRef$current4","filter","el","classList","contains","dashboardHeight","current","getBoundingClientRect","height","datagridHeight","getElementsByClassName","Promise","resolve","domToImage","toPng","then","dataUrl","catch","PdfExportButton","forwardRef","props","ref","children","className","propComponentRef","fileName","introduction","localeText","logo","onClick","primaryColor","forwardedProps","_objectWithoutProperties","_excluded","setComponentRef","useState","isLoading","setIsLoading","dashboardRef","dataGridApiRef","useContext","DashboardContext","useEffect","exportPdf","dashboardImage","dataTable","Object","keys","length","data","gridFilteredSortedRowEntriesSelector","state","instanceId","slice","map","_ref","model","columns","gridVisibleColumnDefinitionsSelector","totalWidth","gridColumnsTotalWidthSelector","doc","React","createElement","PdfDocument","RedsiftColorBlueD1","asPdf","pdf","updateContainer","blob","toBlob","saveAs","e","console","log","Button","_extends","classNames","isDisabled","Spinner","size","isColored","displayName"],"mappings":";;;;;;;;;;;;AA2BA,MAAMA,cAAc,GAAG,iBAAiB,CAAA;AACxC,MAAMC,SAAS,GAAG,2BAA2B,CAAA;AAE7C,MAAMC,iBAAiB,GAAG,MAAOC,YAAoC,IAAsB;AAAA,EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,CAAA;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ACVC,MAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAEF,CAAC,CAAC,CAAA;AAC1B,KAAA;IACAnC,YAAY,CAAC,KAAK,CAAC,CAAA;GACpB,CAAA;AAED,EAAA,oBACEyB,KAAA,CAAAC,aAAA,CAACY,MAAM,EAAAC,QAAA,CAAA;IACLrD,SAAS,EAAEsD,UAAU,CAAC3D,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DM,IAAAA,OAAO,EAAEc,SAAU;AACnBmC,IAAAA,UAAU,EAAE1C,SAAAA;AAAU,GAAA,EAClBL,cAAc,EAAA;AAClBV,IAAAA,GAAG,EAAEA,GAAAA;AAAoC,GAAA,CAAA,EAExCe,SAAS,gBAAG0B,KAAA,CAAAC,aAAA,CAACgB,OAAO,EAAA;AAACC,IAAAA,IAAI,EAAC,QAAQ;AAACC,IAAAA,SAAS,EAAE,KAAA;AAAM,GAAE,CAAC,GAAG,IAAI,EAAC,GAAC,EAAC3D,QAC5D,CAAC,CAAA;AAEb,CAAC,EAAC;AACFJ,eAAe,CAACK,SAAS,GAAG7B,SAAS,CAAA;AACrCwB,eAAe,CAACgE,WAAW,GAAGzF,cAAc;;;;"}
@@ -1,146 +0,0 @@
1
- import { Font, StyleSheet } from '@react-pdf/renderer';
2
-
3
- // istanbul ignore file
4
- const BACKGROUND_COLOR = '#F8F8F8';
5
- const GREY_1 = '#E2E6EA';
6
- const GREY_2 = '#bff0fd';
7
- const getPdfStyles = primaryColor => {
8
- Font.register({
9
- family: 'Source Code Pro',
10
- fonts: [{
11
- src: 'https://fonts.gstatic.com/s/sourcecodepro/v7/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vT.ttf'
12
- }]
13
- });
14
- Font.register({
15
- family: 'Roboto',
16
- fonts: [{
17
- fontWeight: 700,
18
- src: 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/fonts/roboto/Roboto-Regular.ttf'
19
- }, {
20
- fontWeight: 400,
21
- src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf'
22
- }]
23
- });
24
- return StyleSheet.create({
25
- page: {
26
- borderTopStyle: 'solid',
27
- borderTopWidth: 32,
28
- borderTopColor: primaryColor,
29
- borderBottomStyle: 'solid',
30
- borderBottomWidth: 6,
31
- borderBottomColor: primaryColor,
32
- backgroundColor: BACKGROUND_COLOR,
33
- paddingTop: 20,
34
- paddingBottom: 40
35
- },
36
- logoContainer: {
37
- margin: 0,
38
- paddingBottom: 10,
39
- alignItems: 'center',
40
- width: '100%'
41
- },
42
- logo: {
43
- width: 'auto',
44
- height: 30
45
- },
46
- introductionContainer: {
47
- lineHeight: 1.4,
48
- textAlign: 'center',
49
- marginHorizontal: 40,
50
- marginVertical: 10
51
- },
52
- introductionText: {
53
- fontSize: 8,
54
- fontFamily: 'Roboto',
55
- fontWeight: 400,
56
- color: 'black'
57
- },
58
- pageNumber: {
59
- fontFamily: 'Source Code Pro',
60
- position: 'absolute',
61
- fontSize: 6,
62
- bottom: 5,
63
- right: 20,
64
- left: 0,
65
- textAlign: 'right',
66
- color: 'black'
67
- },
68
- pageContinue: {
69
- fontSize: 8,
70
- fontFamily: 'Roboto',
71
- fontWeight: 400,
72
- top: -10,
73
- left: 20
74
- },
75
- tableContainer: {
76
- backgroundColor: 'white',
77
- marginHorizontal: 20,
78
- marginVertical: 10,
79
- paddingTop: 10,
80
- paddingLeft: 10,
81
- borderRightWidth: 1,
82
- borderBottomWidth: 1,
83
- borderRightColor: BACKGROUND_COLOR,
84
- borderBottomColor: GREY_1,
85
- width: 'auto'
86
- },
87
- tableRowContainer: {
88
- flexDirection: 'row',
89
- borderBottomColor: GREY_2,
90
- alignItems: 'flex-start',
91
- fontSize: 8,
92
- marginLeft: 16,
93
- marginRight: 24,
94
- height: 'auto'
95
- },
96
- tableHeaderContainer: {
97
- flexDirection: 'row',
98
- alignItems: 'flex-start',
99
- fontSize: 7,
100
- fontFamily: 'Roboto',
101
- fontWeight: 700,
102
- marginLeft: 16,
103
- marginRight: 24,
104
- marginBottom: 12,
105
- paddingTop: 12,
106
- paddingBottom: 12,
107
- borderBottomWidth: 2,
108
- borderBottomColor: primaryColor
109
- },
110
- tableCellHeaderText: {
111
- fontSize: 7,
112
- fontFamily: 'Roboto',
113
- fontWeight: 700,
114
- color: 'black',
115
- overflow: 'hidden'
116
- },
117
- tableCellText: {
118
- fontSize: 6,
119
- lineHeight: 1.5,
120
- fontFamily: 'Roboto',
121
- fontWeight: 400,
122
- color: 'black',
123
- overflow: 'hidden'
124
- },
125
- dashboardImageContainer: {
126
- marginHorizontal: 20,
127
- marginTop: 0,
128
- marginBottom: 10
129
- },
130
- constraintsContainer: {
131
- width: 'auto',
132
- height: 'auto',
133
- paddingVertical: 30,
134
- textAlign: 'center'
135
- },
136
- constraints: {
137
- fontSize: 6,
138
- fontFamily: 'Roboto',
139
- fontWeight: 700,
140
- color: 'black'
141
- }
142
- });
143
- };
144
-
145
- export { getPdfStyles };
146
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/PdfExportButton/styles.ts"],"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"],"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"],"mappings":";;AAAA;AAGA,MAAMA,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAMC,MAAM,GAAG,SAAS,CAAA;AACxB,MAAMC,MAAM,GAAG,SAAS,CAAA;AAEXC,MAAAA,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;AACf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AU,EAAE,EAAE;AACdC,MAAAA,aAAa,EAAE,EAAE;AACjBJ,MAAAA,iBAAiB,EAAE,CAAC;AACpBC,MAAAA,iBAAiB,EAAEf,YAAAA;KACpB;AACDmD,IAAAA,mBAAmB,EAAE;AACnBpB,MAAAA,QAAQ,EAAE,CAAC;AACXC,MAAAA,UAAU,EAAE,QAAQ;AACpB1B,MAAAA,UAAU,EAAE,GAAG;AACf2B,MAAAA,KAAK,EAAE,OAAO;AACdmB,MAAAA,QAAQ,EAAE,QAAA;KACX;AACDC,IAAAA,aAAa,EAAE;AACbtB,MAAAA,QAAQ,EAAE,CAAC;AACXL,MAAAA,UAAU,EAAE,GAAG;AACfM,MAAAA,UAAU,EAAE,QAAQ;AACpB1B,MAAAA,UAAU,EAAE,GAAG;AACf2B,MAAAA,KAAK,EAAE,OAAO;AACdmB,MAAAA,QAAQ,EAAE,QAAA;KACX;AACDE,IAAAA,uBAAuB,EAAE;AACvB1B,MAAAA,gBAAgB,EAAE,EAAE;AACpB2B,MAAAA,SAAS,EAAE,CAAC;AACZL,MAAAA,YAAY,EAAE,EAAA;KACf;AACDM,IAAAA,oBAAoB,EAAE;AACpBlC,MAAAA,KAAK,EAAE,MAAM;AACbE,MAAAA,MAAM,EAAE,MAAM;AACdiC,MAAAA,eAAe,EAAE,EAAE;AACnB9B,MAAAA,SAAS,EAAE,QAAA;KACZ;AACD+B,IAAAA,WAAW,EAAE;AACX3B,MAAAA,QAAQ,EAAE,CAAC;AACXC,MAAAA,UAAU,EAAE,QAAQ;AACpB1B,MAAAA,UAAU,EAAE,GAAG;AACf2B,MAAAA,KAAK,EAAE,OAAA;AACT,KAAA;AACF,GAAC,CAAC,CAAA;AACJ;;;;"}
@@ -1,3 +0,0 @@
1
- export { TimeSeriesBarChart } from './TimeSeriesBarChart2.js';
2
- export { TimeSeriesBarChartSize, TimeSeriesBarChartTheme } from './types.js';
3
- //# sourceMappingURL=TimeSeriesBarChart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeSeriesBarChart2.js","sources":["../../../../src/components/TimeSeriesBarChart/TimeSeriesBarChart.tsx"],"sourcesContent":["// 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":["COMPONENT_NAME","CLASSNAME","getStartDate","dates","Date","Math","min","map","Number","getEndDate","max","sizeToDimension","size","TimeSeriesBarChartSize","small","width","height","marginLeft","marginTop","marginRight","marginBottom","large","medium","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","TimeSeriesBarChartTheme","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","p","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","StyledTimeSeriesBarChart","_extends","classNames","$theme","StyledTimeSeriesBarChartTitle","alignItems","Button","variant","onClick","ResetFilter","StyledTimeSeriesBarChartContainer","$isEmpty","ChartEmptyState","subtitle","onReset","dcfilterAll","ResetFilters","StyledTimeSeriesBarChartCaption","displayName"],"mappings":";;;;;;;;;;;;;;;AA8CA,MAAMA,cAAc,GAAG,oBAAoB,CAAA;AAC3C,MAAMC,SAAS,GAAG,6BAA6B,CAAA;AAW/C,MAAMC,YAAY,GAAIC,KAAa,IAAK,IAAIC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC,GAAGH,KAAK,CAACI,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAAA;AAChF,MAAMC,UAAU,GAAIN,KAAa,IAAK,IAAIC,IAAI,CAACC,IAAI,CAACK,GAAG,CAAC,GAAGP,KAAK,CAACI,GAAG,CAACC,MAAM,CAAC,CAAC,CAAC,CAAA;AAE9E,MAAMG,eAAe,GAAIC,IAA4B,IAAsB;AACzE,EAAA,QAAQA,IAAI;IACV,KAAKC,sBAAsB,CAACC,KAAK;MAC/B,OAAO;AACLC,QAAAA,KAAK,EAAE,GAAG;AACVC,QAAAA,MAAM,EAAE,GAAG;AACXC,QAAAA,UAAU,EAAE,EAAE;AACdC,QAAAA,SAAS,EAAE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,UAAU,EAAED,oBAAqB;IACjC2G,OAAO,EAAEA,MAAM;AACbC,MAAAA,SAAW,EAAE,CAAA;AACblB,MAAAA,SAAW,EAAE,CAAA;AACbtF,MAAAA,QAAQ,KAARA,IAAAA,IAAAA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,QAAQ,CAAG;QACTgE,IAAI,EAAEC,0BAA0B,CAACwC,YAAAA;AACnC,OAAC,CAAC,CAAA;AACJ,KAAA;GACD,CAAC,GACA,IAC6B,CAAC,EAEnCrI,OAAO,gBACNmH,KAAA,CAAAC,aAAA,CAACkB,+BAA+B,EAAA;AAC9BrI,IAAAA,SAAS,EAAG,CAAA,EAAEd,kBAAkB,CAACc,SAAU,CAAW,SAAA,CAAA;IACtDP,EAAE,EAAG,CAAIA,EAAAA,EAAAA,EAAG,CAAW,SAAA,CAAA;AACvB8H,IAAAA,MAAM,EAAEpG,KAAAA;AAAM,GAAA,EAEbpB,OAC8B,CAAC,GAChC,IACoB,CAAC,CAAA;AAE/B,CAAC,EAAC;AACFb,kBAAkB,CAACc,SAAS,GAAG7D,SAAS,CAAA;AACxC+C,kBAAkB,CAACoJ,WAAW,GAAGpM,cAAc;;;;"}
@@ -1,98 +0,0 @@
1
- import styled, { css } from 'styled-components';
2
- import { Flexbox } from '@redsift/design-system';
3
-
4
- // istanbul ignore file
5
- /**
6
- * Component style.
7
- */
8
- const StyledTimeSeriesBarChart = styled.div`
9
- margin: 16px;
10
- padding: 16px;
11
-
12
- text {
13
- fill: ${_ref => {
14
- let {
15
- $theme
16
- } = _ref;
17
- return `var(--redsift-color-${$theme}-components-text-primary)`;
18
- }};
19
- }
20
-
21
- .redsift-timeseries-barchart__chart {
22
- display: flex;
23
- font-family: var(--redsift-typography-font-family-poppins);
24
- font-size: 12px;
25
- justify-content: center;
26
- margin: 8px 0;
27
- }
28
-
29
- svg > g {
30
- margin: 8px;
31
- }
32
-
33
- .grid-line,
34
- .axis .grid-line,
35
- .grid-line line,
36
- .axis .grid-line line {
37
- fill: none;
38
- stroke: #ccc;
39
- shape-rendering: crispEdges;
40
- }
41
-
42
- .axis text {
43
- font-family: var(--redsift-typography-font-family-poppins);
44
- font-size: 10px;
45
- }
46
-
47
- g.stack rect.bar.deselected {
48
- fill-opacity: 0.5;
49
- fill: var(--redsift-color-neutral-mid-grey);
50
- }
51
-
52
- .brush .custom-brush-handle {
53
- fill: #eee;
54
- stroke: #666;
55
- cursor: ew-resize;
56
- }
57
-
58
- text {
59
- user-select: none;
60
- }
61
- `;
62
- const StyledTimeSeriesBarChartTitle = styled(Flexbox)`
63
- font-family: var(--redsift-typography-h4-font-family);
64
- font-size: var(--redsift-typography-h4-font-size);
65
- font-weight: var(--redsift-typography-h4-font-weight);
66
- line-height: var(--redsift-typography-h4-line-height);
67
- `;
68
- const StyledTimeSeriesBarChartCaption = styled.p`
69
- font-family: var(--redsift-typography-caption-font-family);
70
- font-size: var(--redsift-typography-caption-font-size);
71
- font-weight: var(--redsift-typography-caption-font-weight);
72
- line-height: var(--redsift-typography-caption-line-height);
73
- `;
74
- const StyledTimeSeriesBarChartContainer = styled.div`
75
- display: flex;
76
- align-items: center;
77
- gap: 16px;
78
- font-family: var(--redsift-typography-font-family-poppins);
79
- font-size: 11px;
80
- justify-content: center;
81
- margin: 8px 0;
82
- position: relative;
83
-
84
- .redsift-timeseries-barchart-container__chart {
85
- position: relative;
86
- ${_ref2 => {
87
- let {
88
- $isEmpty
89
- } = _ref2;
90
- return $isEmpty ? css`
91
- display: none;
92
- ` : '';
93
- }};
94
- }
95
- `;
96
-
97
- export { StyledTimeSeriesBarChart, StyledTimeSeriesBarChartCaption, StyledTimeSeriesBarChartContainer, StyledTimeSeriesBarChartTitle };
98
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/TimeSeriesBarChart/styles.ts"],"sourcesContent":["// 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"],"names":["StyledTimeSeriesBarChart","styled","div","_ref","$theme","StyledTimeSeriesBarChartTitle","Flexbox","StyledTimeSeriesBarChartCaption","p","StyledTimeSeriesBarChartContainer","_ref2","$isEmpty","css"],"mappings":";;;AAAA;AAMA;AACA;AACA;AACaA,MAAAA,wBAAwB,GAAGC,MAAM,CAACC,GAAmC,CAAA;AAClF;AACA;AACA;AACA;AACA,UAAA,EAAYC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;EAAA,OAAM,CAAA,oBAAA,EAAsBC,MAAO,CAA0B,yBAAA,CAAA,CAAA;AAAA,CAAC,CAAA;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;MAEYC,6BAA6B,GAAGJ,MAAM,CAACK,OAAO,CAAiC,CAAA;AAC5F;AACA;AACA;AACA;AACA,EAAC;AAEYC,MAAAA,+BAA+B,GAAGN,MAAM,CAACO,CAAiC,CAAA;AACvF;AACA;AACA;AACA;AACA,EAAC;AAEYC,MAAAA,iCAAiC,GAAGR,MAAM,CAACC,GAErD,CAAA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,EAAMQ,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAAD,KAAA,CAAA;EAAA,OACbC,QAAQ,GACJC,GAAI,CAAA;AACd;AACA,UAAA,CAAW,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACb;AACA;;;;"}
@@ -1,22 +0,0 @@
1
- import { ColorTheme } from '@redsift/charts';
2
-
3
- // istanbul ignore file
4
- /**
5
- * Component size.
6
- */
7
- const TimeSeriesBarChartSize = {
8
- large: 'large',
9
- medium: 'medium',
10
- small: 'small'
11
- };
12
- /**
13
- * Component theme.
14
- */
15
- const TimeSeriesBarChartTheme = ColorTheme;
16
-
17
- /**
18
- * Component props.
19
- */
20
-
21
- export { TimeSeriesBarChartSize, TimeSeriesBarChartTheme };
22
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../../../../src/components/TimeSeriesBarChart/types.ts"],"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"],"names":["TimeSeriesBarChartSize","large","medium","small","TimeSeriesBarChartTheme","ColorTheme"],"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;;AAYjD;AACA;AACA;;;;"}