react-data-matrix 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -85,71 +85,116 @@ const App = () => {
85
85
 
86
86
  # PropTypes
87
87
 
88
- ```js
89
- propTypes = {
90
- data: PropTypes.shape({
91
- id: PropTypes.number,
92
- matrix_name: PropTypes.string,
93
- matrix_description: PropTypes.string,
94
- matrix_size: PropTypes.number.isRequired,
95
- matrix_details: PropTypes.arrayOf(
96
- PropTypes.shape({
97
- id: PropTypes.number,
98
- likelihood: PropTypes.string,
99
- consequence: PropTypes.number,
100
- header_title: PropTypes.string,
101
- header_sub_title: PropTypes.string,
102
- row_header_title: PropTypes.string,
103
- row_header_sub_title: PropTypes.string,
104
- })
105
- ).isRequired,
106
-
107
- matrix_values: PropTypes.arrayOf(
108
- PropTypes.shape({
109
- id: PropTypes.number.isRequired,
110
- colour: PropTypes.string,
111
- position: PropTypes.number.isRequired,
112
- matrix_id: PropTypes.number,
113
- score_value: PropTypes.number,
114
- description: PropTypes.string,
115
- response: PropTypes.string,
116
- likelihood_descriptor: PropTypes.string.isRequired,
117
- consequence_descriptor: PropTypes.number,
118
- })
119
- ).isRequired,
120
- }).isRequired,
121
-
122
- hasTableBorder: PropTypes.bool,
123
- hasInlineStyles: PropTypes.bool,
124
- hasContainerStyles: PropTypes.bool,
125
- reverseMatrixValues: PropTypes.bool,
126
- matrixSizeSelected: PropTypes.number,
127
-
128
- rowPrimaryUpper: PropTypes.bool,
129
- headerPrimaryUpper: PropTypes.bool,
130
-
131
- thRowStyles: PropTypes.shape({}),
132
- thTitleStyles: PropTypes.shape({}),
133
- thSubTitleStyles: PropTypes.shape({}),
134
- thPrimaryTitleStyles: PropTypes.shape({}),
135
-
136
- trRowStyles: PropTypes.shape({}),
137
- trTitleStyles: PropTypes.shape({}),
138
- trSubTitleStyles: PropTypes.shape({}),
139
- trPrimaryTitleStyles: PropTypes.shape({}),
140
-
141
- tdStyles: PropTypes.shape({}),
142
-
143
- customHeaderRowIdValue: PropTypes.string,
144
- customDynamicHeaderTitleIdValue: PropTypes.string,
145
- customDynamicSubHeaderTitleIdValue: PropTypes.string,
146
-
147
- customRowDynamicIdValue: PropTypes.string,
148
- customRowHeaderDynamicIdValue: PropTypes.string,
149
-
150
- customTableDataDynamicIdValue: PropTypes.string,
151
- };
88
+ ```ts
89
+ export interface MatrixDetail {
90
+ id: number;
91
+ position: number;
92
+ matrix_type: string;
93
+ likelihood: string;
94
+ consequence: number;
95
+ header_title: string;
96
+ header_sub_title: string;
97
+ row_header_title: string;
98
+ row_header_sub_title: string;
99
+ }
100
+
101
+ export interface MatrixValue {
102
+ id: number;
103
+ matrix_id: number;
104
+ description: string;
105
+ score_value: number;
106
+ colour: string;
107
+ position: number;
108
+ likelihood_descriptor: string;
109
+ consequence_descriptor: number;
110
+ response: string;
111
+ }
112
+
113
+ export interface MatrixData {
114
+ id: number;
115
+ matrix_size: number;
116
+ matrix_name: string;
117
+ primary_header_title: string;
118
+ primary_row_header_title: string;
119
+ matrix_description: string;
120
+ matrix_details: MatrixDetail[];
121
+ matrix_values: MatrixValue[];
122
+ }
152
123
 
124
+ export interface ReactMatrixProps {
125
+ data?: {
126
+ id: number;
127
+ matrix_name: string;
128
+ matrix_description: string;
129
+ matrix_size: number;
130
+ primary_header_title: string;
131
+ primary_row_header_title: string;
132
+ matrix_details: {
133
+ id: number;
134
+ likelihood: string;
135
+ consequence: number;
136
+ header_title: string;
137
+ header_sub_title: string;
138
+ row_header_title: string;
139
+ row_header_sub_title: string;
140
+ }[];
141
+ matrix_values: {
142
+ id: number;
143
+ colour: string;
144
+ position: number;
145
+ matrix_id: number;
146
+ score_value: number;
147
+ description: string;
148
+ response: string;
149
+ likelihood_descriptor: string;
150
+ consequence_descriptor: number;
151
+ }[];
152
+ };
153
+ hasTableBorder?: boolean;
154
+ hasInlineStyles?: boolean;
155
+ hasContainerStyles?: boolean;
156
+ reverseMatrixValues?: boolean;
157
+ matrixSizeSelected?: number;
158
+ rowPrimaryUpper?: boolean;
159
+ headerPrimaryUpper?: boolean;
160
+ tableContainerStyles?: React.CSSProperties;
161
+ tableStyles?: React.CSSProperties;
162
+ thRowStyles?: React.CSSProperties;
163
+ thTitleStyles?: React.CSSProperties;
164
+ thSubTitleStyles?: React.CSSProperties;
165
+ thPrimaryTitleStyles?: React.CSSProperties;
166
+ trRowStyles?: React.CSSProperties;
167
+ trTitleStyles?: React.CSSProperties;
168
+ trSubTitleStyles?: React.CSSProperties;
169
+ trPrimaryTitleStyles?: React.CSSProperties;
170
+ tdStyles?: React.CSSProperties;
171
+ customHeaderRowIdValue?: string;
172
+ customDynamicHeaderTitleIdValue?: string;
173
+ customDynamicSubHeaderTitleIdValue?: string;
174
+ customRowDynamicIdValue?: string;
175
+ customRowHeaderDynamicIdValue?: string;
176
+ customTableDataDynamicIdValue?: string;
177
+ }
178
+
179
+ export interface TableDataProps {
180
+ data: {
181
+ id: number;
182
+ colour: string;
183
+ position: number;
184
+ matrix_id: number;
185
+ score_value: number;
186
+ description: string;
187
+ response: string;
188
+ likelihood_descriptor: string;
189
+ consequence_descriptor: number;
190
+ };
191
+ tdStyles?: React.CSSProperties;
192
+ hasInlineStyles?: boolean;
193
+ customTableDataDynamicIdValue?: string;
194
+ }
195
+ ```
196
+
197
+ ```js
153
198
  defaultProps = {
154
199
  hasTableBorder: true,
155
200
  rowPrimaryUpper: true,
@@ -0,0 +1,92 @@
1
+ import React, { FC, useContext } from "react";
2
+ import {
3
+ getHeaderRowStyles,
4
+ getHeaderTitleStyles,
5
+ getHeaderSubTitleStyles,
6
+ getHeaderPrimaryTitleStyles,
7
+ } from "../helpers/getStyles";
8
+ import { capitaliseString } from "../utils/functions";
9
+ import Context from "../context";
10
+ // import "./styles/riskMatrix.scss";
11
+
12
+ const MatrixHeaders: FC = () => {
13
+ const {
14
+ data,
15
+ hasInlineStyles = true,
16
+ headerPrimaryUpper = true,
17
+ thRowStyles = {},
18
+ thTitleStyles = {},
19
+ thSubTitleStyles = {},
20
+ thPrimaryTitleStyles = {},
21
+ customHeaderRowIdValue = "",
22
+ customDynamicHeaderTitleIdValue = "",
23
+ customDynamicSubHeaderTitleIdValue = "",
24
+ } = useContext(Context);
25
+
26
+ const headerRowStyles = getHeaderRowStyles(hasInlineStyles, thRowStyles);
27
+ const headerTitleStyles = getHeaderTitleStyles(
28
+ hasInlineStyles,
29
+ thTitleStyles
30
+ );
31
+ const headerSubTitleStyles = getHeaderSubTitleStyles(
32
+ hasInlineStyles,
33
+ thSubTitleStyles
34
+ );
35
+ const headerPrimaryTitleStyles = getHeaderPrimaryTitleStyles(
36
+ hasInlineStyles,
37
+ thPrimaryTitleStyles
38
+ );
39
+
40
+ const headerPrimaryTitle = !headerPrimaryUpper
41
+ ? capitaliseString(data?.primary_header_title)
42
+ : data?.primary_header_title;
43
+
44
+ return (
45
+ <thead>
46
+ <tr id="react-matrix-blank-headers-primary-title-row">
47
+ <th headers="blank" colSpan={4}></th>
48
+ <th
49
+ style={headerPrimaryTitleStyles}
50
+ id="react-matrix-header-primary-title"
51
+ >
52
+ {headerPrimaryTitle}
53
+ </th>
54
+ <th headers="blank" colSpan={2}></th>
55
+ </tr>
56
+ <tr
57
+ style={headerRowStyles}
58
+ id={`react-matrix-dynamic-headers-row-${customHeaderRowIdValue}`}
59
+ >
60
+ <th headers="blank" colSpan={2}></th>
61
+ {data.matrix_details.slice(0, data.matrix_size).map((column, index) => {
62
+ return (
63
+ <th
64
+ scope="col"
65
+ style={headerTitleStyles}
66
+ id={`react-matrix-dynamic-column-header-title${
67
+ !customDynamicHeaderTitleIdValue
68
+ ? ""
69
+ : `-${customDynamicHeaderTitleIdValue}`
70
+ }`}
71
+ key={`${column.id}-${index}`}
72
+ >
73
+ {column.header_title}
74
+ <div
75
+ style={headerSubTitleStyles}
76
+ id={`react-matrix-dynamic-column-header-sub-title${
77
+ !customDynamicSubHeaderTitleIdValue
78
+ ? ""
79
+ : `-${customDynamicSubHeaderTitleIdValue}`
80
+ }`}
81
+ >
82
+ {column.header_sub_title}
83
+ </div>
84
+ </th>
85
+ );
86
+ })}
87
+ </tr>
88
+ </thead>
89
+ );
90
+ };
91
+
92
+ export default MatrixHeaders;
@@ -0,0 +1,135 @@
1
+ import React, { FC, useContext } from "react";
2
+ import {
3
+ getHeaderRowStyles,
4
+ getHeaderTitleStyles,
5
+ getHeaderSubTitleStyles,
6
+ getHeaderPrimaryTitleStyles,
7
+ } from "../helpers/getStyles";
8
+ import { groupObjectsByProp, capitaliseString } from "../utils/functions";
9
+ import TableData from "./TableData";
10
+ import Context from "../context";
11
+ import { MatrixValue } from "../types";
12
+
13
+ const MatrixRows: FC = () => {
14
+ const {
15
+ data,
16
+ rowPrimaryUpper = true,
17
+ hasInlineStyles = true,
18
+ reverseMatrixValues = true,
19
+ trRowStyles = {},
20
+ trTitleStyles = {},
21
+ trSubTitleStyles = {},
22
+ trPrimaryTitleStyles = {},
23
+ tdStyles = {},
24
+ customRowDynamicIdValue = "",
25
+ customRowHeaderDynamicIdValue = "",
26
+ customTableDataDynamicIdValue = "",
27
+ } = useContext(Context);
28
+
29
+ const valuesArray = reverseMatrixValues
30
+ ? groupObjectsByProp(data.matrix_values, "likelihood_descriptor")
31
+ .reverse()
32
+ .slice(0, data.matrix_size)
33
+ : groupObjectsByProp(data.matrix_values, "likelihood_descriptor").slice(
34
+ 0,
35
+ data.matrix_size
36
+ );
37
+
38
+ const tableRowStyles = getHeaderRowStyles(hasInlineStyles, trRowStyles);
39
+ const tableRowHeaderTitleStyles = getHeaderTitleStyles(
40
+ hasInlineStyles,
41
+ trTitleStyles
42
+ );
43
+ const tableRowHeaderSubTitleStyles = getHeaderSubTitleStyles(
44
+ hasInlineStyles,
45
+ trSubTitleStyles
46
+ );
47
+ const rowHeaderPrimaryTitleStyles = getHeaderPrimaryTitleStyles(
48
+ hasInlineStyles,
49
+ trPrimaryTitleStyles
50
+ );
51
+
52
+ const rowPrimaryTitle = rowPrimaryUpper
53
+ ? capitaliseString(data.primary_row_header_title)
54
+ : data.primary_row_header_title;
55
+
56
+ return (
57
+ <tbody>
58
+ <tr id="react-matrix-row-primary-title">
59
+ <th scope="row" rowSpan={6} style={rowHeaderPrimaryTitleStyles}>
60
+ {rowPrimaryTitle}
61
+ </th>
62
+ </tr>
63
+ {valuesArray.map((row, index) => {
64
+ const rowHeaderOrder = reverseMatrixValues
65
+ ? data.matrix_size - (index + 1)
66
+ : index;
67
+
68
+ return (
69
+ <tr
70
+ style={tableRowStyles}
71
+ key={`row-${index}`}
72
+ id={`react-matrix-dynamic-rows-${
73
+ data.matrix_details[rowHeaderOrder]?.row_header_title
74
+ }-${data.matrix_details[rowHeaderOrder]?.row_header_sub_title}${
75
+ !customRowDynamicIdValue ? "" : `-${customRowDynamicIdValue}`
76
+ }`}
77
+ >
78
+ <th
79
+ scope="row"
80
+ style={tableRowHeaderTitleStyles}
81
+ id={`react-matrix-dynamic-rows-${
82
+ data.matrix_details[rowHeaderOrder]?.row_header_title
83
+ }-${data.matrix_details[rowHeaderOrder]?.row_header_sub_title}${
84
+ !customRowHeaderDynamicIdValue
85
+ ? ""
86
+ : `-${customRowHeaderDynamicIdValue}`
87
+ }`}
88
+ >
89
+ {data.matrix_details[rowHeaderOrder]?.row_header_title}
90
+ <div style={tableRowHeaderSubTitleStyles}>
91
+ {data.matrix_details[rowHeaderOrder]?.row_header_sub_title}
92
+ </div>
93
+ </th>
94
+ {row
95
+ .slice(0, data.matrix_size)
96
+ .map((item: MatrixValue, index: number) => {
97
+ return (
98
+ <TableData
99
+ data={item}
100
+ tdStyles={tdStyles}
101
+ key={`${item.id}-${index}`}
102
+ hasInlineStyles={hasInlineStyles}
103
+ customTableDataDynamicIdValue={
104
+ customTableDataDynamicIdValue
105
+ }
106
+ />
107
+ );
108
+ })}
109
+ </tr>
110
+ );
111
+ })}
112
+ </tbody>
113
+ );
114
+ };
115
+
116
+ MatrixRows.defaultProps = {
117
+ rowPrimaryUpper: true,
118
+ hasInlineStyles: true,
119
+ reverseMatrixValues: true,
120
+
121
+ trRowStyles: {},
122
+ trTitleStyles: {},
123
+ trSubTitleStyles: {},
124
+ trPrimaryTitleStyles: {},
125
+
126
+ tdStyles: {},
127
+
128
+ matrixSizeSelected: 5,
129
+
130
+ customRowDynamicIdValue: "",
131
+ customRowHeaderDynamicIdValue: "",
132
+ customTableDataDynamicIdValue: "",
133
+ };
134
+
135
+ export default MatrixRows;
@@ -0,0 +1,47 @@
1
+ import React, { FC, useContext } from "react";
2
+ import {
3
+ getTableStyles,
4
+ getTableBoarder,
5
+ getContainerStyles,
6
+ } from "../helpers/getStyles";
7
+ import MatrixHeaders from "./MatrixHeaders";
8
+ import MatrixRows from "./MatrixRows";
9
+ import Context from "../context";
10
+ import { ReactMatrixProps } from "../types";
11
+
12
+ const ReactMatrix: FC<ReactMatrixProps> = ({ tableStyles = {} }) => {
13
+ const {
14
+ matrixName,
15
+ tableStyles: contextTableStyles,
16
+ hasTableBorder: contextHasTableBorder,
17
+ hasInlineStyles: contextHasInlineStyles,
18
+ matrixDescription,
19
+ hasContainerStyles: contextHasContainerStyles,
20
+ tableContainerStyles: contextTableContainerStyles,
21
+ } = useContext(Context);
22
+
23
+ const tableBorder = getTableBoarder(
24
+ contextHasInlineStyles && contextHasTableBorder
25
+ );
26
+ const tableElmStyles = getTableStyles(
27
+ !!(contextHasInlineStyles && contextTableStyles),
28
+ tableStyles
29
+ );
30
+ const containerStyles = getContainerStyles(
31
+ contextHasInlineStyles && contextHasContainerStyles,
32
+ contextTableContainerStyles
33
+ );
34
+
35
+ return (
36
+ <div style={containerStyles}>
37
+ <h1>{matrixName}</h1>
38
+ <h4>{matrixDescription}</h4>
39
+ <table id="matrix-table" style={{ ...tableElmStyles, ...tableBorder }}>
40
+ <MatrixHeaders />
41
+ <MatrixRows />
42
+ </table>
43
+ </div>
44
+ );
45
+ };
46
+
47
+ export default ReactMatrix;
@@ -0,0 +1,48 @@
1
+ import React, { FC } from "react";
2
+ import { TableDataProps } from "../types";
3
+
4
+ const TableData: FC<TableDataProps> = ({
5
+ data,
6
+ tdStyles = {},
7
+ hasInlineStyles = true,
8
+ customTableDataDynamicIdValue = "",
9
+ }) => {
10
+ const handleCellClick = (tdSelected: TableDataProps["data"]) => {
11
+ alert(
12
+ `${tdSelected?.description}, ${tdSelected?.score_value} \n${tdSelected?.response}`
13
+ );
14
+ };
15
+
16
+ const customTdStyles = !tdStyles ? {} : tdStyles;
17
+ const tableDataStyles: React.CSSProperties = hasInlineStyles
18
+ ? {
19
+ cursor: "pointer",
20
+ textAlign: "center",
21
+ borderColor: "black",
22
+ borderStyle: "solid",
23
+ borderWidth: `${1}px`,
24
+ backgroundColor: data?.colour,
25
+ ...tdStyles,
26
+ }
27
+ : { ...customTdStyles };
28
+
29
+ return (
30
+ <>
31
+ <td
32
+ style={tableDataStyles}
33
+ onClick={() => handleCellClick(data)}
34
+ id={`react-matrix-dynamic-table-data${
35
+ !customTableDataDynamicIdValue
36
+ ? ""
37
+ : `-${customTableDataDynamicIdValue}`
38
+ }`}
39
+ >
40
+ {`${data?.description}`}
41
+ <br />
42
+ {`(${data?.score_value})`}
43
+ </td>
44
+ </>
45
+ );
46
+ };
47
+
48
+ export default TableData;
@@ -0,0 +1,66 @@
1
+ import { createContext } from "react";
2
+ import { MatrixData } from "../types";
3
+
4
+ interface ContextType {
5
+ data: MatrixData;
6
+ matrixName: string;
7
+ matrixDescription: string;
8
+ hasTableBorder: boolean;
9
+ rowPrimaryUpper: boolean;
10
+ hasInlineStyles: boolean;
11
+ matrixSizeSelected: number;
12
+ headerPrimaryUpper: boolean;
13
+ hasContainerStyles: boolean;
14
+ reverseMatrixValues: boolean;
15
+ tableContainerStyles: Record<string, any>;
16
+ tableStyles: Record<string, any>;
17
+ thRowStyles: Record<string, any>;
18
+ thTitleStyles: Record<string, any>;
19
+ thSubTitleStyles: Record<string, any>;
20
+ thPrimaryTitleStyles: Record<string, any>;
21
+ trRowStyles: Record<string, any>;
22
+ trTitleStyles: Record<string, any>;
23
+ trSubTitleStyles: Record<string, any>;
24
+ trPrimaryTitleStyles: Record<string, any>;
25
+ tdStyles: Record<string, any>;
26
+ customHeaderRowIdValue: string;
27
+ customRowDynamicIdValue: string;
28
+ customTableDataDynamicIdValue: string;
29
+ customRowHeaderDynamicIdValue: string;
30
+ customDynamicHeaderTitleIdValue: string;
31
+ customDynamicSubHeaderTitleIdValue: string;
32
+ }
33
+
34
+ const Context = createContext<ContextType>({
35
+ data: {} as MatrixData,
36
+ matrixName: "",
37
+ matrixDescription: "",
38
+ hasTableBorder: true,
39
+ rowPrimaryUpper: true,
40
+ hasInlineStyles: true,
41
+ matrixSizeSelected: 5,
42
+ headerPrimaryUpper: true,
43
+ hasContainerStyles: true,
44
+ reverseMatrixValues: true,
45
+ tableContainerStyles: {},
46
+ tableStyles: {},
47
+ thRowStyles: {},
48
+ thTitleStyles: {},
49
+ thSubTitleStyles: {},
50
+ thPrimaryTitleStyles: {},
51
+ trRowStyles: {},
52
+ trTitleStyles: {},
53
+ trSubTitleStyles: {},
54
+ trPrimaryTitleStyles: {},
55
+ tdStyles: {},
56
+ customHeaderRowIdValue: "",
57
+ customRowDynamicIdValue: "",
58
+ customTableDataDynamicIdValue: "",
59
+ customRowHeaderDynamicIdValue: "",
60
+ customDynamicHeaderTitleIdValue: "",
61
+ customDynamicSubHeaderTitleIdValue: "",
62
+ });
63
+
64
+ export const Provider = Context.Provider;
65
+
66
+ export default Context;
@@ -0,0 +1,77 @@
1
+ export const getCustomStyles = (hasStyle: boolean) =>
2
+ !hasStyle ? {} : hasStyle;
3
+
4
+ export const getContainerStyles = (
5
+ hasStyle: boolean,
6
+ styles: React.CSSProperties
7
+ ): React.CSSProperties =>
8
+ // if custom styles are passed remove default styles by returning a spread empty object
9
+ !hasStyle
10
+ ? { ...getCustomStyles(hasStyle) }
11
+ : {
12
+ top: `${50}%`,
13
+ left: `${50}%`,
14
+ height: `${100}%`,
15
+ textAlign: "center",
16
+ position: "absolute",
17
+ transform: `translate(${-50}%, ${-50}%)`,
18
+ ...styles,
19
+ };
20
+
21
+ export const getTableBoarder = (hasStyle: boolean) =>
22
+ !hasStyle ? {} : { border: `${1}px solid black` };
23
+
24
+ export const getTableStyles = (
25
+ hasStyle: boolean,
26
+ styles: React.CSSProperties
27
+ ): React.CSSProperties =>
28
+ !hasStyle
29
+ ? { ...getCustomStyles(hasStyle) }
30
+ : { width: `${70}rem`, ...styles };
31
+
32
+ export const getHeaderPrimaryTitleStyles = (
33
+ hasStyle: boolean,
34
+ styles: React.CSSProperties
35
+ ): React.CSSProperties =>
36
+ !hasStyle
37
+ ? { ...getCustomStyles(hasStyle) }
38
+ : {
39
+ borderWidth: `${0}`,
40
+ padding: `${1}rem ${0} ${1}rem ${0}`,
41
+ ...styles,
42
+ };
43
+
44
+ export const getHeaderRowStyles = (
45
+ hasStyle: boolean,
46
+ styles: React.CSSProperties
47
+ ): React.CSSProperties =>
48
+ !hasStyle
49
+ ? { ...getCustomStyles(hasStyle) }
50
+ : {
51
+ borderColor: "black",
52
+ borderStyle: "solid",
53
+ padding: `${10}rem ${0} ${0} ${0}`,
54
+ borderWidth: `${0} ${0} ${0} ${10}px`,
55
+ ...styles,
56
+ };
57
+
58
+ export const getHeaderTitleStyles = (
59
+ hasStyle: boolean,
60
+ styles: React.CSSProperties
61
+ ): React.CSSProperties =>
62
+ !hasStyle
63
+ ? { ...getCustomStyles(hasStyle) }
64
+ : {
65
+ padding: `${0} ${0.5}rem ${0} ${0.5}rem`,
66
+ backgroundColor: "light-grey",
67
+ border: `${1}px solid black`,
68
+ ...styles,
69
+ };
70
+
71
+ export const getHeaderSubTitleStyles = (
72
+ hasStyle: boolean,
73
+ styles: React.CSSProperties
74
+ ): React.CSSProperties =>
75
+ !hasStyle
76
+ ? { ...getCustomStyles(hasStyle) }
77
+ : { fontSize: `${0.9}em`, fontWeight: "normal", ...styles };
package/dist/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as ReactMatrix } from "./components/ReactMatrix";