Mercurial > gemma
comparison client/src/lib/mixins.js @ 4225:92c2f93fef3c
client: pdf-gen: export the selected time-range of diagram on pdf(waterlevels)
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Mon, 19 Aug 2019 12:55:23 +0200 |
parents | 552ea22ed266 |
children | e58affd956c5 |
comparison
equal
deleted
inserted
replaced
4224:bb66e144dece | 4225:92c2f93fef3c |
---|---|
169 const svgHeight = this.millimeter2pixels(height, DPI); | 169 const svgHeight = this.millimeter2pixels(height, DPI); |
170 // draw the diagram in a separated html element to get the full size | 170 // draw the diagram in a separated html element to get the full size |
171 const offScreen = document.querySelector("#offScreen"); | 171 const offScreen = document.querySelector("#offScreen"); |
172 offScreen.style.width = `${svgWidth}px`; | 172 offScreen.style.width = `${svgWidth}px`; |
173 offScreen.style.height = `${svgHeight}px`; | 173 offScreen.style.height = `${svgHeight}px`; |
174 let zoomLevel = this.zoomStore; | |
174 const layout = this.getPrintLayout(svgHeight, svgWidth); | 175 const layout = this.getPrintLayout(svgHeight, svgWidth); |
175 this.renderTo({ | 176 this.renderTo({ |
176 element: offScreen, | 177 element: offScreen, |
177 dimensions: this.getDimensions({ | 178 dimensions: this.getDimensions({ |
178 svgWidth: svgWidth, | 179 svgWidth: svgWidth, |
179 svgHeight: svgHeight, | 180 svgHeight: svgHeight, |
180 ...layout | 181 ...layout |
181 }) | 182 }), |
183 zoomLevel // passing the zoom level to draw the diagram on pdf at this point | |
182 }); | 184 }); |
183 var svg = offScreen.querySelector("svg"); | 185 var svg = offScreen.querySelector("svg"); |
184 if (["topright", "bottomright"].indexOf(position) !== -1) { | 186 if (["topright", "bottomright"].indexOf(position) !== -1) { |
185 x = this.pdf.width - offset.x - width; | 187 x = this.pdf.width - offset.x - width; |
186 } | 188 } |