dynamicGraphMain(vertexList, visibleVertices = 1:length(vertexList),
edgeList = NULL, blockList = NULL, blockEdgeList = NULL,
blockTree = NULL, oriented = FALSE,
factorVertexList = NULL, factorEdgeList = NULL,
extraList = NULL,
object = NULL, objectName = "",
vertexClasses = validVertexClasses(),
title = "dynamicGraph", transformation = NULL,
width = 400, height = 400, w = 6,
vertexColor = "blue", extraVertexColor = "black",
edgeColor = "blue",
factorVertexColor = "green", factorEdgeColor = "green",
blockEdgeColor = "default", blockColors = NULL,
background = "white", closeenough = 2,
drawBlockFrame = TRUE, drawBlockBackground = TRUE,
UserMenus = NULL,
hasMethods = TRUE, enterLeaveUpdate = TRUE,
namesOnEdges = TRUE, updateEdgeLabels = TRUE,
debug.strata = FALSE, debug.edges = FALSE,
debug.position = FALSE, debug.update = FALSE,
returnLink = FALSE, returnNull = FALSE, ...)
VertexProto
)
created by returnVertexList
or exported from dy
vertexList
to plot.EdgeProto
)
created by returnEdgeList
or exported from dynamicGraphMain
.BlockProto
)
created by setBlocks
or exported from dynamicGraphMain
.
If the BlockEdgeProto
)
created by returnBlockEdgeList
or exported from
BlockProto
)
created by setTreeBlocks
or exported from dynamicGraphMain
.FactorVertexProto
)
created by returnFacto
FactorEdgeProto
)
created by returnFactorEdgeList
or exported from VertexProto
)
created by returnVertexList
or exported from dynamicGraphM
modifyModel
and testEdge
- for respectively updating the
object when the graph is updated, and for compvalidVertexClasses
,
or extension of this matrix. Used when creating
new vertices in dynamicGraphMain
.radius
of the vertices. Send as argument to the
draw
method for vertices, and edges are shortened
by the quantity in each end.dynamicGraphMain
(by newVertex
).
The colors of the verticesvertexColor
, but for the vertices of
extraList
.edgeColor
is similar to vertexColor
.factorVertexColor
is similar to
vertexColor
.
If factorVertexColor
is "default" then
the color of a factor vertex will depend on the
type of the generator ofactorEdgeColor
is similar to edgeColor
.blockEdgeColor
is similar to edgeColor
.
The two colors are used for respectively edges
between two blocks and for edges between blocks
and vertvertexColor
: Only used when creating
new blocks, else the colors set in blockList
and blockTree
are used.tkcanvas
.block canvas
is
drawn, with color set by blockColors
.redrawGraphWindow
for an example of a user specified menu.object
should have the methods
modifyModel
and testEdge
.
(I do not know why the R-functreturnLink
is TRUE then a reference
to the dynamic graph window is returned, else an object
of class GraphLatticeProto-class
returnNull
is TRUE then NULL is returned.returnLink
is TRUE then a reference (an object of class "list")
to the dynamic graph window is returned, else an object of class
GraphLatticeProto-class
is returned (if not returnNull
is TRUE) The function redrawGraphWindow
of the returned reference
is used to draw other graphs in the graph window or to create slave
graphs windows, see addGraph
.
The object of class GraphLatticeProto
will
beside the list of canvases of the graph window and slave windows,
also hold lists of vertices and blocks (block trees).
CanvasProto
.
Might, beside slots for accessing the graph window, also hold
slots for edges, factors, factor edges, block edges, etc.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.
Biometry/Software-Datasets/CoCo/CoCo.1.6/
with a guide at dynamicGraph
.DynamicGraph
and all the other functions
of this package. An example has been divided on the following 4 manual pages:
newDefaultModelObject
and
newDefaultTestObject
gives an example of a model object with test object.
The pages of redrawGraphWindow
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 files ".../dynamicGraph/Tests/Circle.newClass.R"
of
the example catalog 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, w = 4)
Run the code above in your browser using DataLab