Skip to content

Commit

Permalink
replace isNaN check
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Jul 15, 2024
1 parent 6755bb9 commit a2f8907
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Plotly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { store } from './Globals.js'
import * as d3 from 'd3'
import { faWindowRestore } from '@fortawesome/free-solid-svg-icons'
import Vue from 'vue'
import { isNumber } from 'underscore'
const Color = require('color')
Expand Down Expand Up @@ -722,7 +723,8 @@ export default {
}
try {
const val = f(vals)
if (isNaN(val)) {
if (!isNumber(val)) {
console.log(val)
throw new Error('Expression does not result in a number')
} else if (val !== null) {
y.push(val)
Expand Down

0 comments on commit a2f8907

Please sign in to comment.