Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naoty/svgen
SVG generator
https://github.com/naoty/svgen
Last synced: 21 days ago
JSON representation
SVG generator
- Host: GitHub
- URL: https://github.com/naoty/svgen
- Owner: naoty
- License: mit
- Created: 2013-12-27T15:05:18.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-04T09:20:21.000Z (almost 11 years ago)
- Last Synced: 2024-11-18T02:45:13.604Z (about 1 month ago)
- Language: Ruby
- Size: 238 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SVGen
SVG generator
## Install
```sh
$ gem install svgen
```## Usage
### rect, circle, text
```rb
require "svgen"svg = SVGen::SVG.new(width: 600, height: 400) do |svg|
svg.rect(width: 300, height: 200, fill: "blue")
svg.circle(cx: 100, cy: 100, r: 50, fill: "red")
svg.text("Sample Text", x: 20, y: 20)
end
svg.generate
#=>
#
#
#
# Sample Text
#
```### group
```rb
require "svgen"svg = SVGen::SVG.new(width: 600, height: 400) do |svg|
svg.g(stroke: "red", "stroke-width" => 5) do |g|
g.rect(x: 50, y: 50, width: 100, height: 100)
g.circle(cx: 200, cy: 200, r: 50)
end
end
svg.generate
#=>
#
#
#
#
#
#
```