Skip to main content

Home > blockly > utils > svgPaths > lineOnAxis

utils.svgPaths.lineOnAxis() function

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

Signature:

export declare function lineOnAxis(command: string, val: number): string;

Parameters

ParameterTypeDescription
commandstringThe command to prepend to the coordinate. This should be one of: V, v, H, h.
valnumberThe coordinate to pass to the command. It may be absolute or relative.

Returns:

string

A string of the format ' command val '