SVG Path

Description of the <path> element The SVG <path> element specifies a path. Paths are used to create complex shapes combining several straight or curved lines. Complex shapes that consist only of straight lines can be created as polylines. Polylines and paths create similar shapes. However, polylines need smaller straight lines for simulating curves. Creating complex paths… Continue reading SVG Path

SVG Polyline

Description of the <polyline> element The SVG <polyline> element creates any shape consisting of only straight lines that connect multiple points. Unlike the <polygon> element, the <polyline> creates open shapes. Example of the SVG <polyline> element: Example of the SVG <polyline> element with straight lines: Attributes Attribute Description points This attribute specifies the list of points (pairs… Continue reading SVG Polyline

SVG Polygon

Description of the <polygon> element The SVG <polygon> element creates a graphic containing at least three sides. Polygons consist of straight lines, which are connected up, and its shape is “closed”. Example of the SVG <polygon> element with three sides: In this example the points attribute specifies the x and y coordinates for each corner of our… Continue reading SVG Polygon

SVG Line

Description of the <line> element The SVG <line> element creates lines. Since the <line> elements are geometrically one-dimensional single lines, they do not have any interior. Therefore, they are never filled. Example of the SVG <line> element: Let’s explain the code above: The x1 attribute specifies the beginning of the line on the x-axis. The y1 attribute specifies the… Continue reading SVG Line

SVG Ellipse

Description of the <ellipse> element The SVG <ellipse> element creates ellipses. The ellipse is centered by using the cx and cy attributes. However, unlike the <circle> element, the radius in the x and y coordinates is specified by two attributes, not one. An ellipse and a circle are similar. The difference between them is that an ellipse has an x and… Continue reading SVG Ellipse

SVG Circle

Description of the <circle> element The SVG <circle> element creates circles, based on a center point and a radius. The coordinates of the circle’s center are specified by the cx and cy attributes. And the radius of the circle is specified by the r attribute. Example of the SVG <circle> element: Let’s explain the code above: The cx and cy attributes specify the x and… Continue reading SVG Circle

SVG Rectangle

Description of the <rect> element The SVG <rect> element creates a rectangle, as well as rectangle shape variations. It is possible to draw rectangles of various height, width, with different stroke and fill colors, etc. We are going to try some examples. Example of the SVG <rect> element: Now let’s explain this code: The width and height attributes specify… Continue reading SVG Rectangle

SVG in HTML5

In HTML5, the SVG elements can be embedded directly into your HTML page. If the SVG is written in XML, all elements should be appropriately closed! Shape elements in SVG SVG has some predetermined shape elements. Here they are: rectangle <rect> circle <circle> ellipse <ellipse> line <line> polyline <polyline> polygon <polygon> path <path> Example of… Continue reading SVG in HTML5

SVG Intro

SVG (Scalable Vector Graphics) specifies vector-based graphics in XML format. In order to work with it, you need to have some basic understanding of HTML and basic XML. SVG is used to specify vector-based graphics for the Web. Each element and attribute in SVG files can be animated. SVG is a W3C recommendation. It incorporates… Continue reading SVG Intro

Canvas Reference

The HTML5 <canvas> element is used for drawing graphics via scripting (commonly JavaScript). But the <canvas> element does not have drawing opportunities on its own. To draw the graphics, you must use a script because the <canvas> element is only a container for graphics. The getContext() method returns an object which presents properties and methods for drawing on… Continue reading Canvas Reference