Project

svgle

0.0
No commit activity in last 3 years
No release in over 3 years
Svgle (SVG + Domle) generates an SVG Document Object Model from the given SVG. Suitable for accessing, or modifying SVG elements as objects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.2, >= 0.2.1
 Project Readme

Introducing the Svgle (SVG + Rexle) gem

require 'svgle'

s =<<SVG
<svg width="400" height="110">
  <g id="group1" fill="red">
    <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />
  </g>
</svg>
SVG


doc = Svgle.new(s)
line = doc.root.element('g').element('line')
line.class #=> Svgle::Line

line.x1 #=> "0"
lines.x1 = 44
line.x1 #=> "44"

Resources

svgle svg rexle