comparison client/src/lib/mixins.js @ 3235:0c5a28ffe9ee

available_fairway_depth: flexible layouting options
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 10 May 2019 10:49:37 +0200
parents 429e28295902
children 050e72ce5cf7
comparison
equal deleted inserted replaced
3234:22dfaa22e96e 3235:0c5a28ffe9ee
29 } 29 }
30 }; 30 };
31 31
32 export const diagram = { 32 export const diagram = {
33 methods: { 33 methods: {
34 getDimensions() { 34 getDimensions({ main, nav }) {
35 //dimensions and margins 35 //dimensions and margins
36 const svgWidth = document.querySelector("#" + this.containerId) 36 const svgWidth = document.querySelector("#" + this.containerId)
37 .clientWidth; 37 .clientWidth;
38 const svgHeight = document.querySelector("#" + this.containerId) 38 const svgHeight = document.querySelector("#" + this.containerId)
39 .clientHeight; 39 .clientHeight;
40 const mainMargin = { top: 20, right: 20, bottom: 110, left: 80 }; 40 const mainMargin = main || { top: 20, right: 20, bottom: 110, left: 80 };
41 const navMargin = { 41 const navMargin = nav || {
42 top: svgHeight - mainMargin.top - 65, 42 top: svgHeight - mainMargin.top - 65,
43 right: 20, 43 right: 20,
44 bottom: 30, 44 bottom: 30,
45 left: 80 45 left: 80
46 }; 46 };