From 48844ccd91090bcbc0a9f05af19b6bc7ea616027 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 25 Aug 2023 14:40:04 -0400 Subject: [PATCH] [ALS-4954] Fix continuous visualizations not showing bar when all values are the same (#136) * [ALS-4771] Add common area UUID to query - When the GIC common area makes a federated query request to the institute nodes, it passes a UUID for the query - This UUID is to be used in later development as a unifying, interinstitutional identifier for stuff like data sharing - Add query UUID to QueryRequest - Make QueryRequest ignore unknown fields for backwards compatability - Add UUID to query meta in passthrough - Sanity test for missing UUID jackson stuff * If keys are the same return 1 not 0 --- .../resource/visualization/service/DataProcessingService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pic-sure-resources/pic-sure-visualization-resource/src/main/java/edu/harvard/hms/dbmi/avillach/resource/visualization/service/DataProcessingService.java b/pic-sure-resources/pic-sure-visualization-resource/src/main/java/edu/harvard/hms/dbmi/avillach/resource/visualization/service/DataProcessingService.java index 43f99baa..2dc36ade 100644 --- a/pic-sure-resources/pic-sure-visualization-resource/src/main/java/edu/harvard/hms/dbmi/avillach/resource/visualization/service/DataProcessingService.java +++ b/pic-sure-resources/pic-sure-visualization-resource/src/main/java/edu/harvard/hms/dbmi/avillach/resource/visualization/service/DataProcessingService.java @@ -126,6 +126,7 @@ private static int calcNumBins(Map countMap) { DescriptiveStatistics da = new DescriptiveStatistics(keys); double smallestKey = da.getMin(); double largestKey = da.getMax(); + if (smallestKey == largestKey) return 1; double binWidth = (3.5 * da.getStandardDeviation()) / Math.pow(countMap.size(),THIRD); return (int)Math.round((largestKey - smallestKey) / binWidth); }