changeset 3068:492c30ca3142

client: diagrams: added watchers to ensure diagram update when data changes
author Markus Kottlaender <markus@intevation.de>
date Wed, 17 Apr 2019 09:46:03 +0200
parents 0ffa9d418959
children 766384d0ed7a
files client/src/components/gauge/HydrologicalConditions.vue client/src/components/gauge/Waterlevel.vue
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/gauge/HydrologicalConditions.vue	Wed Apr 17 09:30:00 2019 +0200
+++ b/client/src/components/gauge/HydrologicalConditions.vue	Wed Apr 17 09:46:03 2019 +0200
@@ -166,6 +166,14 @@
     ]),
     ...mapGetters("gauges", ["selectedGauge"])
   },
+  watch: {
+    longtermWaterlevels() {
+      this.drawDiagram();
+    },
+    yearWaterlevels() {
+      this.drawDiagram();
+    }
+  },
   methods: {
     downloadPDF() {
       var svg = this.svg._groups[0][0].outerHTML;
--- a/client/src/components/gauge/Waterlevel.vue	Wed Apr 17 09:30:00 2019 +0200
+++ b/client/src/components/gauge/Waterlevel.vue	Wed Apr 17 09:46:03 2019 +0200
@@ -188,6 +188,11 @@
       }
     }
   },
+  watch: {
+    waterlevels() {
+      this.drawDiagram();
+    }
+  },
   methods: {
     downloadPDF() {
       var svg = this.$refs.diagramContainer.innerHTML;