Skip to content

Instantly share code, notes, and snippets.

@prusswan
Created June 18, 2013 23:41
Show Gist options
  • Save prusswan/5810507 to your computer and use it in GitHub Desktop.
Save prusswan/5810507 to your computer and use it in GitHub Desktop.
Customizing graphviz options for `bundle viz`
require 'graphviz'
require 'bundler'
module Bundler
class Graph
class GraphVizClient
def g
@g ||= ::GraphViz.digraph(@graph_name, {
:use => 'neato',
:concentrate => true,
:normalize => true,
:nodesep => '0.2',
:overlap => false
}) do |g|
g.edge[:weight] = 2
g.edge[:fontname] = g.node[:fontname] = 'Arial, Helvetica, SansSerif'
g.edge[:fontsize] = 12
end
end
end
end
end
output_file = File.expand_path('gem_graph')
graph = Bundler::Graph.new(Bundler.load, output_file, true, true)
graph.viz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment