refactor: Remove html2canvas references and update captureVisualization logic
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user