graphviz_r on Rails 2

Posted by Technohippy Sat, 17 Feb 2007 01:18:00 GMT

graphviz_rプラグインでrdotテンプレートも使えるようにしてみました。 プラグイン入れて、拡張子 rdot でビューを作ればおk。 無論、インスタンス変数も受け渡し可。

# controllers/rdot_gen_controller.rb
class RdotGenController < ApplicationController
  def index
    @label1 = "<p_left> left|<p_center>center|<p_right> right"
    @label2 = "left|center|right"
  end
end

# views/rdot_gen/index.rdot
graph [:size => '1.5, 2.5']
node [:shape => :record]
node1 [:label => @label1]
node2 [:label => @label2]
node1 >> node2
node1(:p_left) >> node2
node2 >> node1(:p_center)
(node2 >> node1(:p_right)) [:label => 'record']

Comments

  1. Sten93687 said 59 days later:
    [url=http://online.abiou.org/it/football-field-pictures.htm]Immagini Del Campo Di Gioco del calcio[/url] * [url=http://online.abiou.org/football-field-pictures.htm]Football field pictures[/url] * [url=http://online.abiou.org/es/gemeente-den-bosch.htm] Guarida Bosch De Gemeente[/url] Immagini Del Campo Di Gioco del calcio | Football field pictures | Guarida Bosch De Gemeente http://online.abiou.org/it/football-field-pictures.htm http://online.abiou.org/football-field-pictures.htm http://online.abiou.org/es/gemeente-den-bosch.htm
  2. hello world said 338 days later:
    just testing mate.

Trackbacks

Use the following link to trackback from your own site:
http://blog.technohippy.net/articles/trackback/37

(leave url/email »)