Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > svgPaths > line
utils.svgPaths.line() function
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
Signature:
export declare function line(points: string[]): string;
Parameters
Parameter |
Type |
Description |
points |
string[] |
An array containing all of the points to draw lines to, in order. The points are represented as strings of the format ' dx,dy '. |
Returns:
string
A string of the format ' l (dx,dy)+ '
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 `utils.svgPaths.line()` function generates SVG path data for drawing consecutive lines connecting a series of points."],["It accepts an array of points, formatted as ' dx,dy ', representing the change in x and y coordinates from the current position."],["The function returns a string suitable for use within an SVG path element's 'd' attribute, composed of 'l' commands and coordinate pairs."],["This function simplifies creating connected line segments within SVG graphics, offering a more concise alternative to manually constructing 'l' commands."]]],[]]