@insync-stageplayer/measurements 0.5.37 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/lib/AsyncSubject.d.ts +23 -23
  2. package/lib/AsyncSubject.js +64 -64
  3. package/lib/client/MeasurementDataClient.d.ts +135 -130
  4. package/lib/client/MeasurementDataClient.d.ts.map +1 -1
  5. package/lib/client/MeasurementDataClient.js +99 -99
  6. package/lib/client/MeasurementDataClient.js.map +1 -1
  7. package/lib/client/OnlineMeasurementDataClient.d.ts +44 -44
  8. package/lib/client/OnlineMeasurementDataClient.d.ts.map +1 -1
  9. package/lib/client/OnlineMeasurementDataClient.js +211 -211
  10. package/lib/client/OnlineMeasurementDataClient.js.map +1 -1
  11. package/lib/client/debug.d.ts +1 -1
  12. package/lib/client/debug.js +4 -4
  13. package/lib/client/index.d.ts +3 -3
  14. package/lib/client/index.js +3 -3
  15. package/lib/client/offline/OfflineMeasurementDataClient.d.ts +16 -16
  16. package/lib/client/offline/OfflineMeasurementDataClient.js +47 -47
  17. package/lib/client/offline/offline.d.ts +16 -16
  18. package/lib/client/offline/offline.js +82 -82
  19. package/lib/client/sbf.d.ts +35 -35
  20. package/lib/client/sbf.js +88 -88
  21. package/lib/client/signalviewer/SignalViewerDataClient.d.ts +37 -37
  22. package/lib/client/signalviewer/SignalViewerDataClient.d.ts.map +1 -1
  23. package/lib/client/signalviewer/SignalViewerDataClient.js +163 -164
  24. package/lib/client/signalviewer/SignalViewerDataClient.js.map +1 -1
  25. package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts +79 -73
  26. package/lib/client/signalviewer/SignalViewerDataClient.worker.d.ts.map +1 -1
  27. package/lib/client/signalviewer/SignalViewerDataClient.worker.js +342 -211
  28. package/lib/client/signalviewer/SignalViewerDataClient.worker.js.map +1 -1
  29. package/lib/components/Icon/CloseIcon.d.ts +6 -6
  30. package/lib/components/Icon/CloseIcon.js +24 -24
  31. package/lib/components/Icon/Icon.test.d.ts +1 -1
  32. package/lib/components/Icon/Icon.test.js +11 -11
  33. package/lib/components/MeasurementsChooser.d.ts +38 -38
  34. package/lib/components/MeasurementsChooser.d.ts.map +1 -1
  35. package/lib/components/MeasurementsChooser.js +178 -181
  36. package/lib/components/MeasurementsChooser.js.map +1 -1
  37. package/lib/components/MeasurementsModuleProvider.d.ts +34 -34
  38. package/lib/components/MeasurementsModuleProvider.d.ts.map +1 -1
  39. package/lib/components/MeasurementsModuleProvider.js +100 -79
  40. package/lib/components/MeasurementsModuleProvider.js.map +1 -1
  41. package/lib/components/MeasurementsTable/CheckboxCell.d.ts +35 -35
  42. package/lib/components/MeasurementsTable/CheckboxCell.js +28 -28
  43. package/lib/components/MeasurementsTable/ColorCell.d.ts +29 -29
  44. package/lib/components/MeasurementsTable/ColorCell.d.ts.map +1 -1
  45. package/lib/components/MeasurementsTable/ColorCell.js +58 -58
  46. package/lib/components/MeasurementsTable/ColorPicker.d.ts +6 -3
  47. package/lib/components/MeasurementsTable/ColorPicker.d.ts.map +1 -1
  48. package/lib/components/MeasurementsTable/ColorPicker.js +10 -10
  49. package/lib/components/MeasurementsTable/ColumnResizer.d.ts +4 -4
  50. package/lib/components/MeasurementsTable/ColumnResizer.js +5 -5
  51. package/lib/components/MeasurementsTable/ColumnSorting.d.ts +13 -13
  52. package/lib/components/MeasurementsTable/ColumnSorting.d.ts.map +1 -1
  53. package/lib/components/MeasurementsTable/ColumnSorting.js +10 -10
  54. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts +72 -72
  55. package/lib/components/MeasurementsTable/MeasurementsTable.d.ts.map +1 -1
  56. package/lib/components/MeasurementsTable/MeasurementsTable.js +229 -217
  57. package/lib/components/MeasurementsTable/MeasurementsTable.js.map +1 -1
  58. package/lib/components/MeasurementsTable/MeasurementsTable.test.d.ts +1 -1
  59. package/lib/components/MeasurementsTable/MeasurementsTable.test.js +102 -102
  60. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts +72 -72
  61. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.d.ts.map +1 -1
  62. package/lib/components/MeasurementsTable/MeasurementsTableNoldus.js +193 -193
  63. package/lib/components/MeasurementsTable/SelectedContext.d.ts +10 -10
  64. package/lib/components/MeasurementsTable/SelectedContext.js +10 -10
  65. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts +8 -8
  66. package/lib/components/MeasurementsTable/TextColumnFilter.d.ts.map +1 -1
  67. package/lib/components/MeasurementsTable/TextColumnFilter.js +15 -15
  68. package/lib/components/MeasurementsTable/filters.d.ts +3 -3
  69. package/lib/components/MeasurementsTable/filters.js +9 -9
  70. package/lib/components/MeasurementsTable/index.d.ts +2 -2
  71. package/lib/components/MeasurementsTable/index.js +2 -2
  72. package/lib/components/ModalMeasurementChooser.d.ts +19 -19
  73. package/lib/components/ModalMeasurementChooser.js +35 -35
  74. package/lib/conversion/UnitConversion.d.ts +13 -0
  75. package/lib/conversion/UnitConversion.d.ts.map +1 -0
  76. package/lib/conversion/UnitConversion.js +266 -0
  77. package/lib/conversion/UnitConversion.js.map +1 -0
  78. package/lib/hooks/useMarkerData.d.ts +6 -4
  79. package/lib/hooks/useMarkerData.d.ts.map +1 -1
  80. package/lib/hooks/useMarkerData.js +93 -63
  81. package/lib/hooks/useMarkerData.js.map +1 -1
  82. package/lib/hooks/useMeasurement.d.ts +41 -17
  83. package/lib/hooks/useMeasurement.d.ts.map +1 -1
  84. package/lib/hooks/useMeasurement.js +41 -41
  85. package/lib/hooks/useMeasurements.d.ts +11 -11
  86. package/lib/hooks/useMeasurements.js +22 -22
  87. package/lib/hooks/useMeasurementsModule.d.ts +20 -20
  88. package/lib/hooks/useMeasurementsModule.js +12 -12
  89. package/lib/hooks/useOverlayMeasurementData.d.ts +1 -1
  90. package/lib/hooks/useOverlayMeasurementData.js +23 -23
  91. package/lib/hooks/useTimedMeasurementData.d.ts +26 -26
  92. package/lib/hooks/useTimedMeasurementData.d.ts.map +1 -1
  93. package/lib/hooks/useTimedMeasurementData.js +125 -125
  94. package/lib/hooks/useTimedMeasurementData.js.map +1 -1
  95. package/lib/hooks/useWindowedMeasurementData.d.ts +25 -25
  96. package/lib/hooks/useWindowedMeasurementData.d.ts.map +1 -1
  97. package/lib/hooks/useWindowedMeasurementData.js +120 -120
  98. package/lib/hooks/useWindowedMeasurementData.js.map +1 -1
  99. package/lib/index.d.ts +15 -14
  100. package/lib/index.d.ts.map +1 -1
  101. package/lib/index.js +15 -14
  102. package/lib/index.js.map +1 -1
  103. package/lib/redux/measurements.slice.d.ts +75 -122
  104. package/lib/redux/measurements.slice.d.ts.map +1 -1
  105. package/lib/redux/measurements.slice.js +90 -89
  106. package/lib/redux/measurements.slice.js.map +1 -1
  107. package/lib/redux/reducer.d.ts +3 -10
  108. package/lib/redux/reducer.d.ts.map +1 -1
  109. package/lib/redux/reducer.js +2 -2
  110. package/lib/redux/reducer.js.map +1 -1
  111. package/lib/types.d.ts +93 -93
  112. package/lib/types.js +51 -51
  113. package/package.json +7 -10
