From c39a693afd1cd0f9742ad0fff2ac345925059f2a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 31 Mar 2009 15:59:31 +0000 Subject: [PATCH] * Generate SVG instead of PNG, which is much faster and smaller. I tried this before but the text didn't fit in the boxes in Firefox. The solution is to use Graphviz' svg:cairo backend instead of svg. svg:cairo doesn't depend on client-side fonts. --- src/lib/Hydra/View/NixDepGraph.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/View/NixDepGraph.pm b/src/lib/Hydra/View/NixDepGraph.pm index 55af1d33..f4315959 100644 --- a/src/lib/Hydra/View/NixDepGraph.pm +++ b/src/lib/Hydra/View/NixDepGraph.pm @@ -7,13 +7,13 @@ use IO::Pipe; sub process { my ($self, $c) = @_; - $c->response->content_type('image/png'); + $c->response->content_type('image/svg+xml'); my @storePaths = @{$c->stash->{storePaths}}; my $fh = new IO::Handle; - open $fh, "nix-store --query --graph @storePaths | dot -Tpng -Gbgcolor=transparent |"; + open $fh, "nix-store --query --graph @storePaths | dot -Tsvg:cairo -Gdpi=100 -Gsize=20,20 -Gbgcolor=transparent |"; $c->response->body($fh);