Skip to content

zstix/victor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Victor

Hex.pm

A simple solution for creating SVGs in Elixir.

What's your vector victor?

Full documentation can be found at https://hexdocs.pm/victor.

Installation

The package can be installed by adding victor to your list of dependencies in mix.exs:

def deps do
  [{:victor, "~> 0.1.1"}]
end

Basic Usage

def make_art do
  Victor.new()
  |> Victor.add(:rect, %{x: 20, y: 20, width: 60, height: 10})
  |> Victor.add(:circle, %{cx: 10, cy: 50, r: 10}, %{fill: "blue"})
  |> Victor.add(:text, %{x: 40, y: 50, content: "Tada!"})
  |> Victor.get_svg()
  |> Victor.write_file("/tmp/art.svg")
end

Example