From 0d5db75167e215c7dd69a63751200eba8a022ab5 Mon Sep 17 00:00:00 2001 From: gen740 Date: Thu, 28 Dec 2023 16:03:37 +0900 Subject: [PATCH] Rename PlotlyDarkTheme to PlotlyCloroTemplates --- optuna_dashboard/ts/components/GraphContour.tsx | 2 +- optuna_dashboard/ts/components/GraphEdf.tsx | 2 +- optuna_dashboard/ts/components/GraphHistory.tsx | 2 +- .../ts/components/GraphHyperparameterImportances.tsx | 2 +- optuna_dashboard/ts/components/GraphIntermediateValues.tsx | 2 +- optuna_dashboard/ts/components/GraphParallelCoordinate.tsx | 2 +- optuna_dashboard/ts/components/GraphParetoFront.tsx | 2 +- optuna_dashboard/ts/components/GraphRank.tsx | 2 +- optuna_dashboard/ts/components/GraphSlice.tsx | 2 +- optuna_dashboard/ts/components/GraphTimeline.tsx | 2 +- .../components/{PlotlyDarkMode.ts => PlotlyColorTemplates.ts} | 1 - 11 files changed, 10 insertions(+), 11 deletions(-) rename optuna_dashboard/ts/components/{PlotlyDarkMode.ts => PlotlyColorTemplates.ts} (99%) diff --git a/optuna_dashboard/ts/components/GraphContour.tsx b/optuna_dashboard/ts/components/GraphContour.tsx index 2dae2740..b0d546fa 100644 --- a/optuna_dashboard/ts/components/GraphContour.tsx +++ b/optuna_dashboard/ts/components/GraphContour.tsx @@ -13,7 +13,7 @@ import { } from "@mui/material" import blue from "@mui/material/colors/blue" import { useMergedUnionSearchSpace } from "../searchSpace" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { useRecoilValue } from "recoil" import { plotlyColorTheme } from "../state" import { getAxisInfo } from "../graphUtil" diff --git a/optuna_dashboard/ts/components/GraphEdf.tsx b/optuna_dashboard/ts/components/GraphEdf.tsx index f2e5de2b..764d88f2 100644 --- a/optuna_dashboard/ts/components/GraphEdf.tsx +++ b/optuna_dashboard/ts/components/GraphEdf.tsx @@ -2,7 +2,7 @@ import * as plotly from "plotly.js-dist-min" import React, { FC, useEffect, useMemo } from "react" import { Typography, useTheme, Box } from "@mui/material" import { Target, useFilteredTrialsFromStudies } from "../trialFilter" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphHistory.tsx b/optuna_dashboard/ts/components/GraphHistory.tsx index fada5c0b..9f58d63d 100644 --- a/optuna_dashboard/ts/components/GraphHistory.tsx +++ b/optuna_dashboard/ts/components/GraphHistory.tsx @@ -20,7 +20,7 @@ import { Target, useObjectiveAndUserAttrTargetsFromStudies, } from "../trialFilter" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphHyperparameterImportances.tsx b/optuna_dashboard/ts/components/GraphHyperparameterImportances.tsx index 9c63099b..22164960 100644 --- a/optuna_dashboard/ts/components/GraphHyperparameterImportances.tsx +++ b/optuna_dashboard/ts/components/GraphHyperparameterImportances.tsx @@ -5,7 +5,7 @@ import { Typography, useTheme, Box, Card, CardContent } from "@mui/material" import { actionCreator } from "../action" import { useParamImportanceValue, useStudyDirections } from "../state" const plotDomId = "graph-hyperparameter-importances" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphIntermediateValues.tsx b/optuna_dashboard/ts/components/GraphIntermediateValues.tsx index 6c4b229d..4982f405 100644 --- a/optuna_dashboard/ts/components/GraphIntermediateValues.tsx +++ b/optuna_dashboard/ts/components/GraphIntermediateValues.tsx @@ -1,7 +1,7 @@ import * as plotly from "plotly.js-dist-min" import React, { FC, useEffect } from "react" import { Box, Typography, useTheme, CardContent, Card } from "@mui/material" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphParallelCoordinate.tsx b/optuna_dashboard/ts/components/GraphParallelCoordinate.tsx index c887f824..15a9e0ec 100644 --- a/optuna_dashboard/ts/components/GraphParallelCoordinate.tsx +++ b/optuna_dashboard/ts/components/GraphParallelCoordinate.tsx @@ -9,7 +9,7 @@ import { FormControlLabel, Checkbox, } from "@mui/material" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { useRecoilValue } from "recoil" import { plotlyColorTheme } from "../state" import { diff --git a/optuna_dashboard/ts/components/GraphParetoFront.tsx b/optuna_dashboard/ts/components/GraphParetoFront.tsx index 41cdb7b9..99531c18 100644 --- a/optuna_dashboard/ts/components/GraphParetoFront.tsx +++ b/optuna_dashboard/ts/components/GraphParetoFront.tsx @@ -12,7 +12,7 @@ import { Box, } from "@mui/material" import { makeHovertext } from "../graphUtil" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphRank.tsx b/optuna_dashboard/ts/components/GraphRank.tsx index 278e8403..9cffa42e 100644 --- a/optuna_dashboard/ts/components/GraphRank.tsx +++ b/optuna_dashboard/ts/components/GraphRank.tsx @@ -13,7 +13,7 @@ import { } from "@mui/material" import { getAxisInfo, makeHovertext } from "../graphUtil" import { useMergedUnionSearchSpace } from "../searchSpace" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphSlice.tsx b/optuna_dashboard/ts/components/GraphSlice.tsx index 30c2cf48..44c30e23 100644 --- a/optuna_dashboard/ts/components/GraphSlice.tsx +++ b/optuna_dashboard/ts/components/GraphSlice.tsx @@ -19,7 +19,7 @@ import { useParamTargets, } from "../trialFilter" import { useMergedUnionSearchSpace } from "../searchSpace" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/GraphTimeline.tsx b/optuna_dashboard/ts/components/GraphTimeline.tsx index 2bc32efb..2b1192aa 100644 --- a/optuna_dashboard/ts/components/GraphTimeline.tsx +++ b/optuna_dashboard/ts/components/GraphTimeline.tsx @@ -2,7 +2,7 @@ import * as plotly from "plotly.js-dist-min" import React, { FC, useEffect } from "react" import { Card, CardContent, Grid, Typography, useTheme } from "@mui/material" import { makeHovertext } from "../graphUtil" -import { getColorTemplate } from "./PlotlyDarkMode" +import { getColorTemplate } from "./PlotlyColorTemplates" import { plotlyColorTheme } from "../state" import { useRecoilValue } from "recoil" diff --git a/optuna_dashboard/ts/components/PlotlyDarkMode.ts b/optuna_dashboard/ts/components/PlotlyColorTemplates.ts similarity index 99% rename from optuna_dashboard/ts/components/PlotlyDarkMode.ts rename to optuna_dashboard/ts/components/PlotlyColorTemplates.ts index 3306b620..8b44bbc5 100644 --- a/optuna_dashboard/ts/components/PlotlyDarkMode.ts +++ b/optuna_dashboard/ts/components/PlotlyColorTemplates.ts @@ -3,7 +3,6 @@ import * as plotly from "plotly.js-dist-min" // Following template is extracted from the sdist of plotly Python library. // See https://github.com/plotly/plotly.py/blob/v5.6.0/packages/python/plotly/templategen/__init__.py and // https://github.com/plotly/plotly.py/blob/v5.6.0/packages/python/plotly/templategen/definitions.py - export const getColorTemplate = (mode: string, theme: PlotlyColorTheme): Partial => { console.log("getColorTeplate", mode, theme.dark, theme.light) if (mode === "dark") {