@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.
@@ -10,6 +10,7 @@ interface ModelTypeOption {
10
10
  color: string;
11
11
  };
12
12
  };
13
+ key: string;
13
14
  sensitivity: number;
14
15
  specificity: number;
15
16
  }
@@ -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: 'egfrBest', onChangeDropdown: onChangeDropdown, onClickUpdateConfiguration: onClickUpdateConfiguration }));
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
- url: string;
19
- bbox: number[];
20
- mpp: {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunit/oui",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "validate-branch-name": {
5
5
  "pattern": "^(main|develop)|(feature|fix|release|hotfix|qe)/.+$",
6
6
  "errorMsg": "The branch name is not correct. Please check the pattern. (ex. feature/add-something)"