Visualize.SVG.Path (Visualize v0.2.35)

Copy Markdown View Source

SVG path command builder.

This module provides backward compatibility by delegating to Visualize.IR.Path. For new code, consider using Visualize.IR.Path directly for backend-agnostic path construction.

Examples

iex> alias Visualize.SVG.Path
iex> Path.new()
...> |> Path.move_to(10, 20)
...> |> Path.line_to(100, 200)
...> |> Path.close()
...> |> Path.to_string()
"M10,20L100,200Z"

Summary

Functions

Converts the path to an SVG path string (the d attribute value).

Types

command()

@type command() :: Visualize.IR.Path.command()

t()

@type t() :: Visualize.IR.Path.t()

Functions

append(path1, path2)

See Visualize.IR.Path.append/2.

arc_to(path, rx, ry, x_rotation, large_arc, sweep, x, y)

See Visualize.IR.Path.arc_to/8.

arc_to_rel(path, rx, ry, x_rotation, large_arc, sweep, dx, dy)

See Visualize.IR.Path.arc_to_rel/8.

close(path)

See Visualize.IR.Path.close/1.

command_count(path)

See Visualize.IR.Path.command_count/1.

concat(paths)

See Visualize.IR.Path.concat/1.

curve_to(path, x1, y1, x2, y2, x, y)

See Visualize.IR.Path.curve_to/7.

curve_to_rel(path, dx1, dy1, dx2, dy2, dx, dy)

See Visualize.IR.Path.curve_to_rel/7.

empty?(path)

See Visualize.IR.Path.empty?/1.

horizontal_to(path, x)

See Visualize.IR.Path.horizontal_to/2.

horizontal_to_rel(path, dx)

See Visualize.IR.Path.horizontal_to_rel/2.

line_to(path, x, y)

See Visualize.IR.Path.line_to/3.

line_to_rel(path, dx, dy)

See Visualize.IR.Path.line_to_rel/3.

move_to(path, x, y)

See Visualize.IR.Path.move_to/3.

move_to_rel(path, dx, dy)

See Visualize.IR.Path.move_to_rel/3.

new()

See Visualize.IR.Path.new/0.

quad_to(path, x1, y1, x, y)

See Visualize.IR.Path.quad_to/5.

quad_to_rel(path, dx1, dy1, dx, dy)

See Visualize.IR.Path.quad_to_rel/5.

smooth_curve_to(path, x2, y2, x, y)

See Visualize.IR.Path.smooth_curve_to/5.

smooth_curve_to_rel(path, dx2, dy2, dx, dy)

See Visualize.IR.Path.smooth_curve_to_rel/5.

smooth_quad_to(path, x, y)

See Visualize.IR.Path.smooth_quad_to/3.

smooth_quad_to_rel(path, dx, dy)

See Visualize.IR.Path.smooth_quad_to_rel/3.

to_string(path)

@spec to_string(t()) :: String.t()

Converts the path to an SVG path string (the d attribute value).

The one d serialisation is Visualize.IR.Path.to_string/1 (D-12).

transform(path, transform_fn)

See Visualize.IR.Path.transform/2.

vertical_to(path, y)

See Visualize.IR.Path.vertical_to/2.

vertical_to_rel(path, dy)

See Visualize.IR.Path.vertical_to_rel/2.