comparison client/src/components/fairway/AvailableFairwayDepthLNWL.vue @ 4136:630b817d12b3 improvepdf

fairway_availability: offsets relative to svgheight and svgwidth
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 01 Aug 2019 11:22:46 +0200
parents 7a0f56f9d0dd
children 8926fc81e4de
comparison
equal deleted inserted replaced
4135:a6eda41e7724 4136:630b817d12b3
318 } 318 }
319 }, 319 },
320 close() { 320 close() {
321 this.$store.commit("application/paneSetup", "DEFAULT"); 321 this.$store.commit("application/paneSetup", "DEFAULT");
322 }, 322 },
323 getPrintLayout(svgHeight) { 323 getPrintLayout(svgHeight, svgWidth) {
324 return { 324 return {
325 main: { top: 0, right: 20, bottom: 50, left: 20 }, 325 main: {
326 nav: { 326 top: 0,
327 top: svgHeight - 65, 327 right: Math.floor(svgWidth * 0.025),
328 right: 20, 328 bottom: Math.floor(svgHeight * 0.17),
329 bottom: 30, 329 left: Math.floor(svgWidth * 0.025)
330 left: 80
331 } 330 }
332 }; 331 };
333 }, 332 },
334 drawDiagram() { 333 drawDiagram() {
335 const elem = document.querySelector("#" + this.containerId); 334 const elem = document.querySelector("#" + this.containerId);
336 const svgWidth = elem != null ? elem.clientWidth : 0; 335 const svgWidth = elem != null ? elem.clientWidth : 0;
337 const svgHeight = elem != null ? elem.clientHeight : 0; 336 const svgHeight = elem != null ? elem.clientHeight : 0;
338 const layout = this.getPrintLayout(svgHeight); 337 const layout = this.getPrintLayout(svgHeight, svgWidth);
339 const dimensions = this.getDimensions({ 338 const dimensions = this.getDimensions({
340 svgHeight, 339 svgHeight,
341 svgWidth, 340 svgWidth,
342 ...layout 341 ...layout
343 }); 342 });