@haniffalab/cherita-react 1.4.1-dev.2025-10-20.528e0f75 → 1.4.1-dev.2025-10-22.61540191

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 (50) hide show
  1. package/dist/cjs/components/dotplot/Dotplot.js +23 -15
  2. package/dist/cjs/components/full-page/FullPage.js +32 -30
  3. package/dist/cjs/components/full-page/PlotAlert.js +36 -0
  4. package/dist/cjs/components/full-page/PlotTypeSelector.js +77 -39
  5. package/dist/cjs/components/heatmap/Heatmap.js +23 -15
  6. package/dist/cjs/components/icons/DotPlotIcon.js +58 -0
  7. package/dist/cjs/components/icons/HeatmapIcon.js +39 -0
  8. package/dist/cjs/components/icons/MatrixPlotIcon.1.js +51 -0
  9. package/dist/cjs/components/icons/MatrixPlotIcon.js +53 -0
  10. package/dist/cjs/components/icons/ScatterplotIcon.1.js +158 -0
  11. package/dist/cjs/components/icons/ScatterplotIcon.js +138 -0
  12. package/dist/cjs/components/icons/ViolinPlotIcon.js +34 -0
  13. package/dist/cjs/components/matrixplot/Matrixplot.js +25 -17
  14. package/dist/cjs/components/pseudospatial/Pseudospatial.js +64 -25
  15. package/dist/cjs/components/pseudospatial/PseudospatialToolbar.js +63 -15
  16. package/dist/cjs/components/violin/Violin.js +41 -30
  17. package/dist/cjs/context/DatasetContext.js +1 -1
  18. package/dist/cjs/context/SettingsContext.js +27 -3
  19. package/dist/cjs/utils/StyledTooltip.js +39 -0
  20. package/dist/css/cherita.css +37 -22
  21. package/dist/css/cherita.css.map +1 -1
  22. package/dist/esm/components/dotplot/Dotplot.js +22 -13
  23. package/dist/esm/components/full-page/FullPage.js +6 -3
  24. package/dist/esm/components/full-page/PlotAlert.js +30 -0
  25. package/dist/esm/components/full-page/PlotTypeSelector.js +76 -38
  26. package/dist/esm/components/heatmap/Heatmap.js +22 -13
  27. package/dist/esm/components/icons/DotPlotIcon.js +52 -0
  28. package/dist/esm/components/icons/HeatmapIcon.js +33 -0
  29. package/dist/esm/components/icons/MatrixPlotIcon.1.js +45 -0
  30. package/dist/esm/components/icons/MatrixPlotIcon.js +47 -0
  31. package/dist/esm/components/icons/ScatterplotIcon.1.js +152 -0
  32. package/dist/esm/components/icons/ScatterplotIcon.js +132 -0
  33. package/dist/esm/components/icons/ViolinPlotIcon.js +28 -0
  34. package/dist/esm/components/matrixplot/Matrixplot.js +24 -15
  35. package/dist/esm/components/pseudospatial/Pseudospatial.js +58 -18
  36. package/dist/esm/components/pseudospatial/PseudospatialToolbar.js +52 -4
  37. package/dist/esm/components/violin/Violin.js +36 -24
  38. package/dist/esm/context/DatasetContext.js +1 -1
  39. package/dist/esm/context/SettingsContext.js +27 -3
  40. package/dist/esm/utils/StyledTooltip.js +33 -0
  41. package/package.json +2 -2
  42. package/scss/cherita.scss +19 -1
  43. package/scss/components/layouts.scss +2 -21
  44. package/scss/components/plotly.scss +37 -26
  45. package/scss/components/plots.scss +14 -1
  46. package/dist/assets/images/plots/dotplot.svg +0 -152
  47. package/dist/assets/images/plots/heatmap.svg +0 -193
  48. package/dist/assets/images/plots/matrixplot.svg +0 -275
  49. package/dist/assets/images/plots/scatterplot.svg +0 -198
  50. package/dist/assets/images/plots/violin.svg +0 -50
