SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

Bouquet: a graph generator

Bouquet is a graph description generator written in Common Lisp. The package accepts various Lisp objects as nodes and produces graph descriptions in .tlp format, which can be later visualized in Tulip (see http://www.tulip-software.org/). Tulip clusters and properties are supported.

Bouquet is written by Eugene Zaikonnikov, and is distributed under the terms of LLGPL (see LICENSE file for details).

Building Bouquet

Distribution tarball contains .asd system definition file, and several .lisp source files. To compile and load Bouquet, launch your ASDF-enabled Lisp and perfrom (asdf:oos 'asdf:load-op :bouquet) in the REPL.

To test the package, try (bouquet:test).

Bouquet was tested with CMU CL 18e, but is expected to run with other mostly-ANSI-conforming Lisps.

Using Bouquet

Below is a short description of package API. To familiarise with Tulip concepts, see http://www.tulip-software.org.

Bouquet maintains current graph instance in graph cache which is manipulated via set of interface functions. The interface functions implicitly use the graph instance currently registered in the graph cache: for most cases, it is more convenient and succinct.

The interface functions (exported from BOUQUET package) are:

(NEW-GRAPH): Instantiates a new graph and stores it in the graph cache. Also, default "Label" property is created for node labels.

(CURRENT-GRAPH): Returns the current graph instance.

(NODE <object>): Returns graph node instance associated with the 'object', or NIL if none found.

(REGISTER-NODE <object>): Creates node instance and associates it with the 'object'.

(REGISTER-NODE-UNLESS-EXISTS <object>): Registers object as node unless it is already registered.

(EDGE <from> <to>): Looks up for a directed edge from object 'from' to object 'to'. If successful, the edge instance is returned, otherwise NIL.

(REGISTER-EDGE <from> <to>): Registers a directed edge from node instance 'from' to node instance 'to'.

(MAKE-CLUSTER <name> &optional <nodes> <edges> &key <subclusters>): Instantiates a cluster 'name' with optional nodes and edges; the cluster can also contain subclusters (also cluster instances).

(CLUSTER <name>): Looks up cluster instance by name string.

(ADD-TO-CLUSTER <cluster> <entry>): Adds a node or edge instance to cluster instance.

(MAKE-PROPERTY <name> <cluster> <type> &optional <nodes-default> <edges-default>): Instantiates a property 'name' (string) associated with cluster number 'cluster' (implicit top-level cluster is 0) of type 'type'. Optional defaults for edges and nodes can be provided.

(PROPERTY <name>): Looks up property instance by namestring.

(SET-PROPERTY <property> <entry> <value>): Associates 'entry' (an edge or node instance) with its 'value' for the 'property' (a property instance).

(LABEL <entry> <value>): set entry's text label to 'value' (a string or a symbol; if latter, the label is assigned it's symbol-name). Manipulates the default "Labels" property.

(RENDER-GRAPH &optional <stream>): Prints current graph in .tlp format to 'stream'; if none provided, standard-output is used.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.