Hariganesh Srinivasan
fit canvas inside div
c3e90a5 unverified
raw
history blame
830 Bytes
import gradio as gr
HTML = """
<canvas id="rustCanvas" height=500></canvas>
<script type="text/javascript" src="file/main.ab801f492b3a5d9625fa.js"></script>
<style onload='
function loadXMLDoc(file) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
if (xmlhttp.status == 200) {
eval(xmlhttp.responseText);
}
else {
alert("There was a problem fetching the wasm bindings. Try again");
}
}
};
xmlhttp.open("GET", "file/" + file, true);
xmlhttp.send();
} loadXMLDoc("main.ab8199311525ec1a2beb.js");'></script>
"""
demo = gr.Interface(
lambda: HTML,
None,
["html"],
)
demo.launch()