system memoize graphviz ;
IN: graphviz.ffi
+<<
"libgraph" {
{ [ os macosx? ] [ "libgraph.dylib" ] }
{ [ os unix? ] [ "libgraph.so" ] }
{ [ os unix? ] [ "libgvc.so" ] }
{ [ os winnt? ] [ "gvc.dll" ] }
} cond cdecl add-library
+>>
LIBRARY: libgraph
<PRIVATE
: define-graphviz-by-engine ( -K -- )
- [ create-in dup make-inline ]
+ [ "graphviz.render" create dup make-inline ]
[ [ graphviz ] curry ] bi
(( graph -O -T -- ))
define-declared ;
: define-graphviz-by-format ( -T -- )
[
dup supported-engines member? [ "-file" append ] when
- create-in dup make-inline
+ "graphviz.render" create dup make-inline
]
[ [ graphviz* ] curry ] bi
(( graph -O -- ))