https://github.com/zstix/victor
A simple solution for creating SVGs in Elixir.
https://github.com/zstix/victor
elixir svg
Last synced: 4 months ago
JSON representation
A simple solution for creating SVGs in Elixir.
- Host: GitHub
- URL: https://github.com/zstix/victor
- Owner: zstix
- Created: 2020-09-12T01:56:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-26T04:47:52.000Z (over 5 years ago)
- Last Synced: 2024-09-28T14:06:06.023Z (over 1 year ago)
- Topics: elixir, svg
- Language: Elixir
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Victor
[](https://hex.pm/packages/victor)
A simple solution for creating SVGs in Elixir.
_What's your vector victor?_
Full documentation can be found at [https://hexdocs.pm/victor](https://hexdocs.pm/victor).
## Installation
The package can be installed by adding `victor` to your list of dependencies
in `mix.exs`:
```elixir
def deps do
[{:victor, "~> 0.1.1"}]
end
```
## Basic Usage
```elixir
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
```