@@ -0,0 +1,52 @@
1
+ const _excluded = ["size", "colour", "gap"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function DotPlotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000",
9
+ gap = 20
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ const rows = 3;
13
+ const cols = 3;
14
+
15
+ // Define two radii: small and large
16
+ const smallR = 10;
17
+ const largeR = 16;
18
+
19
+ // Indices for large circles
20
+ const largeIndices = [1, 4, 5, 6, 7];
21
+
22
+ // Indices for semi-transparent circles
23
+ const semiTransparentIndices = [0, 4, 8];
24
+ const circles = [];
25
+ for (let row = 0; row < rows; row++) {
26
+ for (let col = 0; col < cols; col++) {
27
+ const index = row * cols + col;
28
+ const r = largeIndices.includes(index) ? largeR : smallR;
29
+ circles.push({
30
+ cx: col * (2 * largeR + gap) + largeR,
31
+ cy: row * (2 * largeR + gap) + largeR,
32
+ r,
33
+ fill: colour,
34
+ fillOpacity: semiTransparentIndices.includes(index) ? 0.5 : 1
35
+ });
36
+ }
37
+ }
38
+ const viewBoxSize = (cols - 1) * (2 * largeR + gap) + 2 * largeR;
39
+ return /*#__PURE__*/React.createElement("svg", _extends({
40
+ width: size,
41
+ height: size,
42
+ viewBox: "0 0 ".concat(viewBoxSize, " ").concat(viewBoxSize),
43
+ xmlns: "http://www.w3.org/2000/svg"
44
+ }, props), circles.map((circle, i) => /*#__PURE__*/React.createElement("circle", {
45
+ key: i,
46
+ cx: circle.cx,
47
+ cy: circle.cy,
48
+ r: circle.r,
49
+ fill: circle.fill,
50
+ fillOpacity: circle.fillOpacity
51
+ })));
52
+ }
@@ -0,0 +1,33 @@
1
+ const _excluded = ["size", "colour", "gap"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function HeatmapIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000",
9
+ gap = 1
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ const rows = 6; // genes
13
+ const cols = 8; // cells
14
+
15
+ // Example expression pattern for visual clusters
16
+ const expressionLevels = [[1, 0.8, 0.2, 0.2, 0.5, 0.9, 1, 0.7], [0.9, 0.7, 0.1, 0.2, 0.4, 0.8, 0.9, 0.6], [0.1, 0.2, 0.8, 0.9, 0.7, 0.2, 0.1, 0.3], [0.2, 0.3, 0.9, 1, 0.8, 0.3, 0.2, 0.4], [0.5, 0.6, 0.2, 0.1, 0.9, 0.7, 0.6, 0.8], [0.6, 0.7, 0.3, 0.2, 0.8, 0.6, 0.7, 0.9]];
17
+ const cellWidth = (size - (cols - 1) * gap) / cols;
18
+ const cellHeight = (size - (rows - 1) * gap) / rows;
19
+ return /*#__PURE__*/React.createElement("svg", _extends({
20
+ width: size,
21
+ height: size,
22
+ viewBox: "0 0 ".concat(size, " ").concat(size),
23
+ xmlns: "http://www.w3.org/2000/svg"
24
+ }, props), expressionLevels.map((row, rowIndex) => row.map((value, colIndex) => /*#__PURE__*/React.createElement("rect", {
25
+ key: "".concat(rowIndex, "-").concat(colIndex),
26
+ x: colIndex * (cellWidth + gap),
27
+ y: rowIndex * (cellHeight + gap),
28
+ width: cellWidth,
29
+ height: cellHeight,
30
+ fill: colour,
31
+ fillOpacity: value
32
+ }))));
33
+ }
@@ -0,0 +1,45 @@
1
+ const _excluded = ["size", "colour", "gap"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function MatrixPlotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000",
9
+ gap = 2
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ const rows = 4;
13
+ const cols = 4;
14
+ const squareSize = (size - gap * (cols - 1)) / cols;
15
+ const squares = [];
16
+ for (let row = 0; row < rows; row++) {
17
+ for (let col = 0; col < cols; col++) {
18
+ squares.push({
19
+ x: col * (squareSize + gap),
20
+ y: row * (squareSize + gap)
21
+ });
22
+ }
23
+ }
24
+ const semiTransparentSquares = [0, 5, 10, 15];
25
+ return /*#__PURE__*/React.createElement("svg", _extends({
26
+ width: size,
27
+ height: size,
28
+ viewBox: "0 0 ".concat(size, " ").concat(size),
29
+ xmlns: "http://www.w3.org/2000/svg"
30
+ }, props), squares.map((_ref2, i) => {
31
+ let {
32
+ x,
33
+ y
34
+ } = _ref2;
35
+ return /*#__PURE__*/React.createElement("rect", {
36
+ key: i,
37
+ x: x,
38
+ y: y,
39
+ width: squareSize,
40
+ height: squareSize,
41
+ fill: colour,
42
+ fillOpacity: semiTransparentSquares.includes(i) ? 0.5 : 1
43
+ });
44
+ }));
45
+ }
@@ -0,0 +1,47 @@
1
+ const _excluded = ["size", "colour", "gap"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function MatrixPlotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000",
9
+ gap = 2
10
+ } = _ref,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ const rows = 3;
13
+ const cols = 3;
14
+ const squareSize = (size - gap * (cols - 1)) / cols;
15
+ const squares = [];
16
+ for (let row = 0; row < rows; row++) {
17
+ for (let col = 0; col < cols; col++) {
18
+ squares.push({
19
+ x: col * (squareSize + gap),
20
+ y: row * (squareSize + gap)
21
+ });
22
+ }
23
+ }
24
+
25
+ // Example: corners semi-transparent
26
+ const semiTransparentSquares = [0, 2, 6, 8];
27
+ return /*#__PURE__*/React.createElement("svg", _extends({
28
+ width: size,
29
+ height: size,
30
+ viewBox: "0 0 ".concat(size, " ").concat(size),
31
+ xmlns: "http://www.w3.org/2000/svg"
32
+ }, props), squares.map((_ref2, i) => {
33
+ let {
34
+ x,
35
+ y
36
+ } = _ref2;
37
+ return /*#__PURE__*/React.createElement("rect", {
38
+ key: i,
39
+ x: x,
40
+ y: y,
41
+ width: squareSize,
42
+ height: squareSize,
43
+ fill: colour,
44
+ fillOpacity: semiTransparentSquares.includes(i) ? 0.5 : 1
45
+ });
46
+ }));
47
+ }
@@ -0,0 +1,152 @@
1
+ const _excluded = ["size", "colour"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function ScatterplotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000"
9
+ } = _ref,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ // Points with cluster assignments
12
+ const points = [
13
+ // Cluster 0
14
+ {
15
+ x: 15.2,
16
+ y: 35.9,
17
+ cluster: 0
18
+ }, {
19
+ x: 10.0,
20
+ y: 38.0,
21
+ cluster: 0
22
+ }, {
23
+ x: 12.3,
24
+ y: 40.7,
25
+ cluster: 0
26
+ }, {
27
+ x: 15.7,
28
+ y: 39.9,
29
+ cluster: 0
30
+ }, {
31
+ x: 8.1,
32
+ y: 42.2,
33
+ cluster: 0
34
+ }, {
35
+ x: 10.8,
36
+ y: 44.5,
37
+ cluster: 0
38
+ }, {
39
+ x: 14.3,
40
+ y: 44.6,
41
+ cluster: 0
42
+ }, {
43
+ x: 7.4,
44
+ y: 46.7,
45
+ cluster: 0
46
+ }, {
47
+ x: 11.1,
48
+ y: 48.8,
49
+ cluster: 0
50
+ }, {
51
+ x: 14.8,
52
+ y: 48.5,
53
+ cluster: 0
54
+ }, {
55
+ x: 12.6,
56
+ y: 52.1,
57
+ cluster: 0
58
+ },
59
+ // Cluster 1
60
+ {
61
+ x: 29.4,
62
+ y: 37.0,
63
+ cluster: 1
64
+ }, {
65
+ x: 26.1,
66
+ y: 40.2,
67
+ cluster: 1
68
+ }, {
69
+ x: 29.8,
70
+ y: 42.0,
71
+ cluster: 1
72
+ }, {
73
+ x: 33.0,
74
+ y: 39.5,
75
+ cluster: 1
76
+ }, {
77
+ x: 34.9,
78
+ y: 43.6,
79
+ cluster: 1
80
+ }, {
81
+ x: 31.5,
82
+ y: 46.2,
83
+ cluster: 1
84
+ }, {
85
+ x: 29.3,
86
+ y: 49.5,
87
+ cluster: 1
88
+ }, {
89
+ x: 26.7,
90
+ y: 45.2,
91
+ cluster: 1
92
+ },
93
+ // Cluster 2
94
+ {
95
+ x: 21.6,
96
+ y: 53.1,
97
+ cluster: 2
98
+ }, {
99
+ x: 25.3,
100
+ y: 53.9,
101
+ cluster: 2
102
+ }, {
103
+ x: 25.8,
104
+ y: 57.9,
105
+ cluster: 2
106
+ }, {
107
+ x: 22.1,
108
+ y: 57.4,
109
+ cluster: 2
110
+ }, {
111
+ x: 18.4,
112
+ y: 56.0,
113
+ cluster: 2
114
+ }, {
115
+ x: 18.6,
116
+ y: 59.8,
117
+ cluster: 2
118
+ }, {
119
+ x: 22.5,
120
+ y: 61.7,
121
+ cluster: 2
122
+ }];
123
+ const radius = 1.8;
124
+ const opacity = 1.0; // uniform expression
125
+
126
+ // Compute viewBox dynamically
127
+ const xs = points.map(p => p.x);
128
+ const ys = points.map(p => p.y);
129
+ const minX = Math.min(...xs) - radius;
130
+ const minY = Math.min(...ys) - radius;
131
+ const maxX = Math.max(...xs) + radius;
132
+ const maxY = Math.max(...ys) + radius;
133
+ return /*#__PURE__*/React.createElement("svg", _extends({
134
+ width: size,
135
+ height: size,
136
+ viewBox: "".concat(minX, " ").concat(minY, " ").concat(maxX - minX, " ").concat(maxY - minY),
137
+ xmlns: "http://www.w3.org/2000/svg"
138
+ }, props), points.map((_ref2, i) => {
139
+ let {
140
+ x,
141
+ y
142
+ } = _ref2;
143
+ return /*#__PURE__*/React.createElement("circle", {
144
+ key: i,
145
+ cx: x,
146
+ cy: y,
147
+ r: radius,
148
+ fill: colour,
149
+ opacity: opacity
150
+ });
151
+ }));
152
+ }
@@ -0,0 +1,132 @@
1
+ const _excluded = ["size", "colour"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function ScatterplotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000"
9
+ } = _ref,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ // Points with cluster assignments
12
+ const points = [
13
+ // Cluster 0
14
+ {
15
+ x: 15.2,
16
+ y: 35.9,
17
+ cluster: 0
18
+ }, {
19
+ x: 10.0,
20
+ y: 38.0,
21
+ cluster: 0
22
+ }, {
23
+ x: 12.3,
24
+ y: 40.7,
25
+ cluster: 0
26
+ }, {
27
+ x: 15.7,
28
+ y: 39.9,
29
+ cluster: 0
30
+ }, {
31
+ x: 8.1,
32
+ y: 42.2,
33
+ cluster: 0
34
+ }, {
35
+ x: 10.8,
36
+ y: 44.5,
37
+ cluster: 0
38
+ }, {
39
+ x: 14.3,
40
+ y: 44.6,
41
+ cluster: 0
42
+ }, {
43
+ x: 7.4,
44
+ y: 46.7,
45
+ cluster: 0
46
+ }, {
47
+ x: 11.1,
48
+ y: 48.8,
49
+ cluster: 0
50
+ },
51
+ // Cluster 1
52
+ {
53
+ x: 29.4,
54
+ y: 37.0,
55
+ cluster: 1
56
+ }, {
57
+ x: 26.1,
58
+ y: 40.2,
59
+ cluster: 1
60
+ }, {
61
+ x: 29.8,
62
+ y: 42.0,
63
+ cluster: 1
64
+ }, {
65
+ x: 33.0,
66
+ y: 39.5,
67
+ cluster: 1
68
+ }, {
69
+ x: 34.9,
70
+ y: 43.6,
71
+ cluster: 1
72
+ }, {
73
+ x: 31.5,
74
+ y: 46.2,
75
+ cluster: 1
76
+ },
77
+ // Cluster 2
78
+ {
79
+ x: 21.6,
80
+ y: 53.1,
81
+ cluster: 2
82
+ }, {
83
+ x: 25.3,
84
+ y: 53.9,
85
+ cluster: 2
86
+ }, {
87
+ x: 25.8,
88
+ y: 57.9,
89
+ cluster: 2
90
+ }, {
91
+ x: 22.1,
92
+ y: 57.4,
93
+ cluster: 2
94
+ }, {
95
+ x: 18.4,
96
+ y: 56.0,
97
+ cluster: 2
98
+ }, {
99
+ x: 22.5,
100
+ y: 61.7,
101
+ cluster: 2
102
+ }];
103
+ const radius = 1.8;
104
+ const opacity = 1.0; // uniform expression
105
+
106
+ // Compute viewBox dynamically
107
+ const xs = points.map(p => p.x);
108
+ const ys = points.map(p => p.y);
109
+ const minX = Math.min(...xs) - radius;
110
+ const minY = Math.min(...ys) - radius;
111
+ const maxX = Math.max(...xs) + radius;
112
+ const maxY = Math.max(...ys) + radius;
113
+ return /*#__PURE__*/React.createElement("svg", _extends({
114
+ width: size,
115
+ height: size,
116
+ viewBox: "".concat(minX, " ").concat(minY, " ").concat(maxX - minX, " ").concat(maxY - minY),
117
+ xmlns: "http://www.w3.org/2000/svg"
118
+ }, props), points.map((_ref2, i) => {
119
+ let {
120
+ x,
121
+ y
122
+ } = _ref2;
123
+ return /*#__PURE__*/React.createElement("circle", {
124
+ key: i,
125
+ cx: x,
126
+ cy: y,
127
+ r: radius,
128
+ fill: colour,
129
+ opacity: opacity
130
+ });
131
+ }));
132
+ }
@@ -0,0 +1,28 @@
1
+ const _excluded = ["size", "colour"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ export default function ViolinPlotIcon(_ref) {
6
+ let {
7
+ size = 40,
8
+ colour = "#000"
9
+ } = _ref,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ return /*#__PURE__*/React.createElement("svg", _extends({
12
+ viewBox: "0 0 37 40",
13
+ width: size,
14
+ height: size,
15
+ xmlns: "http://www.w3.org/2000/svg"
16
+ }, props), /*#__PURE__*/React.createElement("g", {
17
+ fill: colour,
18
+ stroke: colour,
19
+ strokeWidth: "0.5",
20
+ transform: "translate(-12 -8)"
21
+ }, /*#__PURE__*/React.createElement("path", {
22
+ d: "M19.9971,24.5 A6.3078,6.3078 0 0 0 18.5732,20.8389 7.1479,7.1479 0 0 1 16.9971,16.5 V16.0029 H16.0029 V16.5 a7.1479,7.1479 0 0 1 -1.5761,4.3389 6.3078,6.3078 0 0 0 -1.4239,3.6611 12.4967,12.4967 0 0 1 -0.4853,3.38 13.5076,13.5076 0 0 0 -0.5147,3.62 6.3078,6.3078 0 0 0 1.4239,3.6611 7.1479,7.1479 0 0 1 1.5761,4.3389 19.2486,19.2486 0 0 0 0.5664,4.7246 13.6883,13.6883 0 0 1 0.4336,3.2754 v0.4971 h0.9942 V47.5 A13.6883,13.6883 0 0 1 17.4307,44.2246 19.2486,19.2486 0 0 0 17.9971,39.5 7.1479,7.1479 0 0 1 19.5732,35.1611 6.3078,6.3078 0 0 0 20.9971,31.5 13.5076,13.5076 0 0 0 20.4824,27.88 12.4967,12.4967 0 0 1 19.9971,24.5 Z"
23
+ }), /*#__PURE__*/React.createElement("path", {
24
+ d: "M34.6436,12.6963 C32.8506,11.5537 30.9971,10.3711 30.9971,8.5 V8.0029 H30.0029 V8.5 c0,1.8711 -1.8535,3.0537 -3.6465,4.1963 -1.7246,1.1006 -3.3535,2.1387 -3.3535,3.8037 0,1.6152 1.2188,2.7031 2.3975,3.7549 1.2793,1.1426 2.6025,2.3242 2.6025,4.2451 a18.1508,18.1508 0 0 1 -0.542,4.5068 14.5,14.5 0 0 0 -0.458,3.4932 6.038,6.038 0 0 0 1.6,3.7979 5.179,5.179 0 0 1 1.4,3.2021 v0.4971 h0.9942 V39.5 a5.179,5.179 0 0 1 1.4,-3.2021 6.038,6.038 0 0 0 1.6,-3.7979 14.5,14.5 0 0 0 -0.458,-3.4932 18.1508,18.1508 0 0 1 -0.542,-4.5068 c0,-1.9209 1.3232,-3.1025 2.6025,-4.2451 1.1787,-1.0518 2.3975,-2.14 2.3975,-3.7549 0,-1.665 -1.6289,-2.7031 -3.3535,-3.8037 z"
25
+ }), /*#__PURE__*/React.createElement("path", {
26
+ d: "M47.3975,35.7021 A5.179,5.179 0 0 1 45.9975,32.5 14.5,14.5 0 0 0 45.5395,29.0068 18.1508,18.1508 0 0 1 44.9975,24.5 V24.0029 H44.0033 V24.5 a18.1508,18.1508 0 0 1 -0.542,4.5068 14.5,14.5 0 0 0 -0.458,3.4932 5.179,5.179 0 0 1 -1.4,3.2021 6.038,6.038 0 0 0 -1.6,3.7979 c0,1.582 0.9717,2.667 1.9121,3.7158 1.0264,1.1455 2.0879,2.3311 2.0879,4.2842 v0.4971 h0.9942 V47.5 c0,-1.9531 1.0615,-3.1387 2.0879,-4.2842 0.94,-1.0488 1.9121,-2.1338 1.9121,-3.7158 a6.038,6.038 0 0 0 -1.6,-3.7979 z"
27
+ })));
28
+ }
@@ -3,9 +3,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
3
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import React, { useCallback, useEffect, useRef, useState } from "react";
6
+ import { useCallback, useEffect, useRef, useState } from "react";
7
7
  import _ from "lodash";
8
- import { Alert, Button } from "react-bootstrap";
8
+ import { Button } from "react-bootstrap";
9
9
  import Plot from "react-plotly.js";
10
10
  import { PLOTLY_MODEBAR_BUTTONS } from "../../constants/constants";
11
11
  import { useDataset } from "../../context/DatasetContext";
@@ -14,6 +14,7 @@ import { useSettings } from "../../context/SettingsContext";
14
14
  import { LoadingSpinner } from "../../utils/LoadingIndicators";
15
15
  import { useDebouncedFetch } from "../../utils/requests";
16
16
  import { useSelectedMultiVar, useSelectedObs } from "../../utils/Resolver";
17
+ import { PlotAlert } from "../full-page/PlotAlert";
17
18
  import { ControlsPlotlyToolbar, ObsPlotlyToolbar, VarPlotlyToolbar } from "../toolbar/Toolbar";
18
19
  export function Matrixplot(_ref) {
19
20
  let {
@@ -22,7 +23,9 @@ export function Matrixplot(_ref) {
22
23
  showCtrlsBtn = false,
23
24
  setShowObs,
24
25
  setShowVars,
25
- setShowControls
26
+ setShowControls,
27
+ plotType,
28
+ setPlotType
26
29
  } = _ref;
27
30
  const ENDPOINT = "matrixplot";
28
31
  const dataset = useDataset();
@@ -123,22 +126,28 @@ export function Matrixplot(_ref) {
123
126
  }
124
127
  }));
