File: image.rb

package info (click to toggle)
ruby-rubyvis 0.6.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,808 kB
  • ctags: 679
  • sloc: ruby: 11,114; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# = Image
# This example shows how to include an image 
$:.unshift(File.dirname(__FILE__)+"/../../lib")
require 'rubyvis'

img_url="fixtures/tipsy.gif"

vis = pv.Panel.new().width(200).height(200);

dot=vis.add(pv.Image)
    .data([1,2,3,4,5,6])
    .bottom(lambda {|d| d*30})
    .left(lambda {|d| d*30} )
    .width(9)
    .height(9)
    .url(img_url)
    
vis.render()
puts vis.to_svg