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