react-science 0.19.2 → 0.20.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 (126) hide show
  1. package/lib/app/about/AboutDialogToolbarButton.js +10 -10
  2. package/lib/app/explorer/MeasurementExplorer.js +36 -43
  3. package/lib/app/helpers/react-plot.js +16 -13
  4. package/lib/app/kinds/iv/plot-view/IvPlotView.js +14 -13
  5. package/lib/app/panels/measurements/MeasurementCheckbox.js +10 -8
  6. package/lib/app/panels/measurements/MeasurementColorPreview.js +9 -7
  7. package/lib/app/panels/measurements/MeasurementsTable.js +81 -94
  8. package/lib/components/button/ButtonGroup.js +31 -43
  9. package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +18 -21
  10. package/lib/components/drop-zone/DropZone.js +48 -48
  11. package/lib/components/dropdown-menu/DropdownMenu.js +4 -4
  12. package/lib/components/forms/Input.js +150 -0
  13. package/lib/components/forms/context/FieldsContext.js +54 -0
  14. package/lib/components/forms/context/index.js +17 -0
  15. package/lib/components/forms/index.js +18 -0
  16. package/lib/components/index.js +1 -0
  17. package/lib/components/modal/ConfirmModal.js +40 -29
  18. package/lib/components/modal/Modal.js +45 -34
  19. package/lib/components/root-layout/RootLayout.js +1 -1
  20. package/lib/components/root-layout/css-reset/customPreflight.js +10 -3
  21. package/lib/components/spinner/FullSpinner.js +10 -7
  22. package/lib-esm/app/about/AboutDialogToolbarButton.d.ts +1 -1
  23. package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
  24. package/lib-esm/app/about/AboutDialogToolbarButton.js +7 -10
  25. package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
  26. package/lib-esm/app/explorer/MeasurementExplorer.d.ts +2 -1
  27. package/lib-esm/app/explorer/MeasurementExplorer.d.ts.map +1 -1
  28. package/lib-esm/app/explorer/MeasurementExplorer.js +31 -41
  29. package/lib-esm/app/explorer/MeasurementExplorer.js.map +1 -1
  30. package/lib-esm/app/helpers/MeasurementPlot.js.map +1 -1
  31. package/lib-esm/app/helpers/react-plot.d.ts +4 -2
  32. package/lib-esm/app/helpers/react-plot.d.ts.map +1 -1
  33. package/lib-esm/app/helpers/react-plot.js +11 -11
  34. package/lib-esm/app/helpers/react-plot.js.map +1 -1
  35. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts +2 -1
  36. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts.map +1 -1
  37. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js +14 -13
  38. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
  39. package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts +2 -1
  40. package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts.map +1 -1
  41. package/lib-esm/app/panels/measurements/MeasurementCheckbox.js +4 -5
  42. package/lib-esm/app/panels/measurements/MeasurementCheckbox.js.map +1 -1
  43. package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts +2 -1
  44. package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts.map +1 -1
  45. package/lib-esm/app/panels/measurements/MeasurementColorPreview.js +4 -5
  46. package/lib-esm/app/panels/measurements/MeasurementColorPreview.js.map +1 -1
  47. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts +2 -1
  48. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
  49. package/lib-esm/app/panels/measurements/MeasurementsTable.js +81 -94
  50. package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
  51. package/lib-esm/components/button/ButtonGroup.d.ts +2 -2
  52. package/lib-esm/components/button/ButtonGroup.d.ts.map +1 -1
  53. package/lib-esm/components/button/ButtonGroup.js +28 -43
  54. package/lib-esm/components/button/ButtonGroup.js.map +1 -1
  55. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts +2 -1
  56. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts.map +1 -1
  57. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +16 -19
  58. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js.map +1 -1
  59. package/lib-esm/components/drop-zone/DropZone.d.ts +2 -2
  60. package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
  61. package/lib-esm/components/drop-zone/DropZone.js +42 -45
  62. package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
  63. package/lib-esm/components/dropdown-menu/DropdownMenu.js +4 -4
  64. package/lib-esm/components/dropdown-menu/DropdownMenu.js.map +1 -1
  65. package/lib-esm/components/forms/Input.d.ts +17 -0
  66. package/lib-esm/components/forms/Input.d.ts.map +1 -0
  67. package/lib-esm/components/forms/Input.js +144 -0
  68. package/lib-esm/components/forms/Input.js.map +1 -0
  69. package/lib-esm/components/forms/context/FieldsContext.d.ts +16 -0
  70. package/lib-esm/components/forms/context/FieldsContext.d.ts.map +1 -0
  71. package/lib-esm/components/forms/context/FieldsContext.js +47 -0
  72. package/lib-esm/components/forms/context/FieldsContext.js.map +1 -0
  73. package/lib-esm/components/forms/context/index.d.ts +2 -0
  74. package/lib-esm/components/forms/context/index.d.ts.map +1 -0
  75. package/lib-esm/components/forms/context/index.js +2 -0
  76. package/lib-esm/components/forms/context/index.js.map +1 -0
  77. package/lib-esm/components/forms/index.d.ts +3 -0
  78. package/lib-esm/components/forms/index.d.ts.map +1 -0
  79. package/lib-esm/components/forms/index.js +3 -0
  80. package/lib-esm/components/forms/index.js.map +1 -0
  81. package/lib-esm/components/index.d.ts +1 -0
  82. package/lib-esm/components/index.d.ts.map +1 -1
  83. package/lib-esm/components/index.js +1 -0
  84. package/lib-esm/components/index.js.map +1 -1
  85. package/lib-esm/components/modal/ConfirmModal.d.ts +1 -1
  86. package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
  87. package/lib-esm/components/modal/ConfirmModal.js +37 -29
  88. package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
  89. package/lib-esm/components/modal/Modal.d.ts +4 -4
  90. package/lib-esm/components/modal/Modal.d.ts.map +1 -1
  91. package/lib-esm/components/modal/Modal.js +45 -34
  92. package/lib-esm/components/modal/Modal.js.map +1 -1
  93. package/lib-esm/components/root-layout/RootLayout.d.ts.map +1 -1
  94. package/lib-esm/components/root-layout/RootLayout.js +2 -2
  95. package/lib-esm/components/root-layout/RootLayout.js.map +1 -1
  96. package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts +5 -1
  97. package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
  98. package/lib-esm/components/root-layout/css-reset/customPreflight.js +6 -2
  99. package/lib-esm/components/root-layout/css-reset/customPreflight.js.map +1 -1
  100. package/lib-esm/components/spinner/FullSpinner.d.ts +7 -1
  101. package/lib-esm/components/spinner/FullSpinner.d.ts.map +1 -1
  102. package/lib-esm/components/spinner/FullSpinner.js +8 -8
  103. package/lib-esm/components/spinner/FullSpinner.js.map +1 -1
  104. package/package.json +1 -1
  105. package/src/app/about/AboutDialogToolbarButton.tsx +6 -9
  106. package/src/app/explorer/MeasurementExplorer.tsx +47 -59
  107. package/src/app/helpers/MeasurementPlot.tsx +1 -0
  108. package/src/app/helpers/react-plot.tsx +24 -19
  109. package/src/app/kinds/iv/plot-view/IvPlotView.tsx +18 -19
  110. package/src/app/panels/measurements/MeasurementCheckbox.tsx +3 -5
  111. package/src/app/panels/measurements/MeasurementColorPreview.tsx +4 -6
  112. package/src/app/panels/measurements/MeasurementsTable.tsx +112 -115
  113. package/src/components/button/ButtonGroup.tsx +30 -44
  114. package/src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx +19 -26
  115. package/src/components/drop-zone/DropZone.tsx +54 -56
  116. package/src/components/dropdown-menu/DropdownMenu.tsx +19 -17
  117. package/src/components/forms/Input.tsx +255 -0
  118. package/src/components/forms/context/FieldsContext.tsx +82 -0
  119. package/src/components/forms/context/index.ts +1 -0
  120. package/src/components/forms/index.ts +2 -0
  121. package/src/components/index.ts +1 -0
  122. package/src/components/modal/ConfirmModal.tsx +49 -44
  123. package/src/components/modal/Modal.tsx +54 -58
  124. package/src/components/root-layout/RootLayout.tsx +3 -7
  125. package/src/components/root-layout/css-reset/customPreflight.ts +6 -2
  126. package/src/components/spinner/FullSpinner.tsx +14 -9
