Row

Plot

---
title: "Friction Stir Weld: Impact Strength"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    theme: lumen
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(crosstalk)
library(dplyr)
library(plotly)
library(DT)
library(ggplot2)

setwd("~/pmd/nldpTest")

results <- read.csv(file = 'results.csv')

my_colnames <- colnames(results)

sd <- SharedData$new(results)
```

Inputs {.sidebar}
-----------------------------------------------------------------------

```{r}

filter_slider("sl1", my_colnames[2], sd, my_colnames[2], round = TRUE)
filter_slider("sl2", my_colnames[3], sd, my_colnames[3], round = TRUE)
filter_slider("sl3", my_colnames[4], sd, my_colnames[4], round = TRUE)
filter_slider("sl4", my_colnames[5], sd, my_colnames[5], round = TRUE)
filter_slider("sl5", my_colnames[6], sd, my_colnames[6], round = TRUE)
```

Row {data-height=600}
-------------------------------------

### Plot

```{r}

fig <- plot_ly(sd, x = ~Index, y = ~Data, type = 'scatter', mode = 'markers', name = ~SETID, text = ~paste('Type: ', Type))
  fig <- fig %>% add_trace(y = ~Fit, type = 'scatter', mode = 'lines', name = ~SETID, line=list(shape="spline"), text = ~paste('Type: Fit'))
  fig <- fig %>% add_trace(y = ~Pred, type = 'scatter', mode = 'markers', name = ~SETID, text = ~paste('Type: Pred'))
  fig <- fig %>% layout(xaxis = list(title = 'Index'), yaxis = list(title = paste(my_colnames[12], "(sorted by fcalced)")))

fig
```