Introduction to p5 for Visualization
Add the p5 libraries.
In index.html
:
<html>
<head>
<title>Neural Network</title>
<link rel="stylesheet" href="index.css">
<script src="p5.min.js"></script>
<script src="p5.dom.min.js"></script>
<script src="index.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
Create simple drawing tool
In index.js
:
function setup() {
createCanvas(windowHeight, windowWidth)
}
function draw() {
if (mouseIsPressed) {
fill(255, 0, 0)
stroke(255, 0, 0)
ellipse(mouseX, mouseY, 10, 10)
}
}