From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: d3js chord diagrams Date: Sun, 11 Dec 2016 20:51:51 +0100 Message-ID: <87mvg2ckh4.fsf@elephly.net> References: <87zilxtkvp.fsf@elephly.net> <87wpf64rxp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGAfF-0007ts-FQ for guix-devel@gnu.org; Sun, 11 Dec 2016 15:24:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGAfE-00012d-FF for guix-devel@gnu.org; Sun, 11 Dec 2016 15:24:05 -0500 In-reply-to: <87wpf64rxp.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel Ludovic Courtès writes: > Hey Ricardo, > > Ricardo Wurmus skribis: > >> I’ve built something: >> >> http://elephly.net/graph.html > > What happened to this neat hack we discussed in October? :-) The current “export-graph” procedure writes the graph representation to a port by calling output procedures provided by the graph backend. With this interface I cannot generate a complete HTML file using a gexp unless I add a special case for the d3 backend. I’ve tried to accumulate the node representations as a string with “with-output-to-string” (to embed it in a gexp for the HTML file), but I couldn’t get this to work. (All output I could capture was what “emit-prologue” would write to the port. It does this outside of the monad anyway.) I also tried and failed to use an “origin” and “computed-file” in “export-graph”. “export-graph” should return a monadic value, but I don’t really understand the monad implementation in Guix. What monadic value would be appropriate to actually cause a download of the origin and storing of the computed-file? Do I need to return “(lower-object (computed-file …))”? That’s a monadic value, but nothing happens to it inside of “(run-with-store …)” in guix/scripts/graph.scm. When returning the result of “gexp->file” (instead of “computed-file”) as the return value of “export-graph” still nothing happens. Really thought this would be trivial. Any recommendations? I feel like I’m just missing one little thing to make things happen. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC http://elephly.net