http://www.zorba-xquery.com/modules/image/graphviz

Description

Before using any of the functions below please remember to import the module namespace:

import module namespace gr = "http://www.zorba-xquery.com/modules/image/graphviz";

Module that provides functions for generating SVG graphs.

The module provides two function for generating graphs given in the :

Both functions use the Graphviz Visualization Library in order to layout and render the graphs. As a result, both return a sequence of (document)-nodes (one for each input graph). These nodes are instances of the Scalable Vector Graphics (SVG) format. SVG is a language for describing two-dimensional graphics and graphical applications in XML. More information about SVG can be found at http://www.w3.org/Graphics/SVG/. As second parameters, both functions take a sequence of strings that are parameters for the graph generation and rendering algorithms. Currently, only the empty-sequence is allowed here. These parameters exist for future use.

Please note that this feature is only available on Unix-based platforms (i.e. not on Windows).

Author

28msec

XQuery version and encoding

xquery version "1.0" encoding "utf-8";

Namespaces

grhttp://www.zorba-xquery.com/modules/image/graphviz
verhttp://www.zorba-xquery.com/options/versioning

Function Summary

 dot($dot as xs:string*, $params as xs:string*) as node()* external

Layout one ore more graphs given in the DOT language and render them as SVG.

 gxl($gxl as node()*, $params as xs:string*) as node()* external

Layout one ore more graphs given in the GXL language and render them as SVG.

Functions

dot#2

declare function gr:dot(
    $dot as xs:string*,
    $params as xs:string*
) as node()* external

Layout one ore more graphs given in the DOT language and render them as SVG. For example,

dot("digraph mygraph { p -> q }", ())

Parameters

  • $dot as xs:string
    A dot description of the graph to render.
  • $params as xs:string
    Parameters to configure the layout and rendering process. Currently, only the empty-sequence is allowed here.

Returns

  • node()*

    A graph for each item in the sequence given using the first parameter. The result sequence consists of items which are instance of the SVG data model.

gxl#2

declare function gr:gxl(
    $gxl as node()*,
    $params as xs:string*
) as node()* external

Layout one ore more graphs given in the GXL language and render them as SVG.

Parameters

  • $gxl as node()
    A GXL description of the graph to render.
  • $params as xs:string
    Parameters to configure the layout and rendering process. Currently, only the empty-sequence is allowed here.

Returns

  • node()*

    A graph for each item in the sequence given using the first parameter. The result sequence consists of items which are instance of the SVG data model.

blog comments powered by Disqus