Mercurial > gemma
comparison client/src/components/fairway/Fairwayprofile.vue @ 3544:067ad32fba69
client: diagram-template: improve values of template elements
* add default values to template elements to use if some are missing in the template definition
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 31 May 2019 11:08:27 +0200 |
parents | 034657d6604f |
children | 76eafbf0a98d |
comparison
equal
deleted
inserted
replaced
3543:7219f4b097fe | 3544:067ad32fba69 |
---|---|
310 " (" + | 310 " (" + |
311 this.selectedSurvey.date_info + | 311 this.selectedSurvey.date_info + |
312 ")"; | 312 ")"; |
313 this.addDiagramTitle( | 313 this.addDiagramTitle( |
314 e.position, | 314 e.position, |
315 e.offset, | 315 e.offset || defaultOffset, |
316 e.fontsize, | 316 e.fontsize || defaultFontSize, |
317 e.color, | 317 e.color || defaultTextColor, |
318 fairwayInfo | 318 fairwayInfo |
319 ); | 319 ); |
320 break; | 320 break; |
321 } | 321 } |
322 case "image": { | 322 case "image": { |
323 this.addImage( | 323 this.addImage( |
324 e.url, | 324 e.url, |
325 e.format, | 325 e.format || "", |
326 e.position, | 326 e.position, |
327 e.offset || defaultOffset, | 327 e.offset || defaultOffset, |
328 e.width, | 328 e.width || 90, |
329 e.height | 329 e.height || 60 |
330 ); | 330 ); |
331 break; | 331 break; |
332 } | 332 } |
333 case "text": { | 333 case "text": { |
334 this.addText( | 334 this.addText( |
335 e.position, | 335 e.position, |
336 e.offset || defaultOffset, | 336 e.offset || defaultOffset, |
337 e.width || defaultWidth, | 337 e.width || defaultWidth, |
338 e.fontsize || defaultFontSize, | 338 e.fontsize || defaultFontSize, |
339 e.color || defaultTextColor, | 339 e.color || defaultTextColor, |
340 e.text | 340 e.text || "" |
341 ); | 341 ); |
342 break; | 342 break; |
343 } | 343 } |
344 case "box": { | 344 case "box": { |
345 this.addBox( | 345 this.addBox( |
346 e.position, | 346 e.position, |
347 e.offset, | 347 e.offset || defaultOffset, |
348 e.width, | 348 e.width || 90, |
349 e.height, | 349 e.height || 60, |
350 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, | 350 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, |
351 e.color || defaultBgColor, | 351 e.color || defaultBgColor, |
352 e.brcolor || defaultBorderColor | 352 e.brcolor || defaultBorderColor |
353 ); | 353 ); |
354 break; | 354 break; |
362 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, | 362 e.rounding === 0 || e.rounding ? e.rounding : defaultRounding, |
363 e.padding || defaultPadding, | 363 e.padding || defaultPadding, |
364 e.fontsize || defaultFontSize, | 364 e.fontsize || defaultFontSize, |
365 e.color || defaultTextColor, | 365 e.color || defaultTextColor, |
366 e.background || defaultBgColor, | 366 e.background || defaultBgColor, |
367 e.text, | 367 e.text || "", |
368 e.brcolor || defaultBorderColor | 368 e.brcolor || defaultBorderColor |
369 ); | 369 ); |
370 break; | 370 break; |
371 } | 371 } |
372 } | 372 } |
379 y = offset.y; | 379 y = offset.y; |
380 var svg = this.$refs.diagramContainer.innerHTML; | 380 var svg = this.$refs.diagramContainer.innerHTML; |
381 if (svg) { | 381 if (svg) { |
382 svg = svg.replace(/\r?\n|\r/g, "").trim(); | 382 svg = svg.replace(/\r?\n|\r/g, "").trim(); |
383 } | 383 } |
384 // landscape format is used for both a3,a4 papersize | 384 // use default width,height if they are missing in the template definition |
385 if (!width) { | 385 if (!width) { |
386 width = this.templateData.properties.paperSize === "a3" ? 380 : 290; | 386 width = this.templateData.properties.paperSize === "a3" ? 380 : 290; |
387 } | 387 } |
388 if (!height) { | 388 if (!height) { |
389 height = this.templateData.properties.paperSize === "a3" ? 130 : 100; | 389 height = this.templateData.properties.paperSize === "a3" ? 130 : 100; |