comparison client/src/components/gauge/HydrologicalConditions.vue @ 4665:c47c8085cc7e

client: translation: implement marking of diagram labels * mark date/time strings of diagrams labels for translations
author Fadi Abbud <fadi.abbud@intevation.de>
date Mon, 14 Oct 2019 16:26:46 +0200
parents 3632cfc44b69
children fa55e48bbca1
comparison
equal deleted inserted replaced
4664:7d2463c7b4ad 4665:c47c8085cc7e
114 import { startOfYear, endOfYear } from "date-fns"; 114 import { startOfYear, endOfYear } from "date-fns";
115 import { diagram, pdfgen, templateLoader } from "@/lib/mixins"; 115 import { diagram, pdfgen, templateLoader } from "@/lib/mixins";
116 import { HTTP } from "@/lib/http"; 116 import { HTTP } from "@/lib/http";
117 import { displayError } from "@/lib/errors"; 117 import { displayError } from "@/lib/errors";
118 import { defaultDiagramTemplate } from "@/lib/DefaultDiagramTemplate"; 118 import { defaultDiagramTemplate } from "@/lib/DefaultDiagramTemplate";
119 import { localeDateString } from "@/lib/datelocalization";
119 import sanitize from "sanitize-filename"; 120 import sanitize from "sanitize-filename";
120 121
121 export default { 122 export default {
122 mixins: [diagram, pdfgen, templateLoader], 123 mixins: [diagram, pdfgen, templateLoader],
123 components: { 124 components: {
322 }; 323 };
323 }, 324 },
324 drawDiagram() { 325 drawDiagram() {
325 // remove old diagram 326 // remove old diagram
326 d3.select("#" + this.containerId + " svg").remove(); 327 d3.select("#" + this.containerId + " svg").remove();
328 d3.timeFormatDefaultLocale(localeDateString);
327 const el = document.querySelector("#" + this.containerId); 329 const el = document.querySelector("#" + this.containerId);
328 if (!this.selectedGaugeD || !this.longtermWaterlevels.length || !el) 330 if (!this.selectedGaugeD || !this.longtermWaterlevels.length || !el)
329 return; 331 return;
330 const svgWidth = el.clientWidth; 332 const svgWidth = el.clientWidth;
331 const svgHeight = el.clientHeight; 333 const svgHeight = el.clientHeight;