5
我试图创建节点,当鼠标悬停在上面时它会改变颜色。在R igraph中创建悬停按钮
我用R(igraph)绘制节点并生成一个网络。
然后我使用cat()创建一个html模板。
但是,我不知道如何链接一个css工作表来创建应该位于节点顶部的悬停按钮。
require(igraph)
htmlfile = file.path('~/Dropbox/Cambridge/PhD/ICAR/AIG/Map/html/', "page1.html")
cat("<html><h1>My first HTML page from R</h1>",file = htmlfile)
cat("\n<br>Hello Web World!", append = TRUE, file = htmlfile)
set.seed(1)
E.circuit.2 <- graph_from_literal(1--2:3:4:5, 2--3,3--2, 4--5)
E.circuit.2
coordinates <- layout_with_dh(E.circuit.2)
coordinates
plot(E.circuit.2)
cat('\n<p><img src="map.png", align="center"></p>', append = TRUE, file = htmlfile)
cat("\n</html>", append = TRUE,file = htmlfile)
我有一个R的基本知识,但我认为这可能会帮助你[RGraphs](http://www.rgraph.net/docs/howto-index.html) – T04435