Interface to uDraw(Graph) (daVinci)

Author(s): Francisco Bueno.

This library allows connecting a Ciao application with uDraw(Graph) V2.X (previously known as daVinci). uDraw(Graph) draw graphs (such as flow charts, diagrams, hierarchies or structure visualizations) using automatic layout.

Communication is based on a two-way channel: after daVinci is started, messages are sent in to it and read in from it on demand by different Prolog predicates. Messages are sent via writing the term as text; messages are received by reading text and returning an atom. Commands sent and answers received are treated as terms from the Prolog side, since for daVinci they are text but have term syntax; the only difficulty lies in strings, for which special Prolog syntax is provided.

See accompanying file library(davinci/examples/commands) for examples on the use of this library.

uDraw(Graph) (http://www.informatik.uni-bremen.de/uDrawGraph/en/home.html) is developed by U. of Bremen, Germany (http://www.uni-bremen.de/).

Usage and interface

Documentation on exports

PREDICATE
Start up a daVinci process.

PREDICATE
A toplevel to send to daVinci commands from standard input.

PREDICATE

Usage:davinci_get(Term)

Get a message from daVinci. Term is a term corresponding to daVinci's message.

    PREDICATE

    Usage:davinci_get_all(List)

    Get all pending messages. List is a list of terms as in davinci_get/1.

    • The following properties should hold upon exit:
      (basic_props:list/1)List is a list.

    PREDICATE

    Usage:davinci_put(Term)

    Send a command to daVinci.

    • The following properties should hold at call time:
      (davinci:davinci_command/1)davinci:davinci_command(Term)

    PREDICATE
    Exit daVinci process. All pending answers are lost!

    PREDICATE

    Usage:davinci_ugraph(Graph)

    Send a graph to daVinci.

    • The following properties should hold at call time:
      (davinci:ugraph/1)davinci:ugraph(Graph)

    PREDICATE

    Usage:davinci_lgraph(Graph)

    Send a labeled graph to daVinci.

    • The following properties should hold at call time:
      (davinci:lgraph/1)davinci:lgraph(Graph)

    PREDICATE
    No further documentation available for this predicate.

    PREDICATE
    No further documentation available for this predicate.

    Documentation on internals

    PROPERTY
    Syntactically, a command is a term. Semantically, it has to correspond to a command understood by daVinci. Two terms are interpreted in a special way: string/1 and text/1: string(Term) is given to daVinci as "Term"; text(List) is given as "Term1 Term2 ...Term " for each Term in List. If your term has functors string/1 and text/1 that you don't want to be interpreted this way, use it twice, i.e., string(string(Term)) is given to daVinci as string(Term') where Term' is the interpretation of Term.

    PROPERTY
    ugraph(Graph)

    Graph is a term which denotes an ugraph as in library(ugraphs). Vertices of the form node/2 are interpreted in a special way: node(Term,List) is interpreted as a vertex Term with attributes List. List is a list of terms conforming the syntax of davinci_put/1 and corresponding to daVinci's graph nodes attributes. If your vertex has functor node/2 and you don't want it to be interpreted this way, use it twice, i.e., node(node(T1,T2),[]) is given to daVinci as vertex node(T1,T2). A vertex is used both as label and name of daVinci's graph node. daVinci's graph edges have label V1-V2 where V1 is the source and V2 the sink of the edge. There is no support for multiple edges between the same two vertices.

    PROPERTY
    lgraph(Graph)

    Graph is a term which denotes a wgraph as in library(wgraphs), except that the weights are labels, i.e., they do not need to be integers. Vertices of the form node/2 are interpreted in a special way. Edge labels are converted into special intermediate vertices. Duplicated labels are solved by adding dummy atoms . There is no support for multiple edges between the same two vertices.