visNetwork边缘未显示

时间:2017-03-07 10:10:11

标签: r

我正在尝试使用visNetwork绘制网络。但是,没有显示边缘。 stackoverflow中有一个非常类似的问题。但那里提到的解决方案并不适用于我的情况。任何帮助都会很棒。以下是需要绘制的节点和边数据集。

why doesn't this visNetwork in R show edge

nodes_CTP

   ID         label
1   0         order
2   1       details
3   2           tab
4   3      displays
5   4       profile
6   5        window
7   6        status
8   7          sign
9   8   powerorders
10  9        detail
11 10        button
12 11  prerequisite
13 12          icon
14 13 prerequisites
15 14         chart
16 15       control
17 16         entry
18 17     encounter
19 18        change
20 19        verify
21 20       purpose    

links_CTP

   from to value
1     0  1  0.55
2     0  2  0.53
3     0  3  0.50
4     0  4  0.50
5     0  5  0.49
6     0  6  0.48
7     0  7  0.44
8     0  8  0.43
9     0  9  0.42
10    0 10  0.41
11    0 11  0.39
12    0 12  0.39
13    0 13  0.38
14    0 14  0.38
15    0 15  0.38
16    0 16  0.37
17    0 17  0.37
18    0 18  0.37
19    0 19  0.37
20    0 20  0.37

library(visNetwork)

 visNetwork(nodes_CTP, links_CTP, height = "700px", width = "100%") %>%
  visOptions(selectedBy = "label", 
         highlightNearest = TRUE, 
         nodesIdSelection = TRUE) %>%
  visPhysics(stabilization = FALSE)

1 个答案:

答案 0 :(得分:0)

这对我来说很好。验证数据格式(类和名称)。

def question1(request):
    question_form = QuestionForm()
    if request.method == 'POST':
        form = QuestionForm(request.POST)
        if form.is_valid():
            return render(request, 'music.questions2,html')
    return render(request, 'music/question1.html', locals())
相关问题