Skip to content

Commit

Permalink
Merge pull request #42 from zchenry/main
Browse files Browse the repository at this point in the history
Correctly recognizing numbers
  • Loading branch information
c-bata authored Feb 27, 2021
2 parents d7337a1 + 945d6ef commit 0e3861c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 0e3861c

Please sign in to comment.