]> gitweb.factorcode.org Git - factor.git/commitdiff
graphviz.render: add preview-open which uses open-file.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 Jul 2015 22:26:21 +0000 (15:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 Jul 2015 22:26:21 +0000 (15:26 -0700)
extra/graphviz/render/render.factor

index 88a39dd2549d6060f6a39fe20c9e49a3a1e8f3b5..6caf5250ee86a1991b2854fb0b290c4932711e92 100644 (file)
@@ -1,11 +1,11 @@
 ! Copyright (C) 2012 Alex Vondrak.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators compiler.units continuations
-destructors graphviz.dot images.viewer io.backend
-io.directories io.encodings.8-bit.latin1 io.encodings.utf8
-io.files io.files.unique io.launcher io.standard-paths kernel
-locals make namespaces parser sequences summary system
-unicode.case vocabs words ;
+USING: calendar combinators compiler.units continuations
+graphviz.dot images.viewer io.backend io.directories
+io.encodings.8-bit.latin1 io.encodings.utf8 io.files
+io.files.unique io.launcher io.standard-paths kernel locals make
+namespaces sequences summary system threads unicode.case vocabs
+webbrowser words ;
 IN: graphviz.render
 
 <PRIVATE
@@ -132,6 +132,9 @@ PRIVATE>
 : preview-window ( graph -- )
     [ image-window ] with-preview ;
 
+: preview-open ( graph -- )
+    [ open-file 1 seconds sleep ] with-preview ;
+
 <PRIVATE
 
 ! http://graphviz.org/content/output-formats