Mercurial > gemma
comparison 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 |
comparison
equal
deleted
inserted
replaced
4655:1e96ff2da1f3 | 4657:a89e4db7980b |
---|---|
642 .line() | 642 .line() |
643 .x(d => { | 643 .x(d => { |
644 return xScale(d.x); | 644 return xScale(d.x); |
645 }) | 645 }) |
646 .y(d => | 646 .y(d => |
647 yScaleRight( | 647 yScaleRight(d.y + this.waterlevel - this.refWaterlevel / 100) |
648 d.y + Math.abs(this.waterlevel - this.refWaterlevel) / 100 | |
649 ) | |
650 ); | 648 ); |
651 let profileArea = d3 | 649 let profileArea = d3 |
652 .area() | 650 .area() |
653 .x(function(d) { | 651 .x(function(d) { |
654 return xScale(d.x); | 652 return xScale(d.x); |
655 }) | 653 }) |
656 .y0(height) | 654 .y0(height) |
657 .y1(d => | 655 .y1(d => |
658 yScaleRight( | 656 yScaleRight(d.y + (this.waterlevel - this.refWaterlevel) / 100) |
659 d.y + Math.abs(this.waterlevel - this.refWaterlevel) / 100 | |
660 ) | |
661 ); | 657 ); |
662 graph | 658 graph |
663 .append("path") | 659 .append("path") |
664 .datum(part) | 660 .datum(part) |
665 .attr("fill", color) | 661 .attr("fill", color) |