JSFiddle - React, Tailwind, and code Playground
TESTOVANIE
by lalatino
HTML
<button onclick="test()">test</button>
<input type="text" id="seed" value="1" />
<canvas id="canvas" width="400" height="300"></canvas>
CSS
#canvas {
border:1px solid #ccc;
background-color:#eee;
}
JavaScript
var canvas, canvasWidth, canvasHeight, ctx, canvasData;
var x,y,a,b; // y = a*x+b
function line_point() {
}
function test() {
canvas = document.getElementById("canvas");
canvasWidth = canvas.width;
canvasHeight = canvas.height;
ctx = canvas.getContext("2d");
//ctx.clearRect(0,0,canvasWidth, canvasHeight);
//ctx.fillStyle="#ff0000";
ctx.strokeStyle='#f00';
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
alert('hotovo');
}
//http://www.w3schools.com/html/html5_canvas.asp
//http://stackoverflow.com/questions/7812514/drawing-a-dot-on-html5-canvas