graphviz.render: add preview-open which uses open-file.

db4
John Benediktsson 2015-07-19 15:26:21 -07:00
parent c5e4bb4980
commit 81fdcd6f64
1 changed files with 9 additions and 6 deletions

View File

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