diff --git a/optuna_dashboard/ts/action.ts b/optuna_dashboard/ts/action.ts index 3c8f06b6..10fe43bc 100644 --- a/optuna_dashboard/ts/action.ts +++ b/optuna_dashboard/ts/action.ts @@ -23,7 +23,6 @@ import { reportFeedbackComponentAPI, } from "./apiClient" import { - graphVisibilityState, studyDetailsState, studySummariesState, paramImportanceState, @@ -34,13 +33,6 @@ import { } from "./state" import { getDominatedTrials } from "./dominatedTrials" -const localStorageGraphVisibility = "graphVisibility" -const localStorageReloadInterval = "reloadInterval" - -type LocalStorageReloadInterval = { - reloadInterval?: number -} - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const actionCreator = () => { const { enqueueSnackbar } = useSnackbar() @@ -48,8 +40,6 @@ export const actionCreator = () => { useRecoilState(studySummariesState) const [studyDetails, setStudyDetails] = useRecoilState(studyDetailsState) - const [graphVisibility, setGraphVisibility] = - useRecoilState(graphVisibilityState) const setReloadInterval = useSetRecoilState(reloadIntervalState) const [paramImportance, setParamImportance] = useRecoilState(paramImportanceState) @@ -340,41 +330,8 @@ export const actionCreator = () => { }) } - const getGraphVisibility = () => { - const localStoragePreferences = localStorage.getItem( - localStorageGraphVisibility - ) - if (localStoragePreferences !== null) { - const merged = { - ...graphVisibility, - ...JSON.parse(localStoragePreferences), - } - setGraphVisibility(merged) - } - } - - const saveGraphVisibility = (value: GraphVisibility) => { - setGraphVisibility(value) - localStorage.setItem(localStorageGraphVisibility, JSON.stringify(value)) - } - - const loadReloadInterval = () => { - const reloadIntervalJSON = localStorage.getItem(localStorageReloadInterval) - if (reloadIntervalJSON === null) { - return - } - const gp = JSON.parse(reloadIntervalJSON) as LocalStorageReloadInterval - if (gp.reloadInterval !== undefined) { - setReloadInterval(gp.reloadInterval) - } - } - const saveReloadInterval = (interval: number) => { setReloadInterval(interval) - const value: LocalStorageReloadInterval = { - reloadInterval: interval, - } - localStorage.setItem(localStorageReloadInterval, JSON.stringify(value)) } const saveStudyNote = (studyId: number, note: Note): Promise => { @@ -749,9 +706,6 @@ export const actionCreator = () => { createNewStudy, deleteStudy, renameStudy, - getGraphVisibility, - saveGraphVisibility, - loadReloadInterval, saveReloadInterval, saveStudyNote, saveTrialNote, diff --git a/optuna_dashboard/ts/components/StudyDetail.tsx b/optuna_dashboard/ts/components/StudyDetail.tsx index 79702f2e..2f56ec8b 100644 --- a/optuna_dashboard/ts/components/StudyDetail.tsx +++ b/optuna_dashboard/ts/components/StudyDetail.tsx @@ -62,7 +62,6 @@ export const StudyDetail: FC<{ studyName !== null ? `${studyName} (id=${studyId})` : `Study #${studyId}` useEffect(() => { - action.loadReloadInterval() action.updateStudyDetail(studyId) action.updateAPIMeta() }, []) diff --git a/optuna_dashboard/ts/state.ts b/optuna_dashboard/ts/state.ts index 94e8d2d7..b1f60654 100644 --- a/optuna_dashboard/ts/state.ts +++ b/optuna_dashboard/ts/state.ts @@ -22,20 +22,7 @@ export const paramImportanceState = atom({ default: {}, }) -export const graphVisibilityState = atom({ - key: "graphVisibility", - default: { - history: true, - paretoFront: true, - parallelCoordinate: true, - intermediateValues: true, - edf: true, - contour: true, - importances: true, - slice: true, - }, -}) - +// TODO(c-bata): Consider representing the state as boolean. export const reloadIntervalState = atom({ key: "reloadInterval", default: 10,