Skip to content

Commit

Permalink
Merge pull request #806 from neo4j-labs/fix/radar_num_upgrade
Browse files Browse the repository at this point in the history
Fix Radar number NaN High-Low
  • Loading branch information
alfredorubin96 authored Mar 1, 2024
2 parents 80386fa + bb67fc7 commit be5111c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/chart/parameter/component/DateParameterSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const DatePickerParameterSelectComponent = (props: ParameterSelectProps) => {
setInputDate(newValue);

// Check whether the user has inputted a valid year. If not, do not update the parameter.
if (!newValue || isNaN(newValue.$y) || isNaN(newValue.$m) || isNaN(newValue.$d)) {
if (!newValue || Number.isNaN(newValue.$y) || Number.isNaN(newValue.$m) || Number.isNaN(newValue.$d)) {
return;
}
if (newValue == null && clearParameterOnFieldClear) {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/advancedcharts/chart/gauge/GaugeChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const NeoGaugeChart = (props: ChartProps) => {
const chartId = createUUID();
let score = records && records[0] && records[0]._fields && records[0]._fields[0] ? records[0]._fields[0] : '';

if (isNaN(score)) {
if (Number.isNaN(score)) {
return <NoDrawableDataErrorMessage />;
}
if (score.low != undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/advancedcharts/chart/radar/RadarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const NeoRadarChart = (props: ChartProps) => {
const entry = {};
selection.values.concat([selection.index]).forEach((k) => {
const fieldIndex = r._fieldLookup[k];
if (k !== selection.index && isNaN(r._fields[fieldIndex])) {
if (k !== selection.index && Number.isNaN(r._fields[fieldIndex])) {
valid = false;
}
entry[k] = `${r._fields[fieldIndex]}`;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/advancedcharts/chart/sankey/SankeyChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const NeoSankeyChart = (props: ChartProps) => {
properties: value.properties,
value: 1,
});
} else if (value.properties[labelProperty] !== undefined && !isNaN(value.properties[labelProperty])) {
} else if (value.properties[labelProperty] !== undefined && !Number.isNaN(value.properties[labelProperty])) {
addItem(links[`${value.start.low},${value.end.low}`], {
id: value.identity.low,
source: value.start.low,
Expand Down

0 comments on commit be5111c

Please sign in to comment.