Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > svgPaths
utils.svgPaths namespace
Functions
Function |
Description |
arc(command, flags, radius, point) |
Draw an elliptical arc curve. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Elliptical_Arc_Curve |
curve(command, points) |
Draw a cubic or quadratic curve. See developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#Cubic_B%C3%A9zier_Curve These coordinates are unitless and hence in the user coordinate system. |
line(points) |
Draw multiple lines connecting all of the given points in order. This is equivalent to a series of 'l' commands. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands |
lineOnAxis(command, val) |
Draw a horizontal or vertical line. The first argument specifies the direction and whether the given position is relative or absolute. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#LineTo_path_commands |
lineTo(dx, dy) |
Draw a line from the current point to the end point, which is the current point shifted by dx along the x-axis and dy along the y-axis. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands |
moveBy(dx, dy) |
Move the cursor to the given position without drawing a line. Coordinates are relative. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands |
moveTo(x, y) |
Move the cursor to the given position without drawing a line. The coordinates are absolute. These coordinates are unitless and hence in the user coordinate system. See developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands |
point(x, y) |
Create a string representing the given x, y pair. It does not matter whether the coordinate is relative or absolute. The result has leading and trailing spaces, and separates the x and y coordinates with a comma but no space. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `Blockly.utils.svgPaths` namespace provides functions for creating SVG paths."],["These functions offer methods to draw lines, curves, arcs, and move the drawing cursor."],["All coordinates used by these functions are unitless and within the user coordinate system."],["The generated paths are compatible with the SVG 'd' attribute and follow SVG path syntax."],["Detailed information about the underlying SVG path commands can be found on the Mozilla Developer Network (MDN) documentation."]]],[]]