Skip to content

Commit d3ce90f

Browse files
committed
start using builder pattern
1 parent 1525272 commit d3ce90f

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ lineup(iris,
4545
![iris advanced output](https://user-images.githubusercontent.com/4129778/48187839-898c0d00-e33c-11e8-9d4a-360bc35741f4.png)
4646

4747

48+
Builder Pattern
49+
---------------
50+
51+
```R
52+
library(magrittr)
53+
54+
lineupBuilder(iris) %>%
55+
buildLineUp()
56+
```
57+
58+
lineupBuilder(shared_iris) %>% buildLineUp(width = "100%")
59+
60+
4861
Crosstalk Example
4962
-------------
5063

examples/shiny/app.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
library(shiny)
1111
library(crosstalk)
1212
library(lineupjs)
13-
library(d3scatter)
13+
library(magrittr)
1414

1515
# Define UI for application that draws a histogram
1616
ui <- fluidPage(
1717
titlePanel("LineUp Shiny Example"),
1818

1919
fluidRow(
20-
column(5, d3scatterOutput("scatter1")),
2120
column(7, lineupOutput("lineup1"))
2221
)
2322
)
@@ -26,12 +25,10 @@ ui <- fluidPage(
2625
server <- function(input, output) {
2726
shared_iris <- SharedData$new(iris)
2827

29-
output$scatter1 <- renderD3scatter({
30-
d3scatter(shared_iris, ~Petal.Length, ~Petal.Width, ~Species, width = "100%")
31-
})
3228

3329
output$lineup1 <- renderLineup({
34-
lineup(shared_iris, width = "100%")
30+
# lineupBuilder(shared_iris) %>% buildLineUp(width = "100%")
31+
lineup(shared_iris, width='100%')
3532
})
3633
}
3734

0 commit comments

Comments
 (0)