@@ -1,16 +1,16 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from "react";
13
- import styled from "styled-components";
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from "react";
13
+ import styled from "styled-components";
14
14
  const StyledSvg = styled.svg `
15
15
  width: 30px;
16
16
  cursor: pointer;
@@ -18,15 +18,15 @@ const StyledSvg = styled.svg `
18
18
  filter: invert(37%) sepia(91%) saturate(500%) hue-rotate(130deg)
19
19
  brightness(99%) contrast(94%);
20
20
  }
21
- `;
22
- export const CloseIcon = (_a) => {
23
- var props = __rest(_a, []);
24
- return (React.createElement(StyledSvg, { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30" },
25
- React.createElement("g", { id: "Group_1369", "data-name": "Group 1369", transform: "translate(9 9)", className: "hoverStyle" },
26
- React.createElement("line", { id: "_x39_1c3244b-a44b-4462-ad78-3b291975bc24_1_", y1: "12", x2: "12", fill: "none", stroke: "#282828", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1" }),
27
- React.createElement("line", { id: "dcc09f5c-b82c-4d96-b38b-0540c6362512_1_", x1: "12", y1: "12", fill: "none", stroke: "#282828", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1" })),
28
- React.createElement("g", { id: "Ellipse_408", "data-name": "Ellipse 408", fill: "none", stroke: "#282828", strokeWidth: "1", className: "hoverStyle" },
29
- React.createElement("circle", { cx: "15", cy: "15", r: "15", stroke: "none" }),
30
- React.createElement("circle", { cx: "15", cy: "15", r: "14.5", fill: "none" }))));
31
- };
21
+ `;
22
+ export const CloseIcon = (_a) => {
23
+ var props = __rest(_a, []);
24
+ return (React.createElement(StyledSvg, { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30" },
25
+ React.createElement("g", { id: "Group_1369", "data-name": "Group 1369", transform: "translate(9 9)", className: "hoverStyle" },
26
+ React.createElement("line", { id: "_x39_1c3244b-a44b-4462-ad78-3b291975bc24_1_", y1: "12", x2: "12", fill: "none", stroke: "#282828", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1" }),
27
+ React.createElement("line", { id: "dcc09f5c-b82c-4d96-b38b-0540c6362512_1_", x1: "12", y1: "12", fill: "none", stroke: "#282828", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1" })),
28
+ React.createElement("g", { id: "Ellipse_408", "data-name": "Ellipse 408", fill: "none", stroke: "#282828", strokeWidth: "1", className: "hoverStyle" },
29
+ React.createElement("circle", { cx: "15", cy: "15", r: "15", stroke: "none" }),
30
+ React.createElement("circle", { cx: "15", cy: "15", r: "14.5", fill: "none" }))));
31
+ };
32
32
  //# sourceMappingURL=CloseIcon.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=Icon.test.d.ts.map
@@ -1,12 +1,12 @@
1
- import React from "react";
2
- import { shallow, configure } from "enzyme";
3
- import Adapter from "enzyme-adapter-react-16";
4
- import { CloseIcon } from "./CloseIcon";
5
- configure({ adapter: new Adapter() });
6
- describe("Icon component", () => {
7
- test("Component is rendered", () => {
8
- const wrapper = shallow(React.createElement(CloseIcon, null));
9
- expect(wrapper.exists()).toBe(true);
10
- });
11
- });
1
+ import React from "react";
2
+ import { shallow, configure } from "enzyme";
3
+ import Adapter from "enzyme-adapter-react-16";
4
+ import { CloseIcon } from "./CloseIcon";
5
+ configure({ adapter: new Adapter() });
6
+ describe("Icon component", () => {
7
+ test("Component is rendered", () => {
8
+ const wrapper = shallow(React.createElement(CloseIcon, null));
9
+ expect(wrapper.exists()).toBe(true);
10
+ });
11
+ });
12
12
  //# sourceMappingURL=Icon.test.js.map
@@ -1,39 +1,39 @@
1
- import React from "react";
2
- export declare type MeasurementsChooserProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3
- /**
4
- * If set to true only a single measurement can be selected.
5
- */
6
- single?: boolean;
7
- /**
8
- * The selected measurements.
9
- */
10
- selected?: string[];
11
- /**
12
- * Called whenever a measurement is selected.
13
- *
14
- * @param {string[]} newSelected The newly selected measurements.
15
- */
16
- onChange: (newSelected: string[]) => void;
17
- /**
18
- * Function used to generate a new color for a measurements.
19
- */
20
- generateColor?: () => string;
21
- /**
22
- *
23
- */
24
- dataViewerId: string;
25
- };
26
- /**
27
- * A component that provides functionality to select measurements. The measurements are grouped
28
- * per file, and displayed inside a table.
29
- *
30
- * The selected measurements should be kept in a separate state, this is a controlled components.
31
- *
32
- * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
33
- * a color yet, it will create a new color, and update the existing measurement.
34
- *
35
- * @param props
36
- * @returns
37
- */
38
- export declare const MeasurementsChooser: React.FC<MeasurementsChooserProps>;
1
+ import React from "react";
2
+ export declare type MeasurementsChooserProps = Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & {
3
+ /**
4
+ * If set to true only a single measurement can be selected.
5
+ */
6
+ single?: boolean;
7
+ /**
8
+ * The selected measurements.
9
+ */
10
+ selected?: string[];
11
+ /**
12
+ * Called whenever a measurement is selected.
13
+ *
14
+ * @param {string[]} newSelected The newly selected measurements.
15
+ */
16
+ onChange: (newSelected: string[]) => void;
17
+ /**
18
+ * Function used to generate a new color for a measurements.
19
+ */
20
+ generateColor?: () => string;
21
+ /**
22
+ *
23
+ */
24
+ dataViewerId: string;
25
+ };
26
+ /**
27
+ * A component that provides functionality to select measurements. The measurements are grouped
28
+ * per file, and displayed inside a table.
29
+ *
30
+ * The selected measurements should be kept in a separate state, this is a controlled components.
31
+ *
32
+ * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
33
+ * a color yet, it will create a new color, and update the existing measurement.
34
+ *
35
+ * @param props
36
+ * @returns
37
+ */
38
+ export declare const MeasurementsChooser: React.FC<MeasurementsChooserProps>;
39
39
  //# sourceMappingURL=MeasurementsChooser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementsChooser.d.ts","sourceRoot":"","sources":["../../src/components/MeasurementsChooser.tsx"],"names":[],"mappings":"AASA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,oBAAY,wBAAwB,GAAG,IAAI,CACzC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;IAC7B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA4QlE,CAAC"}
1
+ {"version":3,"file":"MeasurementsChooser.d.ts","sourceRoot":"","sources":["../../src/components/MeasurementsChooser.tsx"],"names":[],"mappings":"AASA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,oBAAY,wBAAwB,GAAG,IAAI,CACzC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;IAC7B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAsQlE,CAAC"}
@@ -1,182 +1,179 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { Accordion, AccordionItem, AccordionItemBody, AccordionItemHeading, IndeterminateLoadingIndicator, useTheme as useSelectedTheme, } from "@insync-stageplayer/ui-components";
13
- import randomColor from "randomcolor";
14
- import React, { useCallback, useState } from "react";
15
- import { MeasurementsTable, MeasurementsTableNoldus, } from "./MeasurementsTable";
16
- import { useMeasurements } from "../hooks/useMeasurements";
17
- import { useDispatch, useSelector } from "react-redux";
18
- import { selectLastColorIndex, selectLastColorIndexPerDataViewer, setDataScale, updateMeasurement, updateMeasurements, } from "../redux/measurements.slice";
19
- import { useMeasurementsModule } from "../hooks/useMeasurementsModule";
20
- /**
21
- * A component that provides functionality to select measurements. The measurements are grouped
22
- * per file, and displayed inside a table.
23
- *
24
- * The selected measurements should be kept in a separate state, this is a controlled components.
25
- *
26
- * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
27
- * a color yet, it will create a new color, and update the existing measurement.
28
- *
29
- * @param props
30
- * @returns
31
- */
32
- export const MeasurementsChooser = (props) => {
33
- const { selected, onChange, generateColor = randomColor, single, dataViewerId } = props, rest = __rest(props, ["selected", "onChange", "generateColor", "single", "dataViewerId"]);
34
- const dispatch = useDispatch();
35
- const { measurements, loading, error } = useMeasurements();
36
- const { selector } = useMeasurementsModule();
37
- /**
38
- * The colors that should be used, retrieved from redux state,
39
- * whenever this list runs out, random colors will be used.
40
- */
41
- const colors = useSelector((s) => {
42
- return selector(s).colors;
43
- });
44
- const lastColorIndex = useSelector((s) => selectLastColorIndex(selector(s)));
45
- const lastColorIndexPerDataViewer = useSelector((s) => selectLastColorIndexPerDataViewer(selector(s), dataViewerId));
46
- const [open, setOpen] = useState(0);
47
- const globallyUniqueMeasurementColors = useSelector((s) => selector(s).globallyUniqueMeasurementColors);
48
- /**
49
- * Measurements grouped by file.
50
- */
51
- const groups = measurements.reduce((acc, c) => {
52
- const group = c.file;
53
- return Object.assign(Object.assign({}, acc), { [group]: [...(acc[group] || []), c] });
54
- }, {});
55
- const groupKeys = Object.keys(groups).sort();
56
- const handleColorChange = useCallback((id, color) => {
57
- measurements
58
- .filter((m) => {
59
- return m.id === id;
60
- })
61
- .map((m) => {
62
- var _a;
63
- dispatch(updateMeasurement({
64
- id,
65
- changes: {
66
- color,
67
- colorPerDataViewer: {
68
- byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: color }),
69
- },
70
- },
71
- }));
72
- });
73
- }, [dispatch, measurements, dataViewerId]);
74
- const nextColor = useCallback(() => {
75
- if (colors[lastColorIndex + 1]) {
76
- return colors[lastColorIndex + 1];
77
- }
78
- return generateColor();
79
- }, [lastColorIndex, colors, generateColor]);
80
- const nextColorDataViewerSpecific = useCallback((id) => {
81
- if (colors[lastColorIndexPerDataViewer + 1]) {
82
- return colors[lastColorIndexPerDataViewer + 1];
83
- }
84
- return generateColor();
85
- }, [lastColorIndexPerDataViewer, colors, generateColor]);
86
- const handleChange = useCallback((selected) => {
87
- const measurementsWithoutColor = globallyUniqueMeasurementColors
88
- ? measurements
89
- .filter((m) => selected.indexOf(m.id) !== -1 && m.color === undefined)
90
- .map((m) => {
91
- var _a;
92
- return (Object.assign(Object.assign({}, m), { color: nextColor(), colorPerDataViewer: {
93
- byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: nextColor() }),
94
- } }));
95
- })
96
- : measurements
97
- .filter((m) => {
98
- var _a;
99
- return selected.indexOf(m.id) !== -1 &&
100
- ((_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId[dataViewerId]) === undefined;
101
- })
102
- .map((m) => {
103
- var _a;
104
- return (Object.assign(Object.assign({}, m), { color: m.color === undefined ? nextColor() : m.color, colorPerDataViewer: {
105
- byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: m.color === undefined
106
- ? nextColorDataViewerSpecific(dataViewerId)
107
- : m.color }),
108
- } }));
109
- });
110
- dispatch(updateMeasurements(measurementsWithoutColor));
111
- onChange(selected);
112
- }, [
113
- measurements,
114
- globallyUniqueMeasurementColors,
115
- dataViewerId,
116
- dispatch,
117
- onChange,
118
- nextColor,
119
- nextColorDataViewerSpecific,
120
- ]);
121
- const handleYAxisPosChange = useCallback((selected) => {
122
- var _a;
123
- const measurementsWithoutColor = globallyUniqueMeasurementColors
124
- ? measurements
125
- .filter((m) => selected.indexOf(m.id) !== -1 && m.color === undefined)
126
- .map((m) => {
127
- var _a;
128
- return (Object.assign(Object.assign({}, m), { color: nextColor(), colorPerDataViewer: {
129
- byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: nextColor() }),
130
- } }));
131
- })
132
- : measurements
133
- .filter((m) => {
134
- var _a;
135
- return selected.indexOf(m.id) !== -1 &&
136
- ((_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId[dataViewerId]) === undefined;
137
- })
138
- .map((m) => {
139
- var _a;
140
- return (Object.assign(Object.assign({}, m), { color: m.color === undefined ? nextColor() : m.color, colorPerDataViewer: {
141
- byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: m.color === undefined
142
- ? nextColorDataViewerSpecific(dataViewerId)
143
- : m.color }),
144
- } }));
145
- });
146
- const selectedDataScales = measurements.filter((m) => selected.indexOf(m.id) !== -1 && m.dataScale !== undefined);
147
- const selectedDataScale = ((_a = selectedDataScales[0]) === null || _a === void 0 ? void 0 : _a.dataScale) || 1;
148
- dispatch(updateMeasurements(measurementsWithoutColor));
149
- dispatch(setDataScale(selectedDataScale));
150
- onChange(selected);
151
- }, [
152
- measurements,
153
- dispatch,
154
- onChange,
155
- nextColor,
156
- dataViewerId,
157
- globallyUniqueMeasurementColors,
158
- nextColorDataViewerSpecific,
159
- ]);
160
- /**
161
- * The scale of the model for which the measurement data was recorded.
162
- */
163
- const measurementScale = useSelector((s) => selector(s).measurementScale);
164
- const dataScale = useSelector((s) => selector(s).dataScale);
165
- const selectedTheme = useSelectedTheme();
166
- const formatFrequency = (v) => {
167
- return (Number(v * Math.sqrt(measurementScale / dataScale)).toFixed(0) + " Hz");
168
- };
169
- if (loading) {
170
- return React.createElement(IndeterminateLoadingIndicator, null);
171
- }
172
- if (error) {
173
- return React.createElement("span", null, error);
174
- }
175
- return (React.createElement(Accordion, Object.assign({ activeIndex: open, onChange: setOpen }, rest), groupKeys.map((k, index) => (React.createElement(AccordionItem, { key: k, index: index },
176
- React.createElement(AccordionItemHeading, null, (() => {
177
- const parts = k.split(/\/|\\/);
178
- return parts[parts.length - 1];
179
- })()),
180
- React.createElement(AccordionItemBody, { style: { height: "200px" } }, selectedTheme.name === "noldus" ? (React.createElement(MeasurementsTableNoldus, { single: single, measurements: groups[k], selected: selected, onChange: handleChange, onColorChange: handleColorChange, onYAxisPosChange: handleYAxisPosChange, formatFrequency: formatFrequency, globallyUniqueMeasurementColors: globallyUniqueMeasurementColors, dataViewerId: dataViewerId })) : (React.createElement(MeasurementsTable, { single: single, measurements: groups[k], selected: selected, onChange: handleChange, onColorChange: handleColorChange, onYAxisPosChange: handleYAxisPosChange, formatFrequency: formatFrequency, globallyUniqueMeasurementColors: globallyUniqueMeasurementColors, dataViewerId: dataViewerId }))))))));
181
- };
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Accordion, AccordionItem, AccordionItemBody, AccordionItemHeading, IndeterminateLoadingIndicator, useTheme as useSelectedTheme, } from "@insync-stageplayer/ui-components";
13
+ import randomColor from "randomcolor";
14
+ import React, { useCallback, useState } from "react";
15
+ import { MeasurementsTable, MeasurementsTableNoldus, } from "./MeasurementsTable";
16
+ import { useMeasurements } from "../hooks/useMeasurements";
17
+ import { useDispatch, useSelector } from "react-redux";
18
+ import { selectLastColorIndex, selectLastColorIndexPerDataViewer, setDataScale, updateMeasurement, updateMeasurements, } from "../redux/measurements.slice";
19
+ import { useMeasurementsModule } from "../hooks/useMeasurementsModule";
20
+ /**
21
+ * A component that provides functionality to select measurements. The measurements are grouped
22
+ * per file, and displayed inside a table.
23
+ *
24
+ * The selected measurements should be kept in a separate state, this is a controlled components.
25
+ *
26
+ * Whenever a measurement is selected, it will check if a measurement has a color. If it doesn't have
27
+ * a color yet, it will create a new color, and update the existing measurement.
28
+ *
29
+ * @param props
30
+ * @returns
31
+ */
32
+ export const MeasurementsChooser = (props) => {
33
+ const { selected, onChange, generateColor = randomColor, single, dataViewerId } = props, rest = __rest(props, ["selected", "onChange", "generateColor", "single", "dataViewerId"]);
34
+ const dispatch = useDispatch();
35
+ const { measurements, loading } = useMeasurements();
36
+ const { selector } = useMeasurementsModule();
37
+ /**
38
+ * The colors that should be used, retrieved from redux state,
39
+ * whenever this list runs out, random colors will be used.
40
+ */
41
+ const colors = useSelector((s) => {
42
+ return selector(s).colors;
43
+ });
44
+ const lastColorIndex = useSelector((s) => selectLastColorIndex(selector(s)));
45
+ const lastColorIndexPerDataViewer = useSelector((s) => selectLastColorIndexPerDataViewer(selector(s), dataViewerId));
46
+ const [open, setOpen] = useState(0);
47
+ const globallyUniqueMeasurementColors = useSelector((s) => selector(s).globallyUniqueMeasurementColors);
48
+ /**
49
+ * Measurements grouped by file.
50
+ */
51
+ const groups = measurements.reduce((acc, c) => {
52
+ const group = c.file;
53
+ return Object.assign(Object.assign({}, acc), { [group]: [...(acc[group] || []), c] });
54
+ }, {});
55
+ const groupKeys = Object.keys(groups).sort();
56
+ const handleColorChange = useCallback((id, color) => {
57
+ measurements
58
+ .filter((m) => {
59
+ return m.id === id;
60
+ })
61
+ .map((m) => {
62
+ var _a;
63
+ dispatch(updateMeasurement({
64
+ id,
65
+ changes: {
66
+ color,
67
+ colorPerDataViewer: {
68
+ byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: color }),
69
+ },
70
+ },
71
+ }));
72
+ });
73
+ }, [dispatch, measurements, dataViewerId]);
74
+ const nextColor = useCallback(() => {
75
+ if (colors[lastColorIndex + 1]) {
76
+ return colors[lastColorIndex + 1];
77
+ }
78
+ return generateColor();
79
+ }, [lastColorIndex, colors, generateColor]);
80
+ const nextColorDataViewerSpecific = useCallback((id) => {
81
+ if (colors[lastColorIndexPerDataViewer + 1]) {
82
+ return colors[lastColorIndexPerDataViewer + 1];
83
+ }
84
+ return generateColor();
85
+ }, [lastColorIndexPerDataViewer, colors, generateColor]);
86
+ const handleChange = useCallback((selected) => {
87
+ const measurementsWithoutColor = globallyUniqueMeasurementColors
88
+ ? measurements
89
+ .filter((m) => selected.indexOf(m.id) !== -1 && m.color === undefined)
90
+ .map((m) => {
91
+ var _a;
92
+ return (Object.assign(Object.assign({}, m), { color: nextColor(), colorPerDataViewer: {
93
+ byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: nextColor() }),
94
+ } }));
95
+ })
96
+ : measurements
97
+ .filter((m) => {
98
+ var _a;
99
+ return selected.indexOf(m.id) !== -1 &&
100
+ ((_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId[dataViewerId]) === undefined;
101
+ })
102
+ .map((m) => {
103
+ var _a;
104
+ return (Object.assign(Object.assign({}, m), { color: m.color === undefined ? nextColor() : m.color, colorPerDataViewer: {
105
+ byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: m.color === undefined
106
+ ? nextColorDataViewerSpecific(dataViewerId)
107
+ : m.color }),
108
+ } }));
109
+ });
110
+ dispatch(updateMeasurements(measurementsWithoutColor));
111
+ onChange(selected);
112
+ }, [
113
+ measurements,
114
+ globallyUniqueMeasurementColors,
115
+ dataViewerId,
116
+ dispatch,
117
+ onChange,
118
+ nextColor,
119
+ nextColorDataViewerSpecific,
120
+ ]);
121
+ const handleYAxisPosChange = useCallback((selected) => {
122
+ var _a;
123
+ const measurementsWithoutColor = globallyUniqueMeasurementColors
124
+ ? measurements
125
+ .filter((m) => selected.indexOf(m.id) !== -1 && m.color === undefined)
126
+ .map((m) => {
127
+ var _a;
128
+ return (Object.assign(Object.assign({}, m), { color: nextColor(), colorPerDataViewer: {
129
+ byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: nextColor() }),
130
+ } }));
131
+ })
132
+ : measurements
133
+ .filter((m) => {
134
+ var _a;
135
+ return selected.indexOf(m.id) !== -1 &&
136
+ ((_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId[dataViewerId]) === undefined;
137
+ })
138
+ .map((m) => {
139
+ var _a;
140
+ return (Object.assign(Object.assign({}, m), { color: m.color === undefined ? nextColor() : m.color, colorPerDataViewer: {
141
+ byId: Object.assign(Object.assign({}, (_a = m.colorPerDataViewer) === null || _a === void 0 ? void 0 : _a.byId), { [dataViewerId]: m.color === undefined
142
+ ? nextColorDataViewerSpecific(dataViewerId)
143
+ : m.color }),
144
+ } }));
145
+ });
146
+ const selectedDataScales = measurements.filter((m) => selected.indexOf(m.id) !== -1 && m.dataScale !== undefined);
147
+ const selectedDataScale = ((_a = selectedDataScales[0]) === null || _a === void 0 ? void 0 : _a.dataScale) || 1;
148
+ dispatch(updateMeasurements(measurementsWithoutColor));
149
+ dispatch(setDataScale(selectedDataScale));
150
+ onChange(selected);
151
+ }, [
152
+ measurements,
153
+ dispatch,
154
+ onChange,
155
+ nextColor,
156
+ dataViewerId,
157
+ globallyUniqueMeasurementColors,
158
+ nextColorDataViewerSpecific,
159
+ ]);
160
+ /**
161
+ * The scale of the model for which the measurement data was recorded.
162
+ */
163
+ const measurementScale = useSelector((s) => selector(s).measurementScale);
164
+ const dataScale = useSelector((s) => selector(s).dataScale);
165
+ const selectedTheme = useSelectedTheme();
166
+ const formatFrequency = (v) => {
167
+ return Number(v).toFixed(0) + " Hz";
168
+ };
169
+ if (loading) {
170
+ return React.createElement(IndeterminateLoadingIndicator, null);
171
+ }
172
+ return (React.createElement(Accordion, Object.assign({ activeIndex: open, onChange: setOpen }, rest), groupKeys.map((k, index) => (React.createElement(AccordionItem, { key: k, index: index },
173
+ React.createElement(AccordionItemHeading, null, (() => {
174
+ const parts = k.split(/\/|\\/);
175
+ return parts[parts.length - 1];
176
+ })()),
177
+ React.createElement(AccordionItemBody, { style: { height: "200px" } }, selectedTheme.name === "noldus" ? (React.createElement(MeasurementsTableNoldus, { single: single, measurements: groups[k], selected: selected, onChange: handleChange, onColorChange: handleColorChange, onYAxisPosChange: handleYAxisPosChange, formatFrequency: formatFrequency, globallyUniqueMeasurementColors: globallyUniqueMeasurementColors, dataViewerId: dataViewerId })) : (React.createElement(MeasurementsTable, { single: single, measurements: groups[k], selected: selected, onChange: handleChange, onColorChange: handleColorChange, onYAxisPosChange: handleYAxisPosChange, formatFrequency: formatFrequency, globallyUniqueMeasurementColors: globallyUniqueMeasurementColors, dataViewerId: dataViewerId }))))))));
178
+ };
182
179
  //# sourceMappingURL=MeasurementsChooser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementsChooser.js","sourceRo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