Skip to content

Commit 7278d0d

Browse files
Merge pull request #41 from plotly/what-about-dash
add what about dash section
2 parents 0d78b86 + 05aaaa7 commit 7278d0d

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
sudo apt-get install -y pandoc libudunits2-dev libgdal-dev libxt-dev libglu1-mesa-dev libfftw3-dev
2828
sudo R -e 'install.packages(c("curl", "devtools", "mvtnorm")); devtools::install_github("hypertidy/anglr"); devtools::install_github("johannesbjork/LaCroixColoR"); devtools::install_github("ropensci/plotly"); install.packages("BiocManager"); BiocManager::install("EBImage"); devtools::install_deps(dependencies = TRUE) '
2929
- save_cache:
30-
key: cache3
30+
key: cache4
3131
paths:
3232
- "/usr/local/lib/R/site-library"
3333
- store_artifacts:
@@ -41,8 +41,8 @@ jobs:
4141
mkdir build
4242
mkdir build/ggplot2
4343
mkdir build/r
44-
for i in r/*.Rmd; do Rscript -e "rmarkdown::render('$i', output_dir='build/r')"; done
45-
for i in ggplot2/*.Rmd; do Rscript -e "rmarkdown::render('$i', output_dir='build/ggplot2')"; done
44+
for i in r/*.Rmd; do cat what-about-dash.md >> $i; Rscript -e "rmarkdown::render('$i', output_dir='build/r')"; done
45+
for i in ggplot2/*.Rmd; do cat what-about-dash.md >> $i; Rscript -e "rmarkdown::render('$i', output_dir='build/ggplot2')"; done
4646
python3 -m venv venv
4747
. venv/bin/activate
4848
pip3 install python-frontmatter

what-about-dash.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
### What About Dash?
3+
4+
[Dash for R](https://dashr.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library.
5+
6+
Learn about how to install Dash for R at https://dashr.plot.ly/installation.
7+
8+
Everywhere in this page that you see `fig`, you can display the same figure in a Dash for R application by passing it to the `figure` argument of the [`Graph` component](https://dashr.plot.ly/dash-core-components/graph) from the built-in `dashCoreComponents` package like this:
9+
10+
```{r eval=FALSE}
11+
library(plotly)
12+
13+
fig <- plot_ly()
14+
# fig <- fig %>% add_trace( ... )
15+
# fig <- fig %>% layout( ... )
16+
17+
library(dash)
18+
library(dashCoreComponents)
19+
library(dashHtmlComponents)
20+
21+
app <- Dash$new()
22+
app$layout(
23+
htmlDiv(
24+
list(
25+
dccGraph(figure=fig)
26+
)
27+
)
28+
)
29+
30+
app$run_server(debug=TRUE, dev_tools_hot_reload=FALSE)
31+
```

0 commit comments

Comments
 (0)