This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
Open
Description
I want to implement a 2D plotting widget from what I could find, the easiest way to draw lines is to use a canvas with a 2D context. Now, I'm not an expert in web-related stuff at all, so I followed this tutorial, and in the eval()
function of my new widget, I'm returning the following.
Style:
<style type="text/css"></style>
HTML:
<canvas id="my_graph" width="500" height="500"></canvas>
<script>
var canvas = document.getElementById('my_graph');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(100, 20);
context.lineTo(200, 160);
context.lineWidth = 5;
context.strokeStyle = 'blue';
context.stroke();
</script>
But all I'm getting is a blank window. Is what I'm doing not currently possible with neutrino? How can I view the DOM that gets generated, and then rendered? Is there a different and better way of doing this?