Mercurial > gemma
comparison client/src/components/fairway/Fairwayprofile.vue @ 4017:639bdb17c3f2
Fixed offset for fairway box
This was broken by
changeset: 4080:bf86f9a08733
user: Thomas Junk <thomas.junk@intevation.de>
Date: Thu Jul 18 15:04:30 2019 +0200
summary: improve fairwaydiagram printing positioning
For the record: I think the current implementation exceptionally
flawed. Instead of adding extra offset parameters to the diagram
elements the whole building block with all contained elements should
be translated in one step, that would be less cluttered and less error
prone...
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 19 Jul 2019 16:59:25 +0200 |
parents | bf86f9a08733 |
children | a41fd26c1644 |
comparison
equal
deleted
inserted
replaced
4016:9ab7e1056360 | 4017:639bdb17c3f2 |
---|---|
447 strokeColor: "#943007", | 447 strokeColor: "#943007", |
448 opacity: 0.6, | 448 opacity: 0.6, |
449 offsetY | 449 offsetY |
450 }); | 450 }); |
451 } | 451 } |
452 this.drawFairway({ graph, xScale, yScaleRight }); | 452 this.drawFairway({ graph, xScale, yScaleRight, offsetY }); |
453 }, | 453 }, |
454 drawFairway({ graph, xScale, yScaleRight }) { | 454 drawFairway({ graph, xScale, yScaleRight, offsetY }) { |
455 if (this.fairwayData === undefined) { | 455 if (this.fairwayData === undefined) { |
456 return; | 456 return; |
457 } | 457 } |
458 for (let data of this.fairwayData) { | 458 for (let data of this.fairwayData) { |
459 data.coordinates.forEach(coordinates => { | 459 data.coordinates.forEach(coordinates => { |
489 }) | 489 }) |
490 .join("")}` | 490 .join("")}` |
491 ) | 491 ) |
492 .attr("stroke-opacity", this.getLayerStyle(data.los).strokeOpacity) | 492 .attr("stroke-opacity", this.getLayerStyle(data.los).strokeOpacity) |
493 .attr("stroke-dasharray", this.getLayerStyle(data.los).strokeDash) | 493 .attr("stroke-dasharray", this.getLayerStyle(data.los).strokeDash) |
494 .attr("d", fairwayArea); | 494 .attr("d", fairwayArea) |
495 .attr("transform", `translate(0 ${-offsetY})`); | |
495 }); | 496 }); |
496 } | 497 } |
497 }, | 498 }, |
498 drawLabels({ graph, dimensions }) { | 499 drawLabels({ graph, dimensions }) { |
499 graph | 500 graph |