changeset 3476:cc11f207e060

afd: omit legend generation from CSV. Legend is generated from known inputs
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 27 May 2019 13:10:05 +0200
parents 45104cc6fd50
children 4eefeeae03fc
files client/src/components/fairway/AvailableFairwayDepth.vue
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Mon May 27 12:20:23 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Mon May 27 13:10:05 2019 +0200
@@ -183,9 +183,24 @@
       "from",
       "to",
       "frequency",
-      "legend",
-      "csv"
+      "csv",
+      "depthlimit1",
+      "depthlimit2",
+      "widthlimit1",
+      "widthlimit2"
     ]),
+    legend() {
+      const d = [this.depthlimit1, this.depthlimit2].sort();
+      const w = [this.widthlimit1, this.widthlimit2].sort();
+      const lowerBound = [d[0], w[0]].filter(x => x).join(", ");
+      const upperBound = [d[1], w[1]].filter(x => x).join(", ");
+      return [
+        `>  LDC`,
+        `< ${lowerBound}`,
+        `< ${upperBound}`,
+        `>= ${upperBound}`
+      ];
+    },
     dataLink() {
       return `data:text/csv;charset=utf-8, ${encodeURIComponent(this.csv)}`;
     },