我有一个有序的层次结构,我想使用Graphviz(或其他一些可视化程序)进行绘图。
理想情况下,绘图将绘制节点的前导和尾随矢量,并在层次结构中保持正确的级别。我最不确定的是如何保持层次结构的级别,因为尾随向量可以返回到它们的上级/父级。
如果不清楚我要求的是什么,那么在这段视频的第47分钟https://www.youtube.com/watch?v=sWgDk-o-6ZE,演示文稿中会有一张图片。
我想知道它是否可能以及graphviz(.gv)文件的外观。
谢谢!
答案 0 :(得分:1)
我写了一篇Prolog program来制作谱系树'就像这个
这里的数据库很小,但它适用于较大的数据集...由程序计算的.gv,提交给Graphviz进行渲染:
trip_3<-dput(trip_3)
structure(list(CruiseID = 201602:201605, `Vessel Name` = structure(c(3L,
4L, 2L, 1L), .Label = c("KATE", "F/V Celtic", "F/V Carolina Capes II",
"Sea Hawk"), class = "factor"), LOA = c(NA, NA, 100L, NA), HrsePowr = c(NA,
NA, 1150L, NA), DocNum = c(NA, NA, 591971L, 1159450L), PermNum = c(NA,
NA, 410146L, 410561L), Captain = structure(c(NA, NA, 2L, 1L), .Label = c("William Hullbig",
"Charlie Quinn"), class = "factor"), GearWid = c(14L, NA, 8L,
15L), CrewSize = c(6L, 6L, 6L, 13L), Grounds = structure(c(NA,
3L, 2L, 1L), .Label = c("CAII ", "NLCA", "MAB"), class = "factor"),
DateBeg = structure(c(1462248000, 1463544000, 1464926400,
1466481600), class = c("POSIXct", "POSIXt"), tzone = ""),
DateEnd = structure(c(NA, NA, NA, 1467172800), class = c("POSIXct",
"POSIXt"), tzone = ""), ProjDesc = structure(c(3L, 4L, 2L,
1L), .Label = c("CAII Survey", "2016 RSA NLCA Survey ", "MAB Survey Leg 1",
"2016 RSA MAB Survey Leg 2"), class = "factor"), Comments = structure(c(3L,
4L, 2L, 1L), .Label = c("survey dredge 9 on port and NB dredge on starboard",
"Survey dredge on Port #8, 14 ft NBD on Stbd.", "MAB Survey Leg 1, dredge 8 on starboard side",
"survey dredge on starboard side, no 9"), class = "factor")), .Names = c("CruiseID",
"Vessel Name", "LOA", "HrsePowr", "DocNum", "PermNum", "Captain",
"GearWid", "CrewSize", "Grounds", "DateBeg", "DateEnd", "ProjDesc",
"Comments"), class = "data.frame", row.names = c(3L, 4L, 2L,
1L))
也就是说,每一层都进入自己的子图。我进一步使用子图对父母进行分组。