diff client/src/components/fairway/Fairwayprofile.vue @ 4657:a89e4db7980b

Add delta to reference waterlevel to current depth. If the current waterlevel is at LDC the delta is 0 and the profile is drawn unchanged. If the current waterlevel is higher the delta adds to the measured depth. If the current waterlevel is below the delta subtracts from the measured depth.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 14 Oct 2019 14:44:51 +0200
parents e9a99e81f723
children 0cc339c4c356
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Mon Oct 14 13:17:02 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Mon Oct 14 14:44:51 2019 +0200
@@ -644,9 +644,7 @@
             return xScale(d.x);
           })
           .y(d =>
-            yScaleRight(
-              d.y + Math.abs(this.waterlevel - this.refWaterlevel) / 100
-            )
+            yScaleRight(d.y + this.waterlevel - this.refWaterlevel / 100)
           );
         let profileArea = d3
           .area()
@@ -655,9 +653,7 @@
           })
           .y0(height)
           .y1(d =>
-            yScaleRight(
-              d.y + Math.abs(this.waterlevel - this.refWaterlevel) / 100
-            )
+            yScaleRight(d.y + (this.waterlevel - this.refWaterlevel) / 100)
           );
         graph
           .append("path")