@@ -1,17 +1,17 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css, keyframes } from '@emotion/react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { keyframes } from '@emotion/react';
3
+ import styled from '@emotion/styled';
4
4
  const spin = keyframes `
5
5
  100% {
6
6
  transform: rotate(360deg);
7
7
  }
8
8
  `;
9
- const spinnerStyle = css `
10
- height: 40px;
11
- width: 40px;
9
+ const Spinner = styled.svg `
10
+ height: ${({ height }) => `${height || 40}px`};
11
+ width: ${({ width }) => `${width || 40}px`};
12
12
  animation: ${spin} 0.8s linear infinite;
13
13
  `;
14
- export function FullSpinner() {
14
+ export function FullSpinner(props) {
15
15
  // First div is used when using nextjs/dynamic even after component is loaded
16
16
  return (_jsx("div", { style: { height: '100%' }, children: _jsx("div", { style: {
17
17
  display: 'flex',
@@ -19,6 +19,6 @@ export function FullSpinner() {
19
19
  width: '100%',
20
20
  alignItems: 'center',
21
21
  justifyContent: 'center',
22
- }, children: _jsxs("svg", { css: spinnerStyle, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }) }));
22
+ }, children: _jsxs(Spinner, { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }) }));
23
23
  }
24
24
  //# sourceMappingURL=FullSpinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FullSpinner.js","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,IAAI,GAAG,SAAS,CAAA;;;;CAIrB,CAAC;AAEF,MAAM,YAAY,GAAG,GAAG,CAAA;;;eAGT,IAAI;CAClB,CAAC;AAEF,MAAM,UAAU,WAAW;IACzB,6EAA6E;IAC7E,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC5B,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,QAAQ;aACzB,YAED,eACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,aAEnB,iBACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,GACf,EACF,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iHAAiH,GACnH,IACE,GACF,GACF,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"FullSpinner.js","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,SAAS,CAAA;;;;CAIrB,CAAC;AAOF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAkB;YAChC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,EAAE,IAAI;WACpC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,EAAE,IAAI;eAC7B,IAAI;CAClB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,6EAA6E;IAC7E,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC5B,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,QAAQ;aACzB,YAED,MAAC,OAAO,OACF,KAAK,EACT,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,aAEnB,iBACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,GACf,EACF,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iHAAiH,GACnH,IACM,GACN,GACF,CACP,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-science",
3
- "version": "0.19.2",
3
+ "version": "0.20.0",
4
4
  "description": "React components to build analysis UI",
5
5
  "exports": {
6
6
  "./app": {
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { ReactNode } from 'react';
4
3
 
5
4
  import { Modal, Toolbar, useOnOff } from '../../components/index';
@@ -10,12 +9,10 @@ interface AboutDialogToolbarButtonProps {
10
9
  body: ReactNode;
11
10
  }
12
11
 
13
- const aboutDialogToolbarButtonCss = {
14
- root: css`
15
- max-width: 600px;
16
- padding: 10px;
17
- `,
18
- };
12
+ const ModalBody = styled.div`
13
+ max-width: 600px;
14
+ padding: 10px;
15
+ `;
19
16
 
20
17
  export function AboutDialogToolbarButton(props: AboutDialogToolbarButtonProps) {
21
18
  const { name, icon, body } = props;
@@ -33,7 +30,7 @@ export function AboutDialogToolbarButton(props: AboutDialogToolbarButtonProps) {
33
30
  <Modal isOpen={isOpenDialog} onRequestClose={closeDialog}>
34
31
  <Modal.Header>{name}</Modal.Header>
35
32
  <Modal.Body>
36
- <div css={aboutDialogToolbarButtonCss.root}>{body}</div>
33
+ <ModalBody>{body}</ModalBody>
37
34
  </Modal.Body>
38
35
  </Modal>
39
36
  </>
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { useState } from 'react';
4
3
  import { FaExchangeAlt, FaArrowsAltH } from 'react-icons/fa';
5
4
 
@@ -14,12 +13,36 @@ interface ExplorerInfo {
14
13
  flipHorizontalAxis: boolean;
15
14
  }
16
15
 
16
+ const MeasurementExplorerRoot = styled.div`
17
+ display: flex;
18
+ flex-direction: column;
19
+ `;
20
+
21
+ const MeasurementExplorerContent = styled.div`
22
+ display: flex;
23
+ justify-content: space-around;
24
+ margin-bottom: 20px;
25
+ `;
26
+
27
+ const MeasurementExplorerSelect = styled.select`
28
+ cursor: pointer;
29
+ border: 1px solid black;
30
+ padding: 1px;
31
+ margin-left: 2px;
32
+ `;
33
+
34
+ const MeasurementExplorerAction = styled.div`
35
+ padding: 1px;
36
+ display: flex;
37
+ `;
38
+
17
39
  export function MeasurementExplorer(props: MeasurementExplorerProps) {
18
40
  const {
19
41
  measurement: { data },
20
42
  width = '100%',
21
43
  height = '100%',
22
44
  } = props;
45
+
23
46
  function defaultInfo(dataIndex: number) {
24
47
  const varNames = Object.keys(data[dataIndex].variables);
25
48
  return {
@@ -28,10 +51,12 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
28
51
  yVariableName: varNames.includes('y') ? 'y' : varNames[1],
29
52
  };
30
53
  }
54
+
31
55
  const [info, setInfo] = useState<ExplorerInfo>({
32
56
  flipHorizontalAxis: false,
33
57
  ...defaultInfo(0),
34
58
  });
59
+
35
60
  /* variables for this measurement are mapped into `id - label (units)`
36
61
  `id` necessary bc files may have repeated labels
37
62
  */
@@ -55,30 +80,13 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
55
80
  return null;
56
81
  });
57
82
  }
83
+
58
84
  return (
59
- <div
60
- style={{ width, height }}
61
- css={css`
62
- display: flex;
63
- flex-direction: column;
64
- `}
65
- >
66
- <div
67
- css={css`
68
- display: flex;
69
- justify-content: space-around;
70
- margin-bottom: 20px;
71
- `}
72
- >
85
+ <MeasurementExplorerRoot style={{ width, height }}>
86
+ <MeasurementExplorerContent>
73
87
  <div>
74
88
  <label>dataIndex: </label>
75
- <select
76
- css={css`
77
- cursor: pointer;
78
- border: 1px solid black;
79
- padding: 1px;
80
- margin-left: 2px;
81
- `}
89
+ <MeasurementExplorerSelect
82
90
  onChange={({ target }) => {
83
91
  const value = Number(target.value);
84
92
  if (value !== undefined && !Number.isNaN(value)) {
@@ -95,17 +103,11 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
95
103
  {i}
96
104
  </option>
97
105
  ))}
98
- </select>
106
+ </MeasurementExplorerSelect>
99
107
  </div>
100
108
  <div>
101
109
  <label>xVariable: </label>
102
- <select
103
- css={css`
104
- cursor: pointer;
105
- border: 1px solid black;
106
- padding: 1px;
107
- margin-left: 2px;
108
- `}
110
+ <MeasurementExplorerSelect
109
111
  onChange={({ target }) => {
110
112
  const value = target.value;
111
113
  if (value) {
@@ -115,14 +117,11 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
115
117
  value={info.xVariableName}
116
118
  >
117
119
  {dropdownVariables('x')}
118
- </select>
120
+ </MeasurementExplorerSelect>
119
121
  </div>
120
122
  <div>
121
123
  <FaExchangeAlt
122
- css={css`
123
- margin-top: 2px;
124
- cursor: pointer;
125
- `}
124
+ style={{ marginTop: 2, cursor: 'pointer' }}
126
125
  size="20"
127
126
  onClick={() =>
128
127
  setInfo(({ xVariableName, yVariableName, ...info }) => ({
@@ -135,13 +134,7 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
135
134
  </div>
136
135
  <div>
137
136
  <label>yVariable :</label>
138
- <select
139
- css={css`
140
- cursor: pointer;
141
- border: 1px solid black;
142
- padding: 1px;
143
- margin-left: 2px;
144
- `}
137
+ <MeasurementExplorerSelect
145
138
  onChange={({ target }) => {
146
139
  const value = target.value;
147
140
  if (value) {
@@ -151,22 +144,17 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
151
144
  value={info.yVariableName}
152
145
  >
153
146
  {dropdownVariables('y')}
154
- </select>
147
+ </MeasurementExplorerSelect>
155
148
  </div>
156
- <div
157
- css={css`
158
- padding: 1px;
159
- display: flex;
160
- `}
161
- >
149
+ <MeasurementExplorerAction>
162
150
  Flip horizontal axis:
163
151
  <FaArrowsAltH
164
- css={css`
165
- cursor: pointer;
166
- border: 1px solid black;
167
- padding: 1px;
168
- margin-left: 2px;
169
- `}
152
+ style={{
153
+ cursor: 'pointer',
154
+ border: '1px solid black',
155
+ padding: 1,
156
+ marginLeft: 2,
157
+ }}
170
158
  size="28"
171
159
  onClick={() =>
172
160
  setInfo(({ flipHorizontalAxis, ...other }) => ({
@@ -175,9 +163,9 @@ export function MeasurementExplorer(props: MeasurementExplorerProps) {
175
163
  }))
176
164
  }
177
165
  />
178
- </div>
179
- </div>
166
+ </MeasurementExplorerAction>
167
+ </MeasurementExplorerContent>
180
168
  <MeasurementPlot {...props} {...info} />
181
- </div>
169
+ </MeasurementExplorerRoot>
182
170
  );
183
171
  }
@@ -31,6 +31,7 @@ export function MeasurementPlot(props: MeasurementPlotProps) {
31
31
  </PlotController>
32
32
  );
33
33
  }
34
+
34
35
  function MeasurementComponent(props: MeasurementPlotProps) {
35
36
  const {
36
37
  measurementDisplay,
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { type ReactNode, useMemo } from 'react';
4
3
  import { ResponsiveChart } from 'react-d3-utils';
5
4
  import {
@@ -16,11 +15,20 @@ import {
16
15
 
17
16
  import type { MeasurementPlotProps } from './MeasurementPlot';
18
17
 
19
- export function BasicComponent(
20
- props: MeasurementPlotProps & {
21
- children: ReactNode[] | ReactNode;
22
- },
23
- ) {
18
+ interface BasicComponentProps extends MeasurementPlotProps {
19
+ children: ReactNode[] | ReactNode;
20
+ }
21
+
22
+ const BasicComponentRoot = styled.div`
23
+ user-drag: none;
24
+ -webkit-user-drag: none;
25
+ user-select: none;
26
+ -moz-user-select: none;
27
+ -webkit-user-select: none;
28
+ -ms-user-select: none;
29
+ `;
30
+
31
+ export function BasicComponent(props: BasicComponentProps) {
24
32
  const {
25
33
  children,
26
34
  measurement,
@@ -38,6 +46,7 @@ export function BasicComponent(
38
46
  showVerticalGrid = true,
39
47
  flipHorizontalAxis = false,
40
48
  } = props;
49
+
41
50
  const {
42
51
  info: { title },
43
52
  data,
@@ -58,36 +67,32 @@ export function BasicComponent(
58
67
 
59
68
  return { x, y };
60
69
  }, [data, dataIndex, xVariableName, yVariableName]);
70
+
61
71
  const direction = new Set(['vertical', 'horizontal']);
72
+
62
73
  const rectZoom = useRectangularZoom({
63
74
  disabled: zoom !== 'rectangular',
64
75
  });
76
+
65
77
  const axisZoom = useAxisZoom({
66
78
  direction: zoom === 'vertical' ? 'vertical' : 'horizontal',
67
79
  disabled: !direction.has(zoom),
68
80
  });
81
+
69
82
  useAxisWheelZoom({
70
83
  direction: wheelZoom === 'vertical' ? 'vertical' : 'horizontal',
71
84
  axisId: wheelZoom === 'vertical' ? 'y' : 'x',
72
85
  disabled: !direction.has(wheelZoom),
73
86
  });
87
+
74
88
  const crossHairAnnot = useCrossHair({
75
89
  disabled: !crossHair,
76
90
  });
91
+
77
92
  usePan();
78
93
 
79
94
  return (
80
- <div
81
- style={{ width, height }}
82
- css={css`
83
- user-drag: none;
84
- -webkit-user-drag: none;
85
- user-select: none;
86
- -moz-user-select: none;
87
- -webkit-user-select: none;
88
- -ms-user-select: none;
89
- `}
90
- >
95
+ <BasicComponentRoot style={{ width, height }}>
91
96
  <ResponsiveChart width={width} height={height}>
92
97
  {({ width, height }) => (
93
98
  <Plot width={width} height={height}>
@@ -116,6 +121,6 @@ export function BasicComponent(
116
121
  </Plot>
117
122
  )}
118
123
  </ResponsiveChart>
119
- </div>
124
+ </BasicComponentRoot>
120
125
  );
121
126
  }
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { FaCompress } from 'react-icons/fa';
4
3
  import { PlotController } from 'react-plot';
5
4
 
@@ -9,31 +8,31 @@ import { Toolbar } from '../../../../components/index';
9
8
  import IvMeasurementsPlot from './IvMeasurementsPlot';
10
9
  import IvPlotVariablesSelector from './IvPlotVariablesSelector';
11
10
 
11
+ const IvPlotRoot = styled.div`
12
+ display: flex;
13
+ flex-direction: row;
14
+ height: 100%;
15
+ `;
16
+
17
+ const PlotRoot = styled.div`
18
+ padding: 5px;
19
+ flex: 1;
20
+ display: flex;
21
+ flex-direction: column;
22
+ `;
23
+
12
24
  export function IvPlotView() {
13
25
  return (
14
- <div
15
- css={css`
16
- display: flex;
17
- flex-direction: row;
18
- height: 100%;
19
- `}
20
- >
26
+ <IvPlotRoot>
21
27
  <VerticalToolbar />
22
- <div
23
- css={css`
24
- padding: 5px;
25
- flex: 1;
26
- display: flex;
27
- flex-direction: column;
28
- `}
29
- >
28
+ <PlotRoot>
30
29
  <PlotController>
31
30
  <IvMeasurementsPlot />
32
31
  </PlotController>
33
32
 
34
33
  <IvPlotVariablesSelector />
35
- </div>
36
- </div>
34
+ </PlotRoot>
35
+ </IvPlotRoot>
37
36
  );
38
37
  }
39
38
 
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { useLayoutEffect, useRef } from 'react';
4
3
 
5
4
  interface MeasurementCheckboxProps {
@@ -8,7 +7,7 @@ interface MeasurementCheckboxProps {
8
7
  indeterminate?: boolean;
9
8
  }
10
9
 
11
- const checkboxCss = css`
10
+ const InputMeasurementCheckBox = styled.input`
12
11
  color: #6366f1;
13
12
  border-color: #d1d5db;
14
13
  border-radius: 0.25rem;
@@ -28,8 +27,7 @@ export function MeasurementCheckbox(props: MeasurementCheckboxProps) {
28
27
  }, [indeterminate]);
29
28
 
30
29
  return (
31
- <input
32
- css={checkboxCss}
30
+ <InputMeasurementCheckBox
33
31
  type="checkbox"
34
32
  checked={checked}
35
33
  onChange={onSelectCheckbox}
@@ -1,5 +1,4 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from '@emotion/react';
1
+ import styled from '@emotion/styled';
3
2
  import { useRef } from 'react';
4
3
 
5
4
  import {
@@ -22,7 +21,7 @@ interface MeasurementColorPreviewProps {
22
21
  color: ColorConfig;
23
22
  }
24
23
 
25
- const colorPreviewCss = css`
24
+ const ColorPreviewButton = styled.button`
26
25
  width: 1em;
27
26
  height: 1em;
28
27
  `;
@@ -46,14 +45,13 @@ export default function MeasurementColorPreview(
46
45
 
47
46
  return (
48
47
  <>
49
- <button
48
+ <ColorPreviewButton
50
49
  type="button"
51
50
  ref={setReferenceElement}
52
- css={colorPreviewCss}
53
51
  onClick={toggle}
54
52
  >
55
53
  <ColorPreview color={color} />
56
- </button>
54
+ </ColorPreviewButton>
57
55
  {isOpened && (
58
56
  <Portal>
59
57
  <div