diff options
| author | Georgios Andreadis <G.Andreadis@student.tudelft.nl> | 2017-02-26 18:34:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-26 18:34:13 +0100 |
| commit | df65449694e17a367e59b112c0cc12d66c387ca9 (patch) | |
| tree | 6a2589cb5cdc86bdcfe47f4b399f385c6a5ecbc7 | |
| parent | 30fb1767715f347246368b7f2462ccfae9413330 (diff) | |
| parent | 495deb1815b465230d0831d0132e85ba207ac528 (diff) | |
Merge pull request #6 from tudelft-atlarge/bugfixes
Fixes for bugs in experiment simulation
| -rw-r--r-- | src/scripts/controllers/simulation/chart.ts | 4 | ||||
| -rw-r--r-- | src/scripts/util.ts | 11 | ||||
| -rw-r--r-- | src/styles/main.less | 8 |
3 files changed, 20 insertions, 3 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(<any[]> 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; + }); + } } 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; |
