From 8432b6a385604a68617e7cd0a4ddf6bde049c050 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Tue, 5 Apr 2022 15:57:45 -0700 Subject: [PATCH] Small bug fixes Signed-off-by: Mihai Budiu --- bin/upload-data.py | 5 ++++- data/utf16-data.csv | Bin .../java/org/hillview/main/DemoDataCleaner.java | 7 +++++++ web/src/main/webapp/dataViews/axisData.ts | 9 +++++---- web/src/main/webapp/loadView.ts | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) mode change 100755 => 100644 data/utf16-data.csv diff --git a/bin/upload-data.py b/bin/upload-data.py index 591a9ef41..fbd123463 100755 --- a/bin/upload-data.py +++ b/bin/upload-data.py @@ -57,9 +57,12 @@ def main(): " (if relative it is with respect to config.service_folder)") parser.add_argument("-L", "--symlinks", help="Follow symlinks instead of ignoring them", action="store_true") - parser.add_argument("--common", "-s", help="File that is loaded to all machines", action="append") + parser.add_argument("-s", "--common", help="File that is loaded to all machines", action="append") parser.add_argument("files", help="Files to copy", nargs=REMAINDER) args = parser.parse_args() + if args.common is None: + # Why is this happening? + args.common = [] config = get_config(parser, args) folder = args.directory if folder is None: diff --git a/data/utf16-data.csv b/data/utf16-data.csv old mode 100755 new mode 100644 diff --git a/platform/src/main/java/org/hillview/main/DemoDataCleaner.java b/platform/src/main/java/org/hillview/main/DemoDataCleaner.java index aa1ca919b..ae977599c 100644 --- a/platform/src/main/java/org/hillview/main/DemoDataCleaner.java +++ b/platform/src/main/java/org/hillview/main/DemoDataCleaner.java @@ -32,6 +32,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Comparator; +import java.util.HashMap; import java.util.stream.Stream; /** @@ -69,6 +70,12 @@ public static void main(String[] args) throws IOException { ITable tbl = r.load(); assert tbl != null; ITable p = tbl.project(schema); + if (p.getSchema().containsColumnName("Reporting_Airline")) { + // The schema has changed at some point + HashMap h = new HashMap<>(); + h.put("Reporting_Airline", "UniqueCarrier"); + p = p.renameColumns(h); + } String end = filename.replace(prefix, ""); if (end.endsWith(".gz")) diff --git a/web/src/main/webapp/dataViews/axisData.ts b/web/src/main/webapp/dataViews/axisData.ts index e0d6ba1ef..422357f2a 100644 --- a/web/src/main/webapp/dataViews/axisData.ts +++ b/web/src/main/webapp/dataViews/axisData.ts @@ -288,6 +288,7 @@ export class AxisData { } // on vertical axis the direction is swapped const domain = bottom ? [actualMin, actualMax] : [actualMax, actualMin]; + let rotate = AxisDescription.fontSize > 10; switch (this.description.kind) { case "Integer": @@ -296,7 +297,7 @@ export class AxisData { this.scale = d3scaleLinear() .domain(domain) .range([0, pixels]); - this.axis = new AxisDescription(axisCreator(this.scale), 1, false, null); + this.axis = new AxisDescription(axisCreator(this.scale), 1, rotate, null); break; } case "Json": @@ -321,7 +322,7 @@ export class AxisData { const maxLabelWidthInChars = Math.floor( bottom ? maxLabelWidthInPixels / fontWidth : labelRoom / fontWidth); console.assert(maxLabelWidthInChars > 2); - let rotate = false; + rotate = false; for (let i = 0; i < tickCount; i++) { ticks.push((i + adjust) * tickSpan); @@ -361,7 +362,7 @@ export class AxisData { this.scale = d3scaleTime() .domain([minDate, maxDate]) .range([0, pixels]); - this.axis = new AxisDescription(axisCreator(this.scale), 1, false, null); + this.axis = new AxisDescription(axisCreator(this.scale), 1, rotate, null); break; } case "Date": { @@ -370,7 +371,7 @@ export class AxisData { this.scale = d3scaleTime() .domain([minDate, maxDate]) .range([0, pixels]); - this.axis = new AxisDescription(axisCreator(this.scale), 1, false, null); + this.axis = new AxisDescription(axisCreator(this.scale), 1, rotate, null); break; } case "None": diff --git a/web/src/main/webapp/loadView.ts b/web/src/main/webapp/loadView.ts index c9b90a09d..37c242f47 100644 --- a/web/src/main/webapp/loadView.ts +++ b/web/src/main/webapp/loadView.ts @@ -250,7 +250,7 @@ export class LoadView extends RemoteObject implements IDataView { action: () => this.purgeAll(), help: "Purge all data from memory (memoized, root, leaf)" }, { - text: "Toggle privat heatmap threshold", + text: "Toggle private heatmap threshold", action: () => { HeatmapPlot.useConfThreshold = !HeatmapPlot.useConfThreshold; this.page.reportError("Use threshold is " + HeatmapPlot.useConfThreshold);