diff --git a/optuna_dashboard/ts/components/AppDrawer.tsx b/optuna_dashboard/ts/components/AppDrawer.tsx index 79f7d615..0903d72b 100644 --- a/optuna_dashboard/ts/components/AppDrawer.tsx +++ b/optuna_dashboard/ts/components/AppDrawer.tsx @@ -204,21 +204,19 @@ export const AppDrawer: FC<{ /> - {!isPreferential && ( - - - - - - - - - )} + + + + + + + + [] = [ - { - type: "contour", - x: xIndices, - y: yIndices, - z: zValues, - colorscale: "Blues", - connectgaps: true, - hoverinfo: "none", - line: { - smoothing: 1.3, - }, - reversescale: study.directions[objectiveId] !== "minimize", - // https://github.com/plotly/react-plotly.js/issues/251 - // @ts-ignore - contours: { - coloring: "heatmap", - }, - }, + study.is_preferential + ? {} + : { + type: "contour", + x: xIndices, + y: yIndices, + z: zValues, + colorscale: "Blues", + connectgaps: true, + hoverinfo: "none", + line: { + smoothing: 1.3, + }, + reversescale: study.directions[objectiveId] !== "minimize", + // https://github.com/plotly/react-plotly.js/issues/251 + // @ts-ignore + contours: { + coloring: "heatmap", + }, + }, { type: "scatter", x: xValues, diff --git a/optuna_dashboard/ts/components/PreferentialAnalytics.tsx b/optuna_dashboard/ts/components/PreferentialAnalytics.tsx new file mode 100644 index 00000000..d8623f97 --- /dev/null +++ b/optuna_dashboard/ts/components/PreferentialAnalytics.tsx @@ -0,0 +1,68 @@ +import React, { FC } from "react" +import { + Box, + Card, + CardContent, + Paper, + Typography, + useTheme, +} from "@mui/material" +import Grid2 from "@mui/material/Unstable_Grid2" +import { DataGrid, DataGridColumn } from "./DataGrid" +import { BestTrialsCard } from "./BestTrialsCard" +import { useStudyDetailValue, useStudySummaryValue } from "../state" +import { Contour } from "./GraphContour" + +export const PreferentialAnalytics: FC<{ studyId: number }> = ({ studyId }) => { + const theme = useTheme() + const studySummary = useStudySummaryValue(studyId) + const studyDetail = useStudyDetailValue(studyId) + + const userAttrs = studySummary?.user_attrs || studyDetail?.user_attrs || [] + const userAttrColumns: DataGridColumn[] = [ + { field: "key", label: "Key", sortable: true }, + { field: "value", label: "Value", sortable: true }, + ] + return ( + + + + + + + + + + + + + + + Study User Attributes + + + columns={userAttrColumns} + rows={userAttrs} + keyField={"key"} + dense={true} + initialRowsPerPage={5} + rowsPerPageOption={[5, 10, { label: "All", value: -1 }]} + /> + + + + + + ) +} diff --git a/optuna_dashboard/ts/components/StudyDetail.tsx b/optuna_dashboard/ts/components/StudyDetail.tsx index 738166b5..fedfd625 100644 --- a/optuna_dashboard/ts/components/StudyDetail.tsx +++ b/optuna_dashboard/ts/components/StudyDetail.tsx @@ -30,6 +30,7 @@ import { GraphEdf } from "./GraphEdf" import { TrialList } from "./TrialList" import { StudyHistory } from "./StudyHistory" import { PreferentialTrials } from "./PreferentialTrials" +import { PreferentialAnalytics } from "./PreferentialAnalytics" interface ParamTypes { studyId: string @@ -98,7 +99,9 @@ export const StudyDetail: FC<{ ) } else if (page === "analytics") { - content = ( + content = isPreferential ? ( + + ) : ( Hyperparameter Relationships