Skip to content

Commit dbb1597

Browse files
author
Benoit Thieurmel
committed
update site
1 parent 8a8d525 commit dbb1597

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3180
-2860
lines changed

datastorm-open.github.io.Rproj

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX

visNetwork/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ all: html
77
html: $(HTML_FILES)
88

99
%.html: %.Rmd _includes/* _output.yaml
10-
Rscript compile.R "$<"
10+
"C:\Program Files\R\R-4.0.3\bin\Rscript.exe" compile.R "$<"
1111

1212
%.html: %.md
13-
Rscript compile.R "$<"
13+
"C:\Program Files\R\R-4.0.3\bin\Rscript.exe" compile.R "$<"
1414

1515
.PHONY: clean
1616
clean:

visNetwork/Nodes.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ visNetwork(nodes, edges, width = "100%") %>%
8686

8787
## Use complex configuration individually
8888

89-
Available since __visNetwork_0.2.1__. When options are available using a list, you can use it in a data.frame with specific notation like this (a dot per level):
89+
When options are available using a list, you can use it in a data.frame with specific notation like this (a dot per level):
9090

9191

9292
```{r}

visNetwork/_includes/after_body.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer>
2-
<p><small> © 2016-2017 DataStorm</small></p>
2+
<p><small> © 2020-2021 DataStorm</small></p>
33
</footer>
44

55
</div>

visNetwork/compile.R

+10-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
set.seed(0102)
33
# Sys.setenv(R_LIBS_USER = "C:/Users/Datastorm/Documents/R/win-library/3.3")
44
# Sys.getenv()
5-
library(knitr, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
5+
lib_path <- "C:/Users/BenoitThieurmel/Documents/R/win-library/4.0"
6+
library(knitr, lib.loc = lib_path)
67
options(htmlwidgets.TOJSON_ARGS = list(pretty = TRUE))
78
Sys.setenv(R_KNITR_OPTIONS = 'knitr.chunk.tidy = FALSE')
89
Sys.setenv(RSTUDIO_PANDOC = "C:/Program Files/RStudio/bin/pandoc")
910

1011
knitr::opts_chunk$set(out.width = '100%')
1112

12-
library(visNetwork, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
13-
library(rmarkdown, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
14-
library(yaml, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
15-
library(stringr, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
16-
library(evaluate, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
17-
library(curl, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
18-
library(igraph, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
19-
library(sparkline, lib.loc ="C:/Users/Datastorm/Documents/R/win-library/3.4")
13+
library(visNetwork, lib.loc = lib_path)
14+
library(rmarkdown, lib.loc = lib_path)
15+
library(yaml, lib.loc =lib_path)
16+
library(stringr, lib.loc =lib_path)
17+
library(evaluate, lib.loc =lib_path)
18+
library(curl, lib.loc =lib_path)
19+
library(igraph, lib.loc =lib_path)
20+
library(sparkline, lib.loc =lib_path)
2021

2122
print(pandoc_version())
2223
f = rmarkdown::render(commandArgs(TRUE))

visNetwork/configure.Rmd

+15
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ visNetwork(nodes, edges, width = "100%") %>%
2222
<div style="text-align:center" markdown="1">
2323
<img src="images/ex_configure.png" alt="Drawing" style="width: 600px;"/>
2424
</div>
25+
26+
## or prefer the shiny app / module visNetworkEditor !
27+
28+
```{r, eval = FALSE}
29+
nodes <- data.frame(id = 1:3, label = paste("Node", 1:3))
30+
edges <- data.frame(from = c(1,2), to = c(1,3), label = paste("Edge", 1:2))
31+
network <- visNetwork(nodes, edges)
32+
33+
custom_network <- visNetworkEditor(object = network)
34+
custom_network
35+
```
36+
37+
<div style="text-align:center" markdown="1">
38+
<img src="images/ex_editor.png" alt="Drawing" style="width: 600px;"/>
39+
</div>

visNetwork/configure.html

+125-50
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
<!DOCTYPE html>
22

3-
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<html>
44

55
<head>
66

77
<meta charset="utf-8" />
8-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
98
<meta name="generator" content="pandoc" />
9+
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
1010

1111

1212

1313

1414
<title>Configure tools</title>
1515

16+
<script src="libs/header-attrs/header-attrs.js"></script>
1617
<script src="libs/jquery/jquery.min.js"></script>
1718
<meta name="viewport" content="width=device-width, initial-scale=1" />
1819
<link href="libs/bootstrap/css/cosmo.min.css" rel="stylesheet" />
1920
<script src="libs/bootstrap/js/bootstrap.min.js"></script>
2021
<script src="libs/bootstrap/shim/html5shiv.min.js"></script>
2122
<script src="libs/bootstrap/shim/respond.min.js"></script>
23+
<style>h1 {font-size: 34px;}
24+
h1.title {font-size: 38px;}
25+
h2 {font-size: 30px;}
26+
h3 {font-size: 24px;}
27+
h4 {font-size: 18px;}
28+
h5 {font-size: 16px;}
29+
h6 {font-size: 12px;}
30+
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
31+
pre:not([class]) { background-color: white }</style>
2232
<script src="libs/navigation/tabsets.js"></script>
2333
<link href="libs/highlightjs/default.css" rel="stylesheet" />
2434
<script src="libs/highlightjs/highlight.js"></script>
2535

26-
<style type="text/css">code{white-space: pre;}</style>
2736
<style type="text/css">
28-
pre:not([class]) {
29-
background-color: white;
30-
}
31-
</style>
37+
code{white-space: pre-wrap;}
38+
span.smallcaps{font-variant: small-caps;}
39+
span.underline{text-decoration: underline;}
40+
div.column{display: inline-block; vertical-align: top; width: 50%;}
41+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
42+
ul.task-list{list-style: none;}
43+
</style>
44+
45+
<style type="text/css">code{white-space: pre;}</style>
3246
<script type="text/javascript">
3347
if (window.hljs) {
3448
hljs.configure({languages: []});
@@ -41,76 +55,108 @@
4155

4256

4357

44-
<style type="text/css">
45-
h1 {
46-
font-size: 34px;
47-
}
48-
h1.title {
49-
font-size: 38px;
50-
}
51-
h2 {
52-
font-size: 30px;
53-
}
54-
h3 {
55-
font-size: 24px;
56-
}
57-
h4 {
58-
font-size: 18px;
59-
}
60-
h5 {
61-
font-size: 16px;
62-
}
63-
h6 {
64-
font-size: 12px;
65-
}
66-
.table th:not([align]) {
67-
text-align: left;
68-
}
69-
</style>
7058

7159

72-
</head>
7360

74-
<body>
61+
7562

7663
<style type = "text/css">
7764
.main-container {
7865
max-width: 940px;
7966
margin-left: auto;
8067
margin-right: auto;
8168
}
82-
code {
83-
color: inherit;
84-
background-color: rgba(0, 0, 0, 0.04);
85-
}
8669
img {
8770
max-width:100%;
88-
height: auto;
8971
}
9072
.tabbed-pane {
9173
padding-top: 12px;
9274
}
75+
.html-widget {
76+
margin-bottom: 20px;
77+
}
9378
button.code-folding-btn:focus {
9479
outline: none;
9580
}
81+
summary {
82+
display: list-item;
83+
}
84+
pre code {
85+
padding: 0;
86+
}
9687
</style>
9788

9889

9990

100-
<div class="container-fluid main-container">
101-
10291
<!-- tabsets -->
103-
<script>
104-
$(document).ready(function () {
105-
window.buildTabsets("TOC");
106-
});
107-
</script>
92+
93+
<style type="text/css">
94+
.tabset-dropdown > .nav-tabs {
95+
display: inline-table;
96+
max-height: 500px;
97+
min-height: 44px;
98+
overflow-y: auto;
99+
border: 1px solid #ddd;
100+
border-radius: 4px;
101+
}
102+
103+
.tabset-dropdown > .nav-tabs > li.active:before {
104+
content: "";
105+
font-family: 'Glyphicons Halflings';
106+
display: inline-block;
107+
padding: 10px;
108+
border-right: 1px solid #ddd;
109+
}
110+
111+
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
112+
content: "&#xe258;";
113+
border: none;
114+
}
115+
116+
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
117+
content: "";
118+
font-family: 'Glyphicons Halflings';
119+
display: inline-block;
120+
padding: 10px;
121+
border-right: 1px solid #ddd;
122+
}
123+
124+
.tabset-dropdown > .nav-tabs > li.active {
125+
display: block;
126+
}
127+
128+
.tabset-dropdown > .nav-tabs > li > a,
129+
.tabset-dropdown > .nav-tabs > li > a:focus,
130+
.tabset-dropdown > .nav-tabs > li > a:hover {
131+
border: none;
132+
display: inline-block;
133+
border-radius: 4px;
134+
background-color: transparent;
135+
}
136+
137+
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
138+
display: block;
139+
float: none;
140+
}
141+
142+
.tabset-dropdown > .nav-tabs > li {
143+
display: none;
144+
}
145+
</style>
108146

109147
<!-- code folding -->
110148

111149

112150

113151

152+
</head>
153+
154+
<body>
155+
156+
157+
<div class="container-fluid main-container">
158+
159+
114160

115161
<style type="text/css">
116162
body {
@@ -177,7 +223,7 @@
177223
</div>
178224
<div class="col-sm-9 content-body">
179225

180-
<div class="fluid-row" id="header">
226+
<div id="header">
181227

182228

183229

@@ -198,9 +244,21 @@ <h2>Use <strong>visConfigure()</strong> to configure and view options directly o
198244
<p><img src="images/ex_configure.png" alt="Drawing" style="width: 600px;"/></p>
199245
</div>
200246
</div>
247+
<div id="or-prefer-the-shiny-app-module-visnetworkeditor" class="section level2">
248+
<h2>or prefer the shiny app / module visNetworkEditor !</h2>
249+
<pre class="r"><code>nodes &lt;- data.frame(id = 1:3, label = paste(&quot;Node&quot;, 1:3))
250+
edges &lt;- data.frame(from = c(1,2), to = c(1,3), label = paste(&quot;Edge&quot;, 1:2))
251+
network &lt;- visNetwork(nodes, edges)
252+
253+
custom_network &lt;- visNetworkEditor(object = network)
254+
custom_network</code></pre>
255+
<div style="text-align:center" markdown="1">
256+
<p><img src="images/ex_editor.png" alt="Drawing" style="width: 600px;"/></p>
257+
</div>
258+
</div>
201259

202260
<footer>
203-
<p><small> © 2016-2017 DataStorm</small></p>
261+
<p><small> © 2020-2021 DataStorm</small></p>
204262
</footer>
205263

206264
</div>
@@ -216,7 +274,7 @@ <h2>Use <strong>visConfigure()</strong> to configure and view options directly o
216274

217275
// add bootstrap table styles to pandoc tables
218276
function bootstrapStylePandocTables() {
219-
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
277+
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
220278
}
221279
$(document).ready(function () {
222280
bootstrapStylePandocTables();
@@ -225,6 +283,23 @@ <h2>Use <strong>visConfigure()</strong> to configure and view options directly o
225283

226284
</script>
227285

286+
<!-- tabsets -->
287+
288+
<script>
289+
$(document).ready(function () {
290+
window.buildTabsets("TOC");
291+
});
292+
293+
$(document).ready(function () {
294+
$('.tabset-dropdown > .nav-tabs > li').click(function () {
295+
$(this).parent().toggleClass('nav-tabs-open');
296+
});
297+
});
298+
</script>
299+
300+
<!-- code folding -->
301+
302+
228303
<!-- dynamically load mathjax for compatibility with self-contained -->
229304
<script>
230305
(function () {

visNetwork/edges.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ visNetwork(nodes, edges, width = "100%") %>%
8585

8686
## Use complex configuration individually
8787

88-
Available since __visNetwork_0.2.1__. When options are available using a list, you can use it in a data.frame with specific notation like this :
88+
When options are available using a list, you can use it in a data.frame with specific notation like this :
8989

9090

9191
```{r}

0 commit comments

Comments
 (0)