-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31ddd5f
commit e6d2d99
Showing
13 changed files
with
208 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/aimcore/web/ui/src/modules/BaseExplorer/components/Image/Image.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
|
||
import ErrorBoundary from 'components/ErrorBoundary'; | ||
import ImageBox from 'components/ImageBox'; | ||
|
||
import { IBoxContentProps } from 'modules/BaseExplorer/types'; | ||
|
||
function Image(props: IBoxContentProps) { | ||
return ( | ||
<ErrorBoundary> | ||
<ImageBox | ||
engine={{ blobURI: props.engine.blobURI }} | ||
format={props.data.data.format} | ||
caption={props.data.data.caption} | ||
name={props.data.sequence.name} | ||
context={props.data.sequence.context} | ||
step={props.data.record.step} | ||
index={props.data.record.index} | ||
blobData={props.data.data.blobs.data} | ||
isFullView={props.isFullView} | ||
/> | ||
</ErrorBoundary> | ||
); | ||
} | ||
|
||
export default React.memo(Image); |
2 changes: 2 additions & 0 deletions
2
src/aimcore/web/ui/src/modules/BaseExplorer/components/Image/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Image from './Image'; | ||
export default Image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/aimcore/web/ui/src/pages/Explorers/ImagesExplorer/config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import produce from 'immer'; | ||
|
||
import { getDefaultHydration } from 'modules/BaseExplorer'; | ||
import { GroupType, Order } from 'modules/core/pipeline'; | ||
import { defaultHydration } from 'modules/BaseExplorer/getDefaultHydration'; | ||
import { CaptionProperties } from 'modules/BaseExplorer/components/Controls'; | ||
|
||
import { GetSequenceName, SequenceType } from 'types/core/enums'; | ||
|
||
import getImagesExplorerStaticContent from './getStaticContent'; | ||
|
||
export const getImagesDefaultConfig = (): typeof defaultHydration => { | ||
const defaultConfig = getDefaultHydration(); | ||
const sequenceName = GetSequenceName(SequenceType.Image); | ||
|
||
const groupings = produce(defaultConfig.groupings, (draft: any) => { | ||
draft[GroupType.COLUMN].defaultApplications.orders = [Order.ASC, Order.ASC]; | ||
draft[GroupType.COLUMN].defaultApplications.fields = [ | ||
'run.hash', | ||
`${sequenceName}.name`, | ||
]; | ||
draft[GroupType.ROW].defaultApplications.orders = [Order.DESC]; | ||
draft[GroupType.ROW].defaultApplications.fields = ['record.step']; | ||
|
||
draft[GroupType.GRID].defaultApplications.orders = [Order.ASC]; | ||
draft[GroupType.GRID].defaultApplications.fields = [`${sequenceName}.name`]; | ||
}); | ||
|
||
const controls = produce(defaultConfig.controls, (draft: any) => { | ||
draft.captionProperties = { | ||
component: CaptionProperties, | ||
state: { | ||
initialState: { | ||
displayBoxCaption: true, | ||
selectedFields: [ | ||
'run.name', | ||
`${sequenceName}.name`, | ||
`${sequenceName}.context`, | ||
], | ||
}, | ||
persist: 'url', | ||
}, | ||
}; | ||
}); | ||
|
||
return { | ||
...defaultConfig, | ||
groupings, | ||
controls, | ||
getStaticContent: getImagesExplorerStaticContent, | ||
}; | ||
}; |
52 changes: 52 additions & 0 deletions
52
src/aimcore/web/ui/src/pages/Explorers/ImagesExplorer/getStaticContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from 'react'; | ||
|
||
import { DOCUMENTATIONS } from 'config/references'; | ||
|
||
import getBaseExplorerStaticContent, { | ||
STATIC_CONTENT_TYPES, | ||
} from 'modules/BaseExplorer/utils/getBaseExplorerStaticContent'; | ||
import { StaticContentType } from 'modules/BaseExplorer/types'; | ||
|
||
function getImagesExplorerStaticContent( | ||
type: StaticContentType, | ||
): React.ReactNode { | ||
const illustrationContent = getImagesExplorerIllustrationContent(type); | ||
return getBaseExplorerStaticContent(type, illustrationContent); | ||
} | ||
|
||
function getImagesExplorerIllustrationContent( | ||
type: StaticContentType, | ||
): React.ReactNode { | ||
const Never_Executed = ( | ||
<> | ||
It’s super easy to search Aim experiments. Just start typing your query in | ||
the search bar above. | ||
<br /> | ||
Look up | ||
<a | ||
className='qlAnchor' | ||
href={DOCUMENTATIONS.EXPLORERS.SEARCH} | ||
target='_blank' | ||
rel='noreferrer' | ||
> | ||
search docs | ||
</a> | ||
to learn more. | ||
</> | ||
); | ||
const Failed = 'Incorrect Query'; | ||
const Insufficient_Resources = "You don't have any tracked images"; | ||
const Empty = 'No Results'; | ||
const Empty_Bookmarks = "You don't have any saved bookmark"; | ||
|
||
const CONTENT = { | ||
[STATIC_CONTENT_TYPES.Never_Executed]: Never_Executed, | ||
[STATIC_CONTENT_TYPES.Failed]: Failed, | ||
[STATIC_CONTENT_TYPES.Insufficient_Resources]: Insufficient_Resources, | ||
[STATIC_CONTENT_TYPES.Empty]: Empty, | ||
[STATIC_CONTENT_TYPES.Empty_Bookmarks]: Empty_Bookmarks, | ||
}; | ||
return CONTENT[type] || null; | ||
} | ||
|
||
export default getImagesExplorerStaticContent; |
33 changes: 33 additions & 0 deletions
33
src/aimcore/web/ui/src/pages/Explorers/ImagesExplorer/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { isDEVModeOn } from 'config/config'; | ||
|
||
import renderer from 'modules/BaseExplorer'; | ||
import Image from 'modules/BaseExplorer/components/Image'; | ||
|
||
import { SequenceType } from 'types/core/enums'; | ||
|
||
import { getImagesDefaultConfig } from './config'; | ||
|
||
const defaultConfig = getImagesDefaultConfig(); | ||
|
||
export const imagesExplorerConfig = { | ||
name: 'Images Explorer', | ||
sequenceType: SequenceType.Image, | ||
basePath: 'images', | ||
persist: true, | ||
groupings: defaultConfig.groupings, | ||
visualizations: { | ||
vis1: { | ||
component: defaultConfig.Visualizer, | ||
controls: defaultConfig.controls, | ||
box: { | ||
...defaultConfig.box, | ||
component: Image, | ||
}, | ||
}, | ||
}, | ||
getStaticContent: defaultConfig.getStaticContent, | ||
}; | ||
|
||
const ImagesExplorer = renderer(imagesExplorerConfig, isDEVModeOn); | ||
|
||
export default ImagesExplorer; |
Oops, something went wrong.