Skip to content

Commit 4617808

Browse files
authored
Merge pull request #442 from DigitalSlideArchive/harden-nans
Harden plotting when some values are NaNs.
2 parents 5f45be4 + 56c3f93 commit 4617808

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

histomicsui/web_client/panels/MetadataPlot.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,16 @@ var MetadataPlot = Panel.extend({
564564
};
565565
plotData.data.forEach((d) => {
566566
const s = plotData.series.s && plotData.series.s.distinct ? plotData.series.s.distinct.indexOf(d[plotData.series.s.index]) : 0;
567+
if (!isFinite(d[plotData.series.y.index]) || (plotData.series.x && !isFinite(d[plotData.series.x.index])) || (plotData.series.r && plotData.series.r === 'number' && !isFinite(d[plotData.series.r.index])) || (plotData.series.c && plotData.series.c === 'number' && !isFinite(d[plotData.series.c.index]))) {
568+
return;
569+
}
567570
if (pv.dd[s] === undefined) {
568571
pv.dd[s] = d;
569572
}
570573
if (plotData.series.x) {
571-
pv.xd[s].push(d[plotData.series.x.index]);
574+
pv.xd[s].push(+d[plotData.series.x.index]);
572575
}
573-
pv.yd[s].push(d[plotData.series.y.index]);
576+
pv.yd[s].push(+d[plotData.series.y.index]);
574577
if (plotData.series.c) {
575578
pv.cd[s].push(d[plotData.series.c.index]);
576579
}

0 commit comments

Comments
 (0)