| Home | Trees | Index | Help |
|
|---|
| Package yapgvb :: Class GraphBase |
|
Digraph,
Graph| Method Summary | |
|---|---|
GraphBase is a base class used by Graph and Digraph. | |
| Graph Definition | |
Add a node to the graph. | |
Create an edge between two nodes. | |
| Layout and Rendering | |
Process the graph with one of the layout engines supplied by Graphviz. | |
| I/O | |
Render the graph to a file. | |
Output the graph in the dot language format. | |
Read a graph from a dot file. (Class method) | |
| Boost.Graph Compatibility | |
Translate a boost.python graph into a yapgvb graph. (Class method) | |
Translate a graphviz graph into a boost.python graph. | |
| Property Summary | |
|---|---|
| rect | bb: Bounding box of drawing in integer points. |
| str | bgcolor: When attached to the root graph, this color is used as the background
for entire canvas. |
| boolean | center: If true, the drawing is centered in the output canvas. |
| str | charset: Specifies the character encoding used when interpreting string input
as a text label. |
| string | clusterrank: Mode used for handling clusters. |
| str | colorscheme: This attribute specifies a color scheme namespace. |
| str | comment: Comments are inserted into output. |
| boolean | compound: If true, allow edges between clusters. |
| boolean | concentrate: If true, use edge concentrators. |
| float | Damping: Factor damping force motions. |
| float | defaultdist: This specifies the distance between nodes in separate connected
components. |
| int | dim: Set the number of dimensions used for the layout. |
directed: True if directed, False if not. | |
| float | dpi: This specifies the expected number of pixels per inch on a display
device. |
| float | epsilon: Terminating condition. |
| str | fontcolor: Color used for text. |
| str | fontname: Font used for text. |
| str | fontpath: Directory list used by libgd to search for bitmap fonts if Graphviz
was not built with the fontconfig library. |
| float | fontsize: Font size, in points, used for text. |
graph: graph to which this belongs (parent, if a subgraph, otherwise
self) | |
| float | K: Spring constant used in virtual physical model. |
| str | label: Text label attached to objects. |
| str | labeljust: Justification for cluster labels. |
| str | labelloc: Top/bottom placement of graph and cluster labels. |
| boolean | landscape: If true, the graph is rendered in landscape mode. |
| str | layers: Specifies a linearly ordered list of layer names attached to the graph
The graph is then output in separate layers. |
| str | layersep: Specifies the separator characters used to split the layers attribute
into a list of layer names. |
| float | levelsgap: Specifies strictness of level constraints in neato when
mode="hier". |
| (x,y) or (x,y,z) tuple | lp: Label position, in points. |
| float | margin: For graphs, this sets x and y margins of canvas, in inches. |
| int | maxiter: Sets the number of iterations used. |
| float | mclimit: Multiplicative scale factor used to alter the MinQuit (default = 8)
and MaxIter (default = 24) parameters used during crossing
minimization. |
| float | mindist: Specifies the minimum separation between all nodes. |
| str | mode: Technique for optimizing the layout. |
| str | model: This value specifies how the distance matrix is computed for the input
graph. |
| float | nodesep: Minimum space between two adjacent nodes in the same rank, in
inches. |
| boolean | nojustify: By default, the justification of multi-line labels is done within the
largest context that makes sense. |
| boolean | normalize: If set, normalize coordinates of final layout so that the first point
is at the origin, and then rotate the layout so that the first edge is
horizontal. |
| float | nslimit |
| float | nslimit1 |
| str | ordering: If "out" for a graph G, and n is a node in G, then edges
n->* appear left-to-right in the same order in which they are
defined. |
| str | orientation: Angle, in degrees, used to rotate node shapes. |
| string | outputorder: Specify order in which nodes and edges are drawn. |
| str | overlap: Determines if and how node overlaps should be removed. |
| boolean | pack: This is true if the value of pack is "true"
(case-insensitive) or a non-negative integer. |
| string | packmode: This indicates the granularity and method used for packing (cf. |
| pointf | page: Width and height of output pages, in inches. |
| string | pagedir: If the page attribute is set and applicable, this attribute specifies
the order in which the pages are emitted. |
| float | quantum: If quantum > 0.0, node label dimensions will be rounded to integral
multiples of the quantum. |
| string | rankdir: Sets direction of graph layout. |
| float | ranksep: In dot, this the gives desired rank separation, in inches. |
| float | ratio: Sets the aspect ratio (drawing height/drawing width) for the
drawing. |
| boolean | remincross: If true and there are multiple clusters, run cross minimization a
second time. |
| float | resolution: This is a synonym for the dpi attribute. |
| str | root: This specifies nodes to be used as the center of the layout and the
root of the generated spanning tree. |
| int | rotate: If 90, set drawing orientation to landscape. |
| int | samplepoints: If the input graph defines the vertices attribute, and output is dot
or xdot, this give the number of points used to represent circles and
ellipses. |
| int | searchsize: During network simplex, maximum number of edges with negative cut
values to search when looking for one with minimum cut value. |
| float | sep: Fraction to increase polygons (multiply coordinates by 1 + sep) for
purposes of determining overlap. |
| int | showboxes: Print guide boxes in PostScript at the beginning of routesplines if 1,
or at the end if 2. |
| pointf | size: Maximum width and height of drawing, in inches. |
| str | splines: Controls how, and if, edges are represented. |
| string | start: Parameter used to determine the initial layout of nodes. |
strict: True if strict, False if not. | |
| str | stylesheet: A URL or pathname specifying an XML style sheet, used in SVG
output. |
| str | target: If the object has a URL, this attribute determines which window of the
browser is used for the URL. |
| boolean | truecolor: If set explicitly to true or false, the value determines whether or
not internal bitmap rendering relies on a truecolor color model or uses a
color palette. |
URL: Hyperlinks incorporated into device-dependent output. | |
| str | viewport: Clipping window on final drawing. |
| float | voro_margin |
| Graph Traversal | |
nodes: An iterator over all nodes in the graph | |
edges: An iterator of edges contained in the graph. | |
| Instance Method Details |
|---|
add_node(self, name=None, **attributes)Add a node to the graph. If a node of this name exists already, it will be returned and no new node will be created. If no name is specified, a random (and probably unique) name will be assigned. The keyword arguments are (attribute_name, value) pairs; this is a shorthand equivalent to assigning attributes individually: n = mygraph.add_node('node_name', label="Hello World", fontsize=48) is equivalent to: n = mygraph.add_node('node_name') n.label = 'Hello World' n.fontsize = 48 |
add_edge(self, tail, head)Create an edge between two nodes. Returns the created edge object. |
layout(self, engine, rendering_context=None)Process the graph with one of the layout engines supplied by Graphviz.
|
render(self, outstream=<epydoc.imports._DevNull instance at 0x2aaaab84b320>, format=None, rendering_context=None)Render the graph to a file. layout must be called prior to rendering.
|
write(self, output_stream_or_filename=<epydoc.imports._DevNull instance at 0x2aaaab84b320>)Output the graph in the dot language format. To render as an image, use the render() method. To read a dot file, use the __init__ constructor or the read() classmethod. |
to_bgl(ygraph, node_properties=[], edge_properties=[])Translate a graphviz graph into a boost.python graph. The returned translation_map behaves like a dictionary of all corresponding (boost_edge, yapgvb_edge), (yapgvb_edge, boost_edge), (boost_vertex, yapgvb_node), and (yapgvb_node, boost_vertex) key/value pairs.
|
__init__(self,
*args,
**keywords)
GraphBase is a base class used by Graph and Digraph. Do not
instantiate it directly.
|
| Class Method Details |
|---|
read(cls, input_stream_or_filename)Read a graph from a dot file. May be called from either the Digraph or Graph class; either way, the correct directed or undirected graph object will be returned. |
from_bgl(cls, bgraph, node_properties=[], edge_properties=[])Translate a boost.python graph into a yapgvb graph. The returned translation_map behaves like a dictionary of all corresponding (boost_edge, yapgvb_edge), (yapgvb_edge, boost_edge), (boost_vertex, yapgvb_node), and (yapgvb_node, boost_vertex) key/value pairs.
|
| Property Details |
|---|
nodesAn iterator over all nodes in the graph |
edgesAn iterator of edges contained in the graph. |
bbBounding box of drawing in integer points. description of rect type |
centerIf true, the drawing is centered in the output canvas. |
commentComments are inserted into output. Device-dependent |
compoundIf true, allow edges between clusters. (See lhead and ltail below.) |
concentrateIf true, use edge concentrators. |
defaultdistThis specifies the distance between nodes in separate connected components. If set too small, connected components may overlap. Only applicable if pack=false. |
dimSet the number of dimensions used for the layout. The maximum value allowed is 10. |
directedTrue if directed, False if not. Read-only. |
epsilonTerminating condition. If the length squared of all energy gradients are epsilon, the algorithm stops. |
fontcolorColor used for text. |
fontsizeFont size, in points, used for text. |
graphgraph to which this belongs (parent, if a subgraph, otherwise self) |
labelText label attached to objects. If a node's shape is record, then the label can have a special format which describes the record layout. |
landscapeIf true, the graph is rendered in landscape mode. Synonymous with rotate=90 or orientation=landscape. |
layersepSpecifies the separator characters used to split the layers attribute into a list of layer names. |
lpLabel position, in points. |
maxiterSets the number of iterations used. |
mindistSpecifies the minimum separation between all nodes. |
nodesepMinimum space between two adjacent nodes in the same rank, in inches. |
normalizeIf set, normalize coordinates of final layout so that the first point is at the origin, and then rotate the layout so that the first edge is horizontal. |
nslimit |
nslimit1 |
orientationAngle, in degrees, used to rotate node shapes. |
outputorderSpecify order in which nodes and edges are drawn. Possible values: 'breadthfirst', 'nodesfirst', 'edgesfirst' |
quantumIf quantum > 0.0, node label dimensions will be rounded to integral multiples of the quantum. |
remincrossIf true and there are multiple clusters, run cross minimization a second time. |
resolutionThis is a synonym for the dpi attribute. |
rotateIf 90, set drawing orientation to landscape. |
searchsizeDuring network simplex, maximum number of edges with negative cut values to search when looking for one with minimum cut value. |
showboxesPrint guide boxes in PostScript at the beginning of routesplines if 1, or at the end if 2. (Debugging) |
strictTrue if strict, False if not. Read-only. |
stylesheetA URL or pathname specifying an XML style sheet, used in SVG output. |
targetIf the object has a URL, this attribute determines which window of the browser is used for the URL. See W3C documentation. |
viewportClipping window on final drawing. |
voro_margin |
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Tue Feb 21 14:34:48 2006 | http://epydoc.sf.net |