Sha256: a5e4de725b697b6708c475d382eb80ba66d99c54f804e884c6b76c79878436b3

Contents?: true

Size: 1.6 KB

Versions: 5

Compression:

Stored size: 1.6 KB

Contents

<html>
<head>
<title>Rubyvis: Ruby version of Protovis</title>
</head>
<body>
<h1>Rubyvis</h1>
<h2>Ruby version of Protovis</h2>
</body>
<ul>
<li>original <a href='http://vis.stanford.edu/protovis/'>protovis</a></li>
<li>source code on <a href='http://github.com/clbustos/rubyvis'>Github</a></li>
<li>gem on <a href='http://rubygems.org/gems/rubyvis'>gemcutter</a></li>
<li>documentation on <a href='http://rubyvis.rubyforge.org/rubyvis/'>http://rubyvis.rubyforge.org/rubyvis/</a></li>
</ul>
<p>this code</p>
<pre>
require 'rubyvis'
vis = Rubyvis::Panel.new.width(150).height(150);

vis.add(pv.Bar).data([1, 1.2, 1.7, 1.5, 0.7, 0.3]).
  width(20).
  height(lambda {|d| d * 80}).
  bottom(0).
  left(lambda {self.index * 25})
vis.render()
</pre>

<p>Returns this svg code</p>
<pre>
&lt;svg fill="none" font-family="sans-serif" font-size="10px" height="150.0" stroke="none" stroke-width="1.5" width="150.0"&gt;
&lt;g transform="translate(0.0,0.0)"&gt;
&lt;rect fill="rgb(31,119,180)" height="80" width="20" y="70"/&gt;
&lt;rect fill="rgb(31,119,180)" height="96.0" width="20" x="25" y="54.0"/&gt;
&lt;rect fill="rgb(31,119,180)" height="136.0" width="20" x="50" y="14.0"/&gt;
&lt;rect fill="rgb(31,119,180)" height="120.0" width="20" x="75" y="30.0"/&gt;
&lt;rect fill="rgb(31,119,180)" height="56.0" width="20" x="100" y="94.0"/&gt;
&lt;rect fill="rgb(31,119,180)" height="24.0" width="20" x="125" y="126.0"/&gt;
&lt;/g&gt;
&lt;/svg&gt;
</pre>

Which renders

<div>

<!--[if IE]><embed src="first.svg" width="150" height="150"><![endif]-->
<object data="first.svg" type="image/svg+xml" width="150" height="150" class="svg">
</object> </html>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubyvis-0.1.5 web/index.html
rubyvis-0.1.4 web/index.html
rubyvis-0.1.3 web/index.html
rubyvis-0.1.2 web/index.html
rubyvis-0.1.1 web/index.html