@lunit/oui 2.3.0 → 2.3.2
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.
|
@@ -4,6 +4,7 @@ import { find as _find } from 'lodash';
|
|
|
4
4
|
import { ModelType } from '../ModelType';
|
|
5
5
|
const ModelTypeControl = (modelType) => {
|
|
6
6
|
const [modelTypeState, setModelTypeState] = useState(modelType);
|
|
7
|
+
const [selectedItem, setSelectedItem] = useState('egfrBest');
|
|
7
8
|
const updateModelType = useCallback((type) => {
|
|
8
9
|
const currentModelType = { ...modelType };
|
|
9
10
|
const currentSensitivity = currentModelType.options.find((option) => option.target.annotation.dimension === type)?.sensitivity;
|
|
@@ -16,6 +17,7 @@ const ModelTypeControl = (modelType) => {
|
|
|
16
17
|
const item = _find(modelType.options, ['target.annotation.dimension', 'egfrBest']);
|
|
17
18
|
console.log(`default item: pixelAnnotations.${item?.target.annotation.name}.${item?.target.annotation.dimension}`);
|
|
18
19
|
updateModelType('egfrBest');
|
|
20
|
+
setSelectedItem('egfrBest');
|
|
19
21
|
}, [updateModelType]);
|
|
20
22
|
const onChangeDropdown = (event) => {
|
|
21
23
|
const item = _find(modelType.options, ['target.annotation.dimension', event.target.value]);
|
|
@@ -23,6 +25,6 @@ const ModelTypeControl = (modelType) => {
|
|
|
23
25
|
updateModelType(event.target.value);
|
|
24
26
|
};
|
|
25
27
|
const onClickUpdateConfiguration = () => { };
|
|
26
|
-
return (_jsx(ModelType, { ...modelTypeState, userModelType:
|
|
28
|
+
return (_jsx(ModelType, { ...modelTypeState, userModelType: selectedItem, onChangeDropdown: onChangeDropdown, onClickUpdateConfiguration: onClickUpdateConfiguration }));
|
|
27
29
|
};
|
|
28
30
|
export default ModelTypeControl;
|
|
@@ -15,12 +15,9 @@ export interface ToggleControlSpec {
|
|
|
15
15
|
bar?: AnalysisBarProps;
|
|
16
16
|
}
|
|
17
17
|
interface PixelAnnotationSpec {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
};
|
|
18
|
+
name: string;
|
|
19
|
+
dimension?: string;
|
|
20
|
+
dimensions?: string[];
|
|
24
21
|
}
|
|
25
22
|
interface CellAnnotationSpec {
|
|
26
23
|
name: string;
|
package/package.json
CHANGED