-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #938 from c-bata/migrate-plot-parallel-coordinate-…
…to-tslib Move parallel coordinate plot to `@optuna/react`
- Loading branch information
Showing
5 changed files
with
394 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
tslib/react/src/components/PlotParallelCoordinate.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { CssBaseline, ThemeProvider } from "@mui/material" | ||
import { Meta, StoryObj } from "@storybook/react" | ||
import React from "react" | ||
import { useMockStudy } from "../MockStudies" | ||
import { darkTheme } from "../styles/darkTheme" | ||
import { lightTheme } from "../styles/lightTheme" | ||
import { PlotParallelCoordinate } from "./PlotParallelCoordinate" | ||
|
||
const meta: Meta<typeof PlotParallelCoordinate> = { | ||
component: PlotParallelCoordinate, | ||
title: "Plot/ParallelCoordinate", | ||
tags: ["autodocs"], | ||
decorators: [ | ||
(Story, storyContext) => { | ||
const { study } = useMockStudy(storyContext.parameters?.studyId) | ||
if (!study) return <p>loading...</p> | ||
return ( | ||
<ThemeProvider theme={storyContext.parameters?.theme}> | ||
<CssBaseline /> | ||
<Story | ||
args={{ | ||
study, | ||
}} | ||
/> | ||
</ThemeProvider> | ||
) | ||
}, | ||
], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof PlotParallelCoordinate> | ||
|
||
export const LightTheme: Story = { | ||
parameters: { | ||
studyId: 1, | ||
theme: lightTheme, | ||
}, | ||
} | ||
|
||
export const DarkTheme: Story = { | ||
parameters: { | ||
studyId: 1, | ||
theme: darkTheme, | ||
}, | ||
} | ||
|
||
// TODO(c-bata): Add a story for multi objective study. | ||
// export const MultiObjective: Story = { | ||
// parameters: { | ||
// ... | ||
// }, | ||
// } |
Oops, something went wrong.