feat: LoopMeasurementChart auf Chart.js mit canvas umgestellt – Zoom & Pan bleiben stabil
- Recharts entfernt und Chart.js direkt über canvas eingebunden - Zoom- und Pan-Funktionalität wie bei TDRChart umgesetzt - Chart wird nicht mehr bei jeder Redux-Aktualisierung neu gezeichnet - Zoom-Stufe bleibt beim Benutzer erhalten
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
// /utils/loadLoopChartData.ts
|
||||
import { createLoopChart } from "./chartUtils";
|
||||
|
||||
export const loadLoopChartData = (
|
||||
slotIndex: number,
|
||||
setLoopMeasurementCurveChartData: (data: any) => void
|
||||
) => {
|
||||
const environment = process.env.NODE_ENV || "production";
|
||||
const fileData =
|
||||
environment === "production"
|
||||
? `/CPL?/CPL/4000values/slot${slotIndex}.json`
|
||||
: `/CPLmockData/4000values/slot${slotIndex}.json`;
|
||||
|
||||
fetch(fileData)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
setLoopMeasurementCurveChartData(data);
|
||||
createLoopChart(data, "Schleifenmesskurve");
|
||||
})
|
||||
.catch((error) =>
|
||||
console.error("Fehler beim Laden der Schleifenmesskurvendaten:", error)
|
||||
);
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
// /utils/loadTDRChartData.ts
|
||||
import { createTDRChart } from "./chartUtils";
|
||||
|
||||
export const loadTDRChartData = (
|
||||
selectedFileName: string | null,
|
||||
setLoopMeasurementCurveChartData: (data: any) => void
|
||||
) => {
|
||||
if (!selectedFileName) {
|
||||
console.error("Kein Dateiname in Redux gespeichert.");
|
||||
return;
|
||||
}
|
||||
|
||||
const yearFolder = `Year_${new Date().getFullYear().toString().slice(-2)}`;
|
||||
const monthFolder = `Month_${(new Date().getMonth() + 1)
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
|
||||
//const filePath = `/CPLmockData/LastTDR/kue_01/${yearFolder}/${monthFolder}/${selectedFileName}`;
|
||||
const filePath = `/CPLmockData/LastTDR/jsonDatei/${selectedFileName}`;
|
||||
|
||||
fetch(filePath)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("Geladene TDR-Daten:", data);
|
||||
setLoopMeasurementCurveChartData(data);
|
||||
createTDRChart(data);
|
||||
})
|
||||
.catch((error) => console.error("Fehler beim Laden der TDR-Daten:", error));
|
||||
};
|
||||
Reference in New Issue
Block a user