我试图创建节点,当鼠标悬停在上面时,节点会改变颜色。
我使用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)