issue #977 [object Object] in slice xaxis

This commit is contained in:
wassname
2024-10-06 14:15:43 +08:00
parent 81fa76b3de
commit 3100f9ac42
5 changed files with 28 additions and 5 deletions
+1
View File
@@ -2,6 +2,7 @@
*.pyc
__pycache__/
venv/
.venv/
.eggs/
*.egg-info
dist/
+22
View File
@@ -0,0 +1,22 @@
# https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
```sh
nvm install 16
nvm use 16
# in one terminal
cd optuna_dashboard/
npm i
npm run watch
# npm install -g wasm-pack
# sudo apt install rustup
# rustup default stable
# make serve-browser-app
# in another terminal python
python3 -m venv .venv --prompt optunadashboard
. ./.venv/bin/activate
pip install -e .
OPTUNA_DASHBOARD_DEBUG=1 optuna-dashboard sqlite:///optuna3.db --port=8089
```
+1 -1
View File
@@ -45,7 +45,7 @@ const getAxisInfoForCategoricalParams = (
)
const indices = distribution.choices
.map((c) => c?.toString() ?? "null")
.map((c) => c?.value?.toString() ?? "null")
.sort((a, b) =>
a.toLowerCase() < b.toLowerCase()
? -1
+3 -3
View File
@@ -222,10 +222,10 @@ const plotSlice = (
)
const feasibleValues = feasibleTrials.map(
(t) => selectedParamTarget.getTargetValue(t) as number
(t) => selectedParamTarget.getTargetValue(t) as string | number
)
const infeasibleValues = infeasibleTrials.map(
(t) => selectedParamTarget.getTargetValue(t) as number
(t) => selectedParamTarget.getTargetValue(t) as string | number
)
const trace: plotly.Data[] = [
{
@@ -268,7 +268,7 @@ const plotSlice = (
}
} else {
const vocabArr = selectedParamSpace.distribution.choices.map(
(c) => c?.toString() ?? "null"
(c) => c?.value?.toString() ?? "null"
)
const tickvals: number[] = vocabArr.map((_v, i) => i)
layout.xaxis = {
+1 -1
View File
@@ -78,7 +78,7 @@ export const TrialTable: FC<{
const sortable = s.distribution.type !== "CategoricalDistribution"
const filterChoices: (string | null)[] | undefined =
s.distribution.type === "CategoricalDistribution"
? s.distribution.choices.map((c) => c?.toString() ?? "null")
? s.distribution.choices.map((c) => c?.value?.toString() ?? "null")
: undefined
const hasMissingValue = trials.some(
(t) => !t.params.some((p) => p.name === s.name)