mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Move GraphComponentState type into tslib/react
This commit is contained in:
@@ -10,6 +10,7 @@ lerna-debug.log*
|
||||
node_modules
|
||||
pkg
|
||||
types
|
||||
!src/types
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Box, Typography, useTheme } from "@mui/material"
|
||||
import * as Optuna from "@optuna/types"
|
||||
import { FC } from "react"
|
||||
import { GraphComponentState } from "../types"
|
||||
|
||||
export const GraphContainer: FC<{
|
||||
plotDomId: string
|
||||
graphComponentState: Optuna.GraphComponentState
|
||||
graphComponentState: GraphComponentState
|
||||
}> = ({ plotDomId, graphComponentState }) => {
|
||||
const theme = useTheme()
|
||||
return (
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as Optuna from "@optuna/types"
|
||||
import { useEffect, useState } from "react"
|
||||
import { GraphComponentState } from "../types"
|
||||
|
||||
export const useGraphComponentState = () => {
|
||||
const [graphComponentState, setGraphComponentState] =
|
||||
useState<Optuna.GraphComponentState>("componentWillMount")
|
||||
useState<GraphComponentState>("componentWillMount")
|
||||
useEffect(() => {
|
||||
setGraphComponentState("componentDidMount")
|
||||
}, [])
|
||||
|
||||
@@ -17,3 +17,4 @@ export {
|
||||
useObjectiveAndUserAttrTargets,
|
||||
useObjectiveAndUserAttrTargetsFromStudies,
|
||||
} from "./utils/trialFilter"
|
||||
export type { GraphComponentState } from "./types"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export type GraphComponentState =
|
||||
| "componentWillMount"
|
||||
| "componentDidMount"
|
||||
| "graphDidRender"
|
||||
@@ -93,8 +93,3 @@ export type ParamImportance = {
|
||||
name: string
|
||||
importance: number
|
||||
}
|
||||
|
||||
export type GraphComponentState =
|
||||
| "componentWillMount"
|
||||
| "componentDidMount"
|
||||
| "graphDidRender"
|
||||
|
||||
Reference in New Issue
Block a user