XRVG stands for "eXtended Ruby Vector Graphics". The purpose of this project is to define and implement a high-level and powerful programming environment for vector graphics generation.
XRVG does not consist in "yet another" graphical front end to draw vector graphics. XRVG even does not produce images by itself.
XRVG must rather be viewed as an abstract and computational way of designing graphics by programmatic means (see philosophy for further discussion).
XRVG is a Ruby extension, that generates SVG content.
require 'xrvg' include XRVG render = SVGRender[ :filename, "sample.svg" ] palette = Palette[ :colorlist, [ 0.0, Color.blue, 0.25, Color.orange, 0.5, Color.yellow, 0.75, Color.green, 1.0, Color.blue] ] SyncS[Circle, palette, (0.1..0.02).random()].samples(25) do |point, color, radius| render.add( Circle[ :center, point, :radius, radius ], Style[ :fill, color ]) end render.end
If you want to see (far) more advanced examples, you may be interested in the following Blog.
Several tutorial pages are available. While being for me an efficient way of rethinking XRVG design and functionalities, I hope these pages might be quite useful to get you into using XRVG, and stimulate your creativity :-)
An extensive reference documentation, generated with rdoc, is also available.
First things first: thanks to the Tcl, Ruby and SVG communities.
I would also like thank the Emacs community in a whole, since I also heavily use Emacs for code edition, debugging, personal information management (planner), and documentation generation (muse) !
XRVG in a whole, that is code source but also documentation, is provided under the MIT licence, reproduced hereafter
Copyright (c) 2008 J. LEONARD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.