mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-17 12:30:35 +08:00
Implement API
This commit is contained in:
@@ -271,6 +271,14 @@ def create_app(
|
||||
)
|
||||
if plot_type == "contour":
|
||||
fig = optuna.visualization.plot_contour(study)
|
||||
elif plot_type == "slice":
|
||||
fig = optuna.visualization.plot_slice(study)
|
||||
elif plot_type == "parallel_coordinate":
|
||||
fig = optuna.visualization.plot_parallel_coordinate(study)
|
||||
elif plot_type == "rank":
|
||||
fig = optuna.visualization.plot_rank(study)
|
||||
elif plot_type == "edf":
|
||||
fig = optuna.visualization.plot_edf(study)
|
||||
else:
|
||||
response.status = 404 # Not found
|
||||
return {"reason": f"plot_type={plot_type} is not supported."}
|
||||
|
||||
@@ -448,6 +448,10 @@ type PlotResponse = {
|
||||
}
|
||||
export enum PlotType {
|
||||
Contour = "contour",
|
||||
Slice = "slice",
|
||||
ParallelCoordinate = "parallel_coordinate",
|
||||
Rank = "rank",
|
||||
EDF = "edf",
|
||||
}
|
||||
export const getPlotAPI = (
|
||||
studyId: number,
|
||||
|
||||
Reference in New Issue
Block a user