Skip to content

Commit

Permalink
Merge pull request optuna#914 from nabenabe0928/feat/add-trial-table-…
Browse files Browse the repository at this point in the history
…artifact-viewer

Add `TableArtifactViewer` for trial
  • Loading branch information
c-bata authored Jul 31, 2024
2 parents 2aee3f8 + 72e9369 commit 75c727f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions optuna_dashboard/ts/components/Artifact/TrialArtifactCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Trial } from "ts/types/optuna"
import { actionCreator } from "../../action"
import { ArtifactCardMedia } from "./ArtifactCardMedia"
import { useDeleteTrialArtifactDialog } from "./DeleteArtifactDialog"
import { isTableArtifact, useTableArtifactModal } from "./TableArtifactViewer"
import {
isThreejsArtifact,
useThreejsArtifactModal,
Expand All @@ -35,6 +36,8 @@ export const TrialArtifactCards: FC<{ trial: Trial }> = ({ trial }) => {
useDeleteTrialArtifactDialog()
const [openThreejsArtifactModal, renderThreejsArtifactModal] =
useThreejsArtifactModal()
const [openTableArtifactModal, renderTableArtifactModal] =
useTableArtifactModal()
const isArtifactModifiable = (trial: Trial) => {
return trial.state === "Running" || trial.state === "Waiting"
}
Expand Down Expand Up @@ -104,6 +107,19 @@ export const TrialArtifactCards: FC<{ trial: Trial }> = ({ trial }) => {
<FullscreenIcon />
</IconButton>
) : null}
{isTableArtifact(artifact) ? (
<IconButton
aria-label="show artifact table"
size="small"
color="inherit"
sx={{ margin: "auto 0" }}
onClick={() => {
openTableArtifactModal(urlPath, artifact)
}}
>
<FullscreenIcon />
</IconButton>
) : null}
{isArtifactModifiable(trial) ? (
<IconButton
aria-label="delete artifact"
Expand Down Expand Up @@ -141,6 +157,7 @@ export const TrialArtifactCards: FC<{ trial: Trial }> = ({ trial }) => {
</Box>
{renderDeleteArtifactDialog()}
{renderThreejsArtifactModal()}
{renderTableArtifactModal()}
</>
)
}
Expand Down

0 comments on commit 75c727f

Please sign in to comment.