Skip to content

Instantly share code, notes, and snippets.

name: "site"
output:
html_document:
theme: sketchy
bootstrap_version: 4
theme_variables:
primary: pink
font-size-base: 1.5rem
navbar:
title: "My Website"
library(shiny)
mtcars$.key <- row.names(mtcars)
ui <- fluidPage(
  plotlyOutput("scatter"),
  plotlyOutput("bars")
)
server <- function(input, output, session) {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---
title: "Subapp test"
output: html_document
runtime: shiny
---
Check your JS console for errors
```{r}
library(shiny)
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
---
title: "dash"
output: flexdashboard::flex_dashboard
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(tidyverse)
library(plotly)
---
title: "Untitled"
output: html_document
runtime: shiny_prerendered
---
```{r}
library(plotly)
plotlyOutput("p")
```
---
title: "Untitled"
output: html_document
runtime: shiny_prerendered
---
```{r}
library(leaflet)
leafletOutput("map")
```
<head>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="graph"></div>
<script>
var dat = [{
"x": [1,2,3,4,5],
@cpsievert
cpsievert / line-on-brush.R
Created February 9, 2018 17:00
Draw line shapes outlining brush
library(plotly)
library(crosstalk)
library(htmlwidgets)
mtcars %>%
SharedData$new() %>%
plot_ly(x = ~wt, y = ~mpg) %>%
highlight("plotly_selected", dynamic = TRUE) %>%
onRender(
"function(el, x) {