mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-23 13:30:25 +08:00
Correctly recognizing numbers
This commit is contained in:
@@ -30,6 +30,7 @@ const plotCoordinate = (trials: Trial[], objectiveId: number) => {
|
||||
plotly.react(plotDomId, [])
|
||||
return
|
||||
}
|
||||
|
||||
const filteredTrials = trials.filter(
|
||||
(t) => t.state === "Complete" || t.state === "Pruned"
|
||||
)
|
||||
@@ -63,7 +64,7 @@ const plotCoordinate = (trials: Trial[], objectiveId: number) => {
|
||||
return param!.value
|
||||
})
|
||||
const isnum = valueStrings.every((v) => {
|
||||
return /^-?\d+\.\d+$/.test(v)
|
||||
return !isNaN(parseFloat(v))
|
||||
})
|
||||
if (isnum) {
|
||||
const values: number[] = valueStrings.map((v) => parseFloat(v))
|
||||
|
||||
Reference in New Issue
Block a user