dynamicGraphMain(vertexList = NULL, blockList = NULL,
dg = NULL, object = NULL, objectName = NULL,
control = dg.control(...), ...)
dg.Vertex
)
created by returnVertexList
or exported from dyna
dg.Block
)
created by setBlocks
or exported from dynamicGraphMain
.dg
is an object of class
dg.graphedges-class
.modifyModel
and testEdge
- for respectively updating the
object when the graph is updated, and for compdynamicGraphMain
,
see dg.control
.DynamicGraph-class
(if not returnNull
is TRUE)
with the lists of vertices and blocks (block trees) of the dynamicGraph,
and list of models, each (of class DynamicGraphModel-class
)
with the views of the model. Each view (of class DynamicGraphView-class
) of a model
will hold the edges (edges between vertices, factors and blocks)
and factor- and extra-vertices of the view,
together with which vertices and blocks are visible in the view.
object
drawBlockBackground
is set to TRUE) to get the pop up
menu of opened block:
The function is incremental in the sense that the user can add a method for updating the model object of the window when the graph is updated, and a method for computing the test of an edge when the edge is clicked by the mouse. Edges can be oriented, drawn by arrows. Blocks can be used to define a causal structure of the variables represented by vertices, and edges between blocks are then oriented. Blocks can be given in a structure such that descendant blocks of a blocks also are closed when a block is closed. A secondary set of vertices, factor vertices, can be used to represent hypergraphs. "Slave graph windows" can be created: The windows will share vertices and blocks, thus when a vertex is moved in one window, the position of the vertex will also change in all slave windows. The edges are not shared among windows, since the individual windows will typical represent different models. Thus factors (vertices and edges) are not shared between graph windows.
dynamicGraph
.DynamicGraph
and all the other functions
of this package. An example has been divided on the following 4 manual pages:
dg.Model-class
and dg.Test-class
gives an example of a model object with test object.
The pages of dg.graphedges-class
show how the user
can add menu items with actions that redraws the graph
after modification of edges.
Finally, validVertexClasses
show how to create
a new vertex class with a new symbol for drawing the vertex
and an item added to the pop up menu of the new vertex class.
The demo demo(Circle.newClass)
of dynamicGraph
will do this example collected from these 4 pages.
require(tcltk)
require(dynamicGraph)
V.Names <- paste(c("Sex", "Age", "Eye", "FEV", "Hair", "Shosize"),
1:6, sep ="/")
V.Types <- c("Discrete", "Ordinal", "Discrete",
"Continuous", "Discrete", "Continuous")
Vertices <- returnVertexList(V.Names, types = V.Types, color = "red")
From <- c(1, 2, 3, 4, 5, 6)
To <- c(2, 3, 4, 5, 6, 1)
EdgeList <- vector("list", length(To))
for (j in seq(along = To)) EdgeList[[j]] <- c(From[j], To[j])
Edges <- returnEdgeList(EdgeList, Vertices, color = "black")
# Z <- dynamicGraphMain(Vertices, edgeList = Edges, control = dg.control(w = 4))
graph <- new("dg.graph", vertexList = Vertices, edgeList = Edges)
W <- dg(graph, control = dg.control(w = 4))
Run the code above in your browser using DataLab