r - visnetwork r中的表达式标签
问题描述
是否可以在可见网络的节点标签处使用下标或上标表达式?或者是否可以在情节之后更改标签?
nodes <- data.frame(id = 1:10,
# add labels on nodes
label = paste("N[", 1:10,"]", sep = ""),
# add groups on nodes
group = c("GrA", "GrB"),
# size adding value
value = 1:10,
# control shape of nodes
shape = c("square", "triangle", "box", "circle", "dot", "star",
"ellipse", "database", "text", "diamond"),
# tooltip (html or character), when the mouse is above
title = paste0("<p><b>", 1:10,"</b><br>Node !</p>"),
# color
color = c("darkred", "grey", "orange", "darkblue", "purple"),
# shadow
shadow = c(FALSE, TRUE, FALSE, TRUE, TRUE))
# head(nodes)
# id label group value shape title color shadow
# 1 Node 1 GrA 1 square <p><b>1</b><br>Node !</p> darkred FALSE
# 2 Node 2 GrB 2 triangle <p><b>2</b><br>Node !</p> grey TRUE
edges <- data.frame(from = c(1,2,5,7,8,10), to = c(9,3,1,6,4,7))
visNetwork(nodes, edges, height = "500px", width = "100%")
解决方案
推荐阅读
- nlp - 使用 NLP 分析从文本中删除特殊字符
- java - 将 TextView 隐藏在另一个视图下方的问题
- flutter - 如何让 Flutter Draggable 与 Agora Video 框架一起工作
- rest - 接收 bool 值作为对 http 请求的响应
- java - 将 spring-cloud-starter-kubernetes-config 添加为依赖项时引发 Kubernetes 客户端(证书)异常
- react-native - React Native Typescript 中的 Jest 和酶测试
- sql - 如果是 SQL 中的字母,如何选择子字符串但省略最后一个字符
- javascript - 使用变换时减小图像的大小:scale()
- java - 为什么对话框没有关闭而 MainActivity 没有打开?
- python-3.x - 缩小图像中的边界框