changeset 4888:af38a19f615a

better comments on fairway profile code
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 04 Feb 2020 16:29:49 +0100
parents d5790fcb8df6
children ab6eb160cd29 b2d88c680691
files client/src/components/fairway/Fairwayprofile.vue
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Tue Feb 04 13:29:34 2020 +0100
+++ b/client/src/components/fairway/Fairwayprofile.vue	Tue Feb 04 16:29:49 2020 +0100
@@ -566,6 +566,16 @@
       }
       this.drawFairway({ graph, xScale, yScaleRight, offsetY });
     },
+    /**
+     * Draws Fairway rectangle
+     *
+     * start       end
+     *  ____________
+     * [___________] customDepth | referenceDepth
+     *
+     * Starting point is the 0 line of the diagram
+     *
+     */
     drawFairway({ graph, xScale, yScaleRight, offsetY }) {
       if (this.fairwayData === undefined) {
         return;
@@ -723,6 +733,13 @@
       graph.selectAll(".domain").attr("stroke", "black");
       return { xScale, yScaleRight, graph };
     },
+    /**
+     * Draws a rectangle for the waterlevel
+     * (0,0)        (totalLength,0)
+     *  ____________
+     * [____________]
+     * (0,height)   (totalLength, height)
+     */
     drawWaterlevel({ graph, xScale, yScaleRight, height, offsetY }) {
       let waterArea = d3
         .area()
@@ -742,6 +759,21 @@
         .attr("d", waterArea)
         .attr("transform", `translate(0 ${-offsetY})`);
     },
+    /**
+     *
+     * Draws the ground level
+     *
+     * (x, y + ΔWaterlevel)
+     *
+     * ΔWaterlevel is the difference between the current waterlevel and the reference level
+     *
+     * Is the current level higher as the reference level ΔWaterlevel is positive, which in
+     * turn means that the distance between the surface and the ground is increased.
+     *
+     * Is the current level below the reference level ΔWaterlevel is negative, which in turn means
+     * that the distance between the surface and the ground is decreased.
+     *
+     */
     drawProfile({
       graph,
       xScale,