Skip to content

Commit 44bd863

Browse files
author
Benoit Thieurmel
committed
CRAN 2.0.5
1 parent 446267d commit 44bd863

4 files changed

Lines changed: 27 additions & 64 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: visNetwork
22
Title: Network Visualization using 'vis.js' Library
33
Version: 2.0.5
4-
Date: 2018-07-31
4+
Date: 2018-12-05
55
Authors@R: c(
66
person(family = "Almende B.V.", role = c("aut", "cph"),
77
comment = "vis.js library in htmlwidgets/lib, http://visjs.org, http://www.almende.com/home"),

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ visNetwork 2.0.5
88
* Fix passing icon using visGroup and proxy
99
* Fix passing margin to nodes
1010
* Fix bug passing character to visTree
11-
* Fix legend using only one group
11+
* #290 : Fix legend using only one group
1212

1313
visNetwork 2.0.4
1414
--------------------------------------------------------------------------------

R/visTreeModule.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,15 +1567,15 @@ visTreeModuleUI <- function(id, rpartParams = TRUE, visTreeParams = TRUE, quitBu
15671567
shiny::column(5,
15681568
shiny::selectInput(ns("x"), "X :", NULL, multiple = TRUE, selected = NULL, width = "100%")
15691569
),
1570+
shiny::column(2,
1571+
shiny::numericInput(ns("minsplit"), "Minsplit : ", value = 20, min = 2)
1572+
),
15701573
shiny::column(2,
15711574
shiny::sliderInput(ns("complexity"), "Complexity (cp) :",
15721575
min = 0, max = 1, value = 0.005, step = 0.005)
15731576
),
15741577
shiny::column(1,
15751578
shiny::br(), shiny::br(), shiny::actionButton(ns("set_cp"), "Set cp slider")
1576-
),
1577-
shiny::column(2,
1578-
shiny::numericInput(ns("minsplit"), "Minsplit : ", value = 20, min = 2)
15791579
)
15801580

15811581
)

inst/tests/shiny_collapsed/app.R

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,32 @@
1-
#
2-
# This is a Shiny web application. You can run the application by clicking
3-
# the 'Run App' button above.
4-
#
5-
# Find out more about building applications with Shiny here:
6-
#
7-
# http://shiny.rstudio.com/
8-
#
9-
101
library(shiny)
112
library(visNetwork)
123

13-
# Define UI for application that draws a histogram
144
ui <- shinyUI(fluidPage(
15-
actionButton("goCol", "Collapsed !"),
16-
actionButton("goUC", "uncollapse!"),
17-
actionButton("goRm", "remove event!"),
18-
actionButton("goAdd", "add event!"),
19-
fluidRow(column(4, div(id = "conf")),
20-
column(8, visNetworkOutput("distPlot")))
21-
22-
5+
visNetworkOutput("net")
236
))
247

25-
# Define server logic required to draw a histogram
268
server <- shinyServer(function(input, output) {
27-
28-
output$distPlot <- renderVisNetwork({
29-
set.seed(125)
30-
nodes <- data.frame(id = 1:15, label = paste("Label", 1:15),
31-
group = sample(LETTERS[1:3], 15, replace = TRUE))
32-
33-
edges <- data.frame(from = trunc(runif(15)*(15-1))+1,
34-
to = trunc(runif(15)*(15-1))+1)
35-
36-
visNetwork(nodes, edges) %>% visOptions(highlightNearest = T, collapse = T) %>%
37-
visEdges(arrows = "to") %>% visConfigure(container = "conf")
38-
39-
})
40-
41-
observe({
42-
if(input$goCol > 0){
43-
visNetworkProxy("distPlot") %>%
44-
visCollapse(nodes = c(10,3), clusterOptions = list( shape ="square", label = "and so ?"),
45-
labelSuffix = "Cool")
46-
}
47-
})
48-
49-
observe({
50-
if(input$goUC > 0){
51-
visNetworkProxy("distPlot") %>% visUncollapse(keepCoord = TRUE)
52-
}
53-
})
54-
55-
observe({
56-
if(input$goRm > 0){
57-
visNetworkProxy("distPlot") %>% visEvents(type = "off", doubleClick = "networkOpenCluster")
58-
}
59-
})
60-
61-
observe({
62-
if(input$goAdd > 0){
63-
visNetworkProxy("distPlot") %>% visEvents(type = "on", doubleClick = "networkOpenCluster")
64-
}
65-
})
66-
9+
10+
output$net <- renderVisNetwork({
11+
set.seed(125)
12+
nodes <- data.frame(id = 1:15, label = paste("Label", 1:15), title = paste("Label", 1:15),
13+
group = sample(LETTERS[1:3], 15, replace = TRUE))
14+
15+
edges <- data.frame(from = trunc(runif(15)*(15-1))+1,
16+
to = trunc(runif(15)*(15-1))+1)
17+
18+
# using your own css
19+
# visNetwork(nodes, edges) %>%
20+
# visInteraction(tooltipStyle = "position: fixed;visibility:hidden;text-decoration: underline;")
21+
22+
# default css + text-decoration
23+
visNetwork(nodes, edges) %>%
24+
visInteraction(tooltipStyle = "position: fixed;visibility:hidden;padding: 5px;font-family: verdana;font-size:14px;
25+
font-color:#000000;background-color: #f5f4ed;-moz-border-radius: 3px;-webkit-border-radius: 3px;
26+
border-radius: 3px;border: 1px solid #808074;box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
27+
max-width:400px;word-break: break-all;text-decoration: underline;")
28+
29+
})
6730
})
6831

6932
# Run the application

0 commit comments

Comments
 (0)