changeset 4672:c7dc1a6da93d

fairway_profile: calculate scales
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 15 Oct 2019 15:55:12 +0200
parents 0cc339c4c356
children 443867b548b5
files client/src/components/fairway/Fairwayprofile.vue
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Tue Oct 15 15:44:07 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Tue Oct 15 15:55:12 2019 +0200
@@ -528,8 +528,7 @@
       let yScaleRight = d3
         .scaleLinear()
         .domain([
-          this.maxAlt * 1.1 +
-            Math.abs(this.waterlevel - this.refWaterlevel) / 100,
+          this.maxAlt * 1.1 + (this.waterlevel - this.refWaterlevel) / 100,
           -(this.maxAlt * 0.1)
         ])
         .rangeRound([height, 0]);
@@ -538,8 +537,7 @@
         .scaleLinear()
         .domain([
           this.waterlevel -
-            (this.maxAlt * 100 +
-              Math.abs(this.waterlevel - this.refWaterlevel)),
+            (this.maxAlt * 100 + (this.waterlevel - this.refWaterlevel)),
           this.waterlevel + this.maxAlt * 0.1 * 100
         ])
         .rangeRound([height, 0]);