LoginSignup
3
4

More than 3 years have passed since last update.

ruby-graphviz-mindmap で DSL から Mindmap を生成する #mindmap #graphviz #ruby

Last updated at Posted at 2015-03-05

:deciduous_tree: 概要

ruby-graphviz-mindmap で DSL から Mindmap を生成します

:deciduous_tree: 前提

graphviz をインストールしていること

:deciduous_tree: インストール

$ gem install ruby-graphviz-mindmap

:deciduous_tree: DSL から マインドマップを生成

プログラム

require 'ruby-graphviz-mindmap'
map = GraphViz::MindMap.build "games", overlap: false
map.node 'Programming Languages', color: :red, shape: :box do
  node 'OO' do
    node 'Java'
    node 'Ruby'
  end

  node 'Functional', color: :blue do
    inherit!
    node 'Haskell'
    node 'Scala'
    node 'Elixir'
  end
end

File.open('programming_languages.dot', 'wb'){|f| f << map.to_dot }

dot ファイル出力

% ruby mindmap.rb

png 生成出力

% neato -Tpng programming_languages.dot -o programming_languages.png

出力画像を確認

programming_languages.png

:worried: 雑感

  • Gviz でいいんじゃね?感 :worried:

:books: 外部資料

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4