-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds refresh interval options that match openshift observability dashboard * Show first chart from list, if none selected when user first navigates to bias tab * Use search icon instead of plus for nothing selected empty state * Fix error with calculation of 30 days constant * Deleted charts are removed from session storage
- Loading branch information
1 parent
7cd7cf2
commit 3b82db3
Showing
6 changed files
with
65 additions
and
20 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
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
24 changes: 24 additions & 0 deletions
24
frontend/src/pages/modelServing/screens/metrics/useBiasChartsBrowserStorage.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,24 @@ | ||
import { useParams } from 'react-router-dom'; | ||
import { useBrowserStorage } from '~/components/browserStorage'; | ||
import { BiasMetricConfig } from '~/concepts/explainability/types'; | ||
import { SetBrowserStorageHook } from '~/components/browserStorage/BrowserStorageContext'; | ||
|
||
const SELECTED_CHARTS_STORAGE_KEY_PREFIX = 'odh.dashboard.xai.selected_bias_charts'; | ||
|
||
const useBiasChartsBrowserStorage = (): [ | ||
BiasMetricConfig[], | ||
SetBrowserStorageHook<BiasMetricConfig[]>, | ||
] => { | ||
const { inferenceService } = useParams(); | ||
|
||
const [selectedBiasConfigs, setSelectedBiasConfigs] = useBrowserStorage<BiasMetricConfig[]>( | ||
`${SELECTED_CHARTS_STORAGE_KEY_PREFIX}-${inferenceService}`, | ||
[], | ||
true, | ||
true, | ||
); | ||
|
||
return [selectedBiasConfigs, setSelectedBiasConfigs]; | ||
}; | ||
|
||
export default useBiasChartsBrowserStorage; |
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