From d3b9ebd5d79ca42d816d75bfb4bb19fcb2f1f9a8 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sun, 26 Feb 2017 16:46:41 +0100 Subject: Fix experiment list overflow --- src/styles/main.less | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/styles/main.less b/src/styles/main.less index bb560c5b..ee7e56aa 100644 --- a/src/styles/main.less +++ b/src/styles/main.less @@ -993,6 +993,12 @@ a:hover { font-weight: bold; } + .list-body { + max-height: 200px; + overflow-y: auto; + overflow-x: hidden; + } + .experiment-row { background: #f8f8f8; border: 1px solid #b6b6b6; @@ -1074,7 +1080,7 @@ a:hover { .window-body { width: 100%; - height: 340px; + height: 500px; padding: 10px; -- cgit v1.2.3 From 495deb1815b465230d0831d0132e85ba207ac528 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sun, 26 Feb 2017 16:47:07 +0100 Subject: Fix chart handling of time values above 100s --- src/scripts/controllers/simulation/chart.ts | 4 ++-- src/scripts/util.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/scripts/controllers/simulation/chart.ts b/src/scripts/controllers/simulation/chart.ts index 5f94f412..1b67934b 100644 --- a/src/scripts/controllers/simulation/chart.ts +++ b/src/scripts/controllers/simulation/chart.ts @@ -92,7 +92,7 @@ export class ChartController { return c3.generate({ bindto: chartId, data: { - xFormat: '%S', + // xFormat: '%S', x: "time", columns: this.chartData, names: this.names @@ -141,7 +141,7 @@ export class ChartController { } public update(): void { - this.xSeries = (<(number|string)[]>["time"]).concat(Util.range(this.simulationController.currentTick)); + this.xSeries = (<(number|string)[]>["time"]).concat( Util.timeRange(this.simulationController.currentTick)); this.chartData = [this.xSeries]; diff --git a/src/scripts/util.ts b/src/scripts/util.ts index 7aa615ec..d3a2ea58 100644 --- a/src/scripts/util.ts +++ b/src/scripts/util.ts @@ -599,4 +599,15 @@ export class Util { return i.toString(); }) } + + /** + * Returns an array containing all numbers of a range from 0 to x (including x). + */ + public static timeRange(x: number): Date[] { + return Util.range(x).map((tick: number) => { + const t = new Date(1970, 0, 1); // Epoch + t.setSeconds(tick); + return t; + }); + } } -- cgit v1.2.3