JS GraphicsLesson 32Free preview
Graph Canvas
This lesson is part of A.I. · All levels
Summary
HTML5 canvas provides a fully controlled drawing area via JavaScript. With 2D context objects, we can create lines, circles, text, and other shapes to visualize the data independently. It's perfect when we want a custom graphic without external library dependence.
Key points
- The <canvas> element is an empty canvas for drawing via JavaScript.
- Returns the context object to draw a flat field.
- MoveTo determine the starting point, lineTo determine the destination point of the line.
- The stroke scratches the already made line onto the canvas.
- Canvas gives you full control but without the automatic interactive features.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.