Skip to content

Commit 19b7538

Browse files
authored
Merge branch 'develop' into fix/parsing-number
2 parents d2729d7 + 31dea05 commit 19b7538

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/chart/graph/util/RecordUtils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { evaluateRulesOnNode, evaluateRulesOnLink } from '../../../extensions/styling/StyleRuleEvaluator';
22
import { extractNodePropertiesFromRecords, mergeNodePropsFieldsLists } from '../../../report/ReportRecordProcessing';
3-
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath } from '../../ChartUtils';
3+
import { valueIsArray, valueIsNode, valueIsRelationship, valueIsPath, toNumber } from '../../ChartUtils';
44
import { GraphChartVisualizationProps } from '../GraphChartVisualization';
55
import { assignCurvatureToLink } from './RelUtils';
66
import { isNode } from 'neo4j-driver-core/lib/graph-types.js';
@@ -49,7 +49,9 @@ function extractGraphEntitiesFromField(
4949
nodes[value.identity.low] = {
5050
id: value.identity.low,
5151
labels: value.labels,
52-
size: value.properties[nodeSizeProperty] ? value.properties[nodeSizeProperty] : defaultNodeSize,
52+
size: !Number.isNaN(value.properties[nodeSizeProperty])
53+
? toNumber(value.properties[nodeSizeProperty])
54+
: defaultNodeSize,
5355
properties: value.properties,
5456
mainLabel: value.labels[value.labels.length - 1],
5557
};
@@ -67,7 +69,9 @@ function extractGraphEntitiesFromField(
6769
source: value.start.low,
6870
target: value.end.low,
6971
type: value.type,
70-
width: value.properties[relWidthProperty] ? value.properties[relWidthProperty] : defaultRelWidth,
72+
width: !Number.isNaN(value.properties[relWidthProperty])
73+
? toNumber(value.properties[relWidthProperty])
74+
: defaultRelWidth,
7175
color: value.properties[relColorProperty] ? value.properties[relColorProperty] : defaultRelColor,
7276
properties: value.properties,
7377
});

src/chart/parameter/component/DateParameterSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const DatePickerParameterSelectComponent = (props: ParameterSelectProps) => {
5555
setInputDate(newValue);
5656

5757
// Check whether the user has inputted a valid year. If not, do not update the parameter.
58-
if (!newValue || isNaN(newValue.$y) || isNaN(newValue.$m) || isNaN(newValue.$d)) {
58+
if (!newValue || Number.isNaN(newValue.$y) || Number.isNaN(newValue.$m) || Number.isNaN(newValue.$d)) {
5959
return;
6060
}
6161
if (newValue == null && clearParameterOnFieldClear) {

src/extensions/advancedcharts/chart/gauge/GaugeChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const NeoGaugeChart = (props: ChartProps) => {
4242
const chartId = createUUID();
4343
let score = records && records[0] && records[0]._fields && records[0]._fields[0] ? records[0]._fields[0] : '';
4444

45-
if (isNaN(score)) {
45+
if (Number.isNaN(score)) {
4646
return <NoDrawableDataErrorMessage />;
4747
}
4848
if (score.low != undefined) {

src/extensions/advancedcharts/chart/radar/RadarChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const NeoRadarChart = (props: ChartProps) => {
6767
const entry = {};
6868
selection.values.concat([selection.index]).forEach((k) => {
6969
const fieldIndex = r._fieldLookup[k];
70-
if (k !== selection.index && isNaN(r._fields[fieldIndex])) {
70+
if (k !== selection.index && Number.isNaN(r._fields[fieldIndex])) {
7171
valid = false;
7272
}
7373
entry[k] = `${r._fields[fieldIndex]}`;

src/extensions/advancedcharts/chart/sankey/SankeyChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const NeoSankeyChart = (props: ChartProps) => {
8686
properties: value.properties,
8787
value: 1,
8888
});
89-
} else if (value.properties[labelProperty] !== undefined && !isNaN(value.properties[labelProperty])) {
89+
} else if (value.properties[labelProperty] !== undefined && !Number.isNaN(value.properties[labelProperty])) {
9090
addItem(links[`${value.start.low},${value.end.low}`], {
9191
id: value.identity.low,
9292
source: value.start.low,

0 commit comments

Comments
 (0)