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']

Posted in products | 2 comments | no trackbacks

graphviz_r on Rails

Posted by Technohippy Fri, 16 Feb 2007 02:54:00 GMT

graphviz_r をRailsから使えるようにしてみました。

render_rdotでrdotを評価した結果の画像を send_dataしてくれます。

class RdotGenController < ApplicationController
  def index
    render :rdot do
      graph [:size => '1.5, 2.5']
      node [:shape => :record]
      node1 [:label => "<p_left> left|<p_center>center|<p_right> right"]
      node1 >> node2
      node1(:p_left) >> node2
      (node2 >> node1(:p_right)) [:label => 'record']
    end
  end
end

Posted in products | 2 comments | no trackbacks

graphviz_r

Posted by Technohippy Mon, 12 Feb 2007 17:34:00 GMT

GraphvizのRubyラッパー を作ってみました。

ここを参考にさせてもらっただけなので、仕様の全てをカバーしてるわけではないです。

Posted in products | 1 comment | no trackbacks

botree'

Posted by Technohippy Sat, 16 Dec 2006 06:57:00 GMT

今月頭にリリースしたbotreeにアドベンチャーゲーム作成機能?を追加しました。 けっこう愉快。

Posted in drecom, products, rails | 15 comments | 151 trackbacks

botree

Posted by Technohippy Mon, 04 Dec 2006 13:06:00 GMT

アウトラインプロセッサー「botree」リリースしました。 出来はかなり普通。 でもWebでアウトラインプロセッサーってあんまり見ないよね?ね?

Read more...

Posted in rails, drecom, products | 102 comments | 44 trackbacks

日本語プログラミング言語「こばなし」

Posted by Technohippy Wed, 08 Nov 2006 09:58:00 GMT

  諸君 私はSmalltalkが好きだ
  諸君 私はSmalltalkが大好きだ
Read more...

Posted in products | no comments | 148 trackbacks