【发布时间】:2016-01-04 01:09:32
【问题描述】:
我正在尝试创建当鼠标悬停在节点上时会改变颜色的节点。
我使用 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