diff --git a/src/components/Editor/Runners/PythonRunner/PyodideRunner/VisualOutputPane.jsx b/src/components/Editor/Runners/PythonRunner/PyodideRunner/VisualOutputPane.jsx index 9db07dd7c..01bd4cd96 100644 --- a/src/components/Editor/Runners/PythonRunner/PyodideRunner/VisualOutputPane.jsx +++ b/src/components/Editor/Runners/PythonRunner/PyodideRunner/VisualOutputPane.jsx @@ -91,80 +91,6 @@ const VisualOutputPane = ({ visuals, setVisuals }) => { ); }; -// const showVisuals = (visuals, output) => -// visuals.map((v) => (v.showing ? v : showVisual(v, output))); - -// const showVisual = (visual, output) => { -// switch (visual.origin) { -// case "sense_hat": -// output.current.textContent = JSON.stringify(visual.content); -// break; -// case "pygal": -// const chartContent = { -// ...visual.content, -// chart: { -// ...visual.content.chart, -// events: { -// ...visual.content.chart.events, -// load: function () { -// this.renderTo.style.overflow = "visible"; -// }, -// }, -// }, -// tooltip: { -// ...visual.content.tooltip, -// formatter: -// visual.content.chart.type === "pie" -// ? function () { -// return this.key + ": " + this.y; -// } -// : null, -// }, -// }; -// Highcharts.chart(output.current, chartContent); -// break; -// case "turtle": -// output.current.innerHTML = elementFromProps(visual.content).outerHTML; -// break; -// case "matplotlib": -// // convert visual.content from Uint8Array to jpg -// const img = document.createElement("img"); -// img.style = "max-width: 100%; max-height: 100%;"; -// img.src = `data:image/jpg;base64,${window.btoa( -// String.fromCharCode(...new Uint8Array(visual.content)) -// )}`; -// output.current.innerHTML = img.outerHTML; -// break; -// case "file": -// // const componentToUpdate = projectComponents.find( -// // (c) => c.name === visual.filename, -// // ); -// // if (componentToUpdate) { -// // dispatch( -// // updateProjectComponent({ -// // extension: extension, -// // name: fileName, -// // code: content, -// // }), -// // ); -// // } -// const [name, extension] = visual.filename.split("."); -// dispatch( -// updateProjectComponent({ -// extension: extension, -// name: name, -// code: visual.content, -// }) -// ); -// break; -// default: -// throw new Error(`Unsupported origin: ${visual.origin}`); -// } - -// visual.showing = true; -// return visual; -// }; - const elementFromProps = (map) => { const tag = map.get("tag"); if (!tag) {