Mercurial > gemma
diff client/src/lib/mixins.js @ 3936:d859ec6cf2f0
Fairwayprofile enhanced
Added getDimensions to mixins.
Use getDimensions to render fairwayprofile.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 12 Jul 2019 09:55:03 +0200 |
parents | 2c9e96b02573 |
children | 7b3935a8d9ee |
line wrap: on
line diff
--- a/client/src/lib/mixins.js Thu Jul 11 19:21:12 2019 +0200 +++ b/client/src/lib/mixins.js Fri Jul 12 09:55:03 2019 +0200 @@ -37,12 +37,13 @@ export const diagram = { methods: { - getDimensions({ main, nav }) { - //dimensions and margins - const elem = document.querySelector("#" + this.containerId); - const svgWidth = elem != null ? elem.clientWidth : 0; - const svgHeight = elem != null ? elem.clientHeight : 0; - const mainMargin = main || { top: 20, right: 20, bottom: 110, left: 80 }; + getDimensions({ svgWidth, svgHeight, main, nav }) { + const mainMargin = main || { + top: 20, + right: 80, + bottom: 60, + left: 80 + }; const navMargin = nav || { top: svgHeight - mainMargin.top - 65, right: 20,