refactor: Remove html2canvas references and update captureVisualization logic

This commit is contained in:
2025-04-09 18:55:54 +05:30
parent 4d6b9a7763
commit f7f29884bd
4 changed files with 45 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
import html2canvas from "html2canvas";
// import html2canvas from "html2canvas";
export const captureVisualization = async (): Promise<string | null> => {
const container = document.getElementById("real-time-vis-canvas");
@@ -6,13 +6,15 @@ export const captureVisualization = async (): Promise<string | null> => {
try {
// Use html2canvas to capture the container
const canvas = await html2canvas(container, {
scale: 1, // Adjust scale for higher/lower resolution
});
// const canvas = await html2canvas(container, {
// scale: 1, // Adjust scale for higher/lower resolution
// });
// Convert the canvas to a data URL (PNG format)
const dataUrl = canvas.toDataURL("image/png");
return dataUrl;
// // Convert the canvas to a data URL (PNG format)
// const dataUrl = canvas.toDataURL("image/png");
// return dataUrl;
return null;
} catch (error) {
console.error("Error capturing visualization:", error);
return null;

View File

@@ -49,7 +49,8 @@ export const handleSaveTemplate = async ({
}
// Capture visualization snapshot
const snapshot = await captureVisualization();
// const snapshot = await captureVisualization();
const snapshot = null;
// if (!snapshot) {
// return;