125
128
  }
126
- return /*#__PURE__*/React.createElement("div", {
127
- className: "cherita-matrixplot"
128
- }, /*#__PURE__*/React.createElement(Alert, {
129
- variant: "light"
130
- }, "Select", " ", showVarsBtn ? /*#__PURE__*/React.createElement(Button, {
129
+ return /*#__PURE__*/React.createElement(PlotAlert, {
130
+ variant: "info",
131
+ heading: "Matrixplot",
132
+ plotType: plotType,
133
+ setPlotType: setPlotType
134
+ }, /*#__PURE__*/React.createElement("p", {
135
+ className: "p-0 m-0"
136
+ }, "Select a", " ", showObsBtn ? /*#__PURE__*/React.createElement(Button, {
131
137
  variant: "link",
132
138
  className: "border-0 p-0 align-baseline",
133
- onClick: setShowVars
134
- }, "features") : "features", " ", "and a", " ", showObsBtn ? /*#__PURE__*/React.createElement(Button, {
139
+ onClick: setShowObs
140
+ }, "category") : "category", " ", "to group observations, then choose one or more", " ", showVarsBtn ? /*#__PURE__*/React.createElement(Button, {
135
141
  variant: "link",
136
142
  className: "border-0 p-0 align-baseline",
137
- onClick: setShowObs
138
- }, "category") : "category"));
143
+ onClick: setShowVars
144
+ }, "features") : "features", " ", "to display the matrix plot."));
139
145
  } else {
140
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Alert, {
141
- variant: "danger"
142
- }, serverError.message));
146
+ return /*#__PURE__*/React.createElement(PlotAlert, {
147
+ variant: "danger",
148
+ heading: "Matrixplot",
149
+ plotType: plotType,
150
+ setPlotType: setPlotType
151
+ }, serverError.message || "An unexpected error occurred while generating the plot.");
143
152
  }
144
153
  }