Skip to content

Commit 0faade2

Browse files
authored
Merge pull request #19 from lineupjs/develop
upgrade setup and release to CRAN
2 parents 0f23d26 + 0d31c9d commit 0faade2

File tree

10 files changed

+76
-118
lines changed

10 files changed

+76
-118
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ node_modules
1313
^\.bumpversion\.cfg$
1414
^\.editorconfig$
1515
^\.lintr$
16+
^docs$
1617
^Makefile$
1718
^CRAN-SUBMISSION$

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/setup-node@v3
1414
- uses: r-lib/actions/setup-r@v1
1515
with:
16-
r-version: 3.6
16+
r-version: 4.2
1717
- uses: r-lib/actions/setup-pandoc@v1
1818
- name: Cache R packages
1919
uses: actions/cache@v2
@@ -44,10 +44,6 @@ jobs:
4444
run: styler::style_dir(filetype=c('R', 'Rmd'), dry="fail")
4545

4646
- name: Build Package
47-
env:
48-
GITHUB_PAT: ''
49-
GITHUB_TOKEN: ''
50-
CI: ''
5147
shell: Rscript {0}
5248
run: |
5349
devtools::document()
@@ -62,9 +58,6 @@ jobs:
6258
- name: Check
6359
env:
6460
_R_CHECK_CRAN_INCOMING_REMOTE_: false
65-
GITHUB_PAT: ''
66-
GITHUB_TOKEN: ''
67-
CI: ''
6861
shell: Rscript {0}
6962
run: devtools::check(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
7063

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 4.3.0
2-
Date: 2022-07-28 01:13:21 UTC
3-
SHA: 183d4c30dd7a561518ae8093b89c4c156269fe6a
1+
Version: 4.6.0
2+
Date: 2022-08-12 00:38:58 UTC
3+
SHA: 1fec4f1a3a68b4b88da3b637ebaaf62b30d9b5da

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Title: 'HTMLWidget' Wrapper of 'LineUp' for Visual Analysis of Multi-Attribute R
44
Description: 'LineUp' is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes.
55
This is a 'htmlwidget' wrapper around the JavaScript library 'LineUp.js'.
66
It is designed to be used in 'R Shiny' apps and 'R Markddown' files.
7-
Due to an outdated 'webkit' version of 'RStudio' it won't work in the intergrated viewer.
8-
Version: 4.3.0
9-
Date: 2021-08-30
7+
Due to an outdated 'webkit' version of 'RStudio' it won't work in the integrated viewer.
8+
Version: 4.6.0
9+
Date: 2022-08-10
1010
Authors@R: person("Samuel", "Gratzl", email = "[email protected]", role = c("aut", "cre"))
1111
Maintainer: Samuel Gratzl <[email protected]>
1212
URL: https://github.com/lineupjs/lineup_htmlwidget/
@@ -24,8 +24,8 @@ Suggests:
2424
testthat,
2525
lintr,
2626
remotes,
27-
styler
28-
LazyData: true
27+
styler,
28+
shiny
2929
RoxygenNote: 7.2.0
3030
VignetteBuilder: knitr
3131
Language: en-US

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ export(renderLineup)
1010
export(renderTaggle)
1111
export(taggle)
1212
export(taggleOutput)
13-
importFrom(htmlwidgets,shinyRenderWidget)
14-
importFrom(htmlwidgets,shinyWidgetOutput)

R/lineup.R

Lines changed: 55 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
defaultSlopeGraphMode = "item",
1717
ignoreUnsupportedBrowser = FALSE
1818
)
19-
#' taggle - factory for Taggle HTMLWidget
19+
20+
#' lineup builder pattern function
2021
#'
2122
#' @param data data frame like object i.e. also crosstalk shared data frame
2223
#' @param options LineUp options
@@ -43,12 +44,11 @@
4344
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
4445
#' }
4546
#'
46-
#' @return lineup builder objects
47+
#' @return lineup builder object
4748
#'
4849
#' @examples
4950
#' \dontrun{
50-
#' taggle(mtcars)
51-
#' taggle(iris)
51+
#' lineupBuilder(iris) |> buildLineUp()
5252
#' }
5353
#'
5454
#' @export
@@ -130,16 +130,20 @@ lineupBuilder <- function(data,
130130
}
131131
}
132132

133-
#' lineup - factory for LineUp HTMLWidget
133+
#' factory for LineUp HTMLWidget based on a LineUpBuilder
134134
#'
135135
#' @param x LineUpBuilder object
136136
#' @param width width of the element
137137
#' @param height height of the element
138138
#' @param elementId unique element id
139139
#' @param dependencies include crosstalk dependencies
140140
#'
141-
#' @return html lineup widget
141+
#' @return lineup html widget
142142
#'
143+
#' @examples
144+
#' \dontrun{
145+
#' lineupBuilder(iris) |> buildLineUp()
146+
#' }
143147
#' @export
144148
buildLineUp <- function(x, width = "100%",
145149
height = NULL,
@@ -148,16 +152,15 @@ buildLineUp <- function(x, width = "100%",
148152
.buildLineUpWidget(x, width, height, elementId, dependencies, lineupType = "lineup")
149153
}
150154

151-
#' taggle - factory for Taggle HTMLWidget
155+
#' factory for LineUp HTMLWidget based on a LineUpBuilder
156+
#' @inheritParams buildLineUp
152157
#'
153-
#' @param x LineUpBuilder object
154-
#' @param width width of the element
155-
#' @param height height of the element
156-
#' @param elementId unique element id
157-
#' @param dependencies include crosstalk dependencies
158+
#' @return taggle html widget
158159
#'
159-
#' @return html taggle widget
160-
160+
#' @examples
161+
#' \dontrun{
162+
#' lineupBuilder(iris) |> buildTaggle()
163+
#' }
161164
#' @export
162165
buildTaggle <- function(x, width = "100%",
163166
height = NULL,
@@ -169,40 +172,18 @@ buildTaggle <- function(x, width = "100%",
169172

170173
#' lineup - factory for LineUp HTMLWidget
171174
#'
172-
#' @param data data frame like object i.e. also crosstalk shared data frame
175+
#' @inheritParams lineupBuilder
173176
#' @param width width of the element
174177
#' @param height height of the element
175178
#' @param elementId unique element id
176-
#' @param options LineUp options
177-
#' @param ranking ranking definition created using \code{\link{lineupRanking}}
178179
#' @param dependencies include crosstalk dependencies
179180
#' @param ... additional ranking definitions like 'ranking1=...' due to restrictions in converting parameters
180181
#'
181-
#' @section LineUp options:
182-
#' \describe{
183-
#' \item{filterGlobally}{whether filter within one ranking applies to all rankings (default: TRUE)}
184-
#' \item{singleSelection}{restrict to single item selection (default: FALSE}
185-
#' \item{noCriteriaLimits}{allow more than one sort and grouping criteria (default: FALSE)}
186-
#' \item{animated}{use animated transitions (default: TRUE)}
187-
#' \item{sidePanel}{show side panel (TRUE, FALSE, 'collapsed') (default: 'collapsed')}
188-
#' \item{hierarchyIndicator}{show sorting and grouping hierarchy indicator (TRUE, FALSE) (default: TRUE)}
189-
#' \item{labelRotation}{how many degrees should a label be rotated in case of narrow columns (default: 0)}
190-
#' \item{summaryHeader}{show summary histograms in the header (default: TRUE)}
191-
#' \item{overviewMode}{show overview mode in Taggle by default (default: FALSE)}
192-
#' \item{expandLineOnHover}{expand to full row height on mouse over (default: FALSE)}
193-
#' \item{defaultSlopeGraphMode}{default slope graph mode: item,band (default: 'item')}
194-
#' \item{ignoreUnsupportedBrowser}{ignore unsupported browser detection at own risk (default: FALSE)}
195-
#' \item{rowHeight}{height of a row in pixel (default: 18)}
196-
#' \item{rowPadding}{padding between two rows in pixel (default: 2)}
197-
#' \item{groupHeight}{height of an aggregated group in pixel (default: 40)}
198-
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
199-
#' }
200-
#'
201-
#' @return html lineup widget
182+
#' @inheritSection lineupBuilder LineUp options
183+
#' @return lineup html widget
202184
#'
203185
#' @examples
204186
#' \dontrun{
205-
#' lineup(mtcars)
206187
#' lineup(iris)
207188
#' }
208189
#'
@@ -222,40 +203,14 @@ lineup <- function(data,
222203

223204
#' taggle - factory for Taggle HTMLWidget
224205
#'
225-
#' @param data data frame like object i.e. also crosstalk shared data frame
226-
#' @param width width of the element
227-
#' @param height height of the element
228-
#' @param elementId unique element id
229-
#' @param options LineUp options
230-
#' @param ranking ranking definition created using \code{\link{lineupRanking}}
231-
#' @param dependencies include crosstalk dependencies
206+
#' @inheritParams lineup
232207
#' @param ... additional ranking definitions like 'ranking1=...' due to restrictions in converting parameters
208+
#' @inheritSection lineup LineUp options
233209
#'
234-
#' @section LineUp options:
235-
#' \describe{
236-
#' \item{filterGlobally}{whether filter within one ranking applies to all rankings (default: TRUE)}
237-
#' \item{singleSelection}{restrict to single item selection (default: FALSE}
238-
#' \item{noCriteriaLimits}{allow more than one sort and grouping criteria (default: FALSE)}
239-
#' \item{animated}{use animated transitions (default: TRUE)}
240-
#' \item{sidePanel}{show side panel (TRUE, FALSE, 'collapsed') (default: 'collapsed')}
241-
#' \item{hierarchyIndicator}{show sorting and grouping hierarchy indicator (TRUE, FALSE) (default: TRUE)}
242-
#' \item{labelRotation}{how many degrees should a label be rotated in case of narrow columns (default: 0)}
243-
#' \item{summaryHeader}{show summary histograms in the header (default: TRUE)}
244-
#' \item{overviewMode}{show overview mode in Taggle by default (default: FALSE)}
245-
#' \item{expandLineOnHover}{expand to full row height on mouse over (default: FALSE)}
246-
#' \item{defaultSlopeGraphMode}{default slope graph mode: item,band (default: 'item')}
247-
#' \item{ignoreUnsupportedBrowser}{ignore unsupported browser detection at own risk (default: FALSE)}
248-
#' \item{rowHeight}{height of a row in pixel (default: 18)}
249-
#' \item{rowPadding}{padding between two rows in pixel (default: 2)}
250-
#' \item{groupHeight}{height of an aggregated group in pixel (default: 40)}
251-
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
252-
#' }
253-
#'
254-
#' @return html taggle widget
210+
#' @return taggle html widget
255211
#'
256212
#' @examples
257213
#' \dontrun{
258-
#' taggle(mtcars)
259214
#' taggle(iris)
260215
#' }
261216
#'
@@ -334,14 +289,21 @@ lineupRanking <- function(columns = c("_*", "*"),
334289
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
335290
#' \code{'800px'}, \code{'auto'}) or a number, which will be coerced to a
336291
#' string and have \code{'px'} appended.
337-
#' @param expr An expression that generates a lineup
338-
#' @param env The environment in which to evaluate \code{expr}.
339-
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
340-
#' is useful if you want to save an expression in a variable.
341-
#'
342-
#' @name lineup-shiny#'
343-
#' @importFrom htmlwidgets shinyWidgetOutput
292+
#' @rdname lineup-shiny
293+
#' @return An output or render function that enables the use of the widget within Shiny applications.
294+
#' @examples # !formatR
295+
#' library(shiny)
296+
#' app <- shinyApp(
297+
#' ui = fluidPage(lineupOutput("lineup")),
298+
#' server = function(input, output) {
299+
#' lineup <- lineupBuilder(iris) |> buildLineUp()
300+
#' output$lineup <- renderLineup(lineup)
301+
#' }
302+
#' )
344303
#'
304+
#' \donttest{
305+
#' if (interactive()) app
306+
#' }
345307
#' @export
346308
lineupOutput <- function(outputId,
347309
width = "100%",
@@ -351,11 +313,11 @@ lineupOutput <- function(outputId,
351313

352314
#' Shiny render bindings for lineup
353315
#'
354-
#' @rdname lineup-shiny
355316
#' @param expr An expression that generates a taggle
356317
#' @param env The environment in which to evaluate \code{expr}.
357318
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
358319
#' is useful if you want to save an expression in a variable.
320+
#' @rdname lineup-shiny
359321
#' @export
360322
renderLineup <- function(expr,
361323
env = parent.frame(),
@@ -371,18 +333,22 @@ renderLineup <- function(expr,
371333
#' Output and render functions for using taggle within Shiny
372334
#' applications and interactive Rmd documents.
373335
#'
374-
#' @param outputId output variable to read from
375-
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
376-
#' \code{'800px'}, \code{'auto'}) or a number, which will be coerced to a
377-
#' string and have \code{'px'} appended.
378-
#' @param expr An expression that generates a taggle
379-
#' @param env The environment in which to evaluate \code{expr}.
380-
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
381-
#' is useful if you want to save an expression in a variable.
382-
#'
383-
#' @name taggle-shiny
384-
#' @importFrom htmlwidgets shinyWidgetOutput
336+
#' @inheritParams lineupOutput
337+
#' @rdname taggle-shiny
338+
#' @return An output or render function that enables the use of the widget within Shiny applications.
339+
#' @examples # !formatR
340+
#' library(shiny)
341+
#' app <- shinyApp(
342+
#' ui = fluidPage(taggleOutput("taggle")),
343+
#' server = function(input, output) {
344+
#' taggle <- lineupBuilder(iris) |> buildTaggle()
345+
#' output$taggle <- renderTaggle(taggle)
346+
#' }
347+
#' )
385348
#'
349+
#' \donttest{
350+
#' if (interactive()) app
351+
#' }
386352
#' @export
387353
taggleOutput <- function(outputId,
388354
width = "100%",
@@ -392,8 +358,9 @@ taggleOutput <- function(outputId,
392358

393359
#' Shiny render bindings for taggle
394360
#'
395-
#' @importFrom htmlwidgets shinyRenderWidget
361+
#' @inheritParams renderLineup
396362
#' @rdname taggle-shiny
363+
#'
397364
#' @export
398365
renderTaggle <- function(expr,
399366
env = parent.frame(),

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ LineUp.js as HTMLWidget
44
[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url]
55

66
LineUp is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes.
7-
This is a [HTMLWidget](http://www.htmlwidgets.org/) wrapper around the JavaScript library [LineUp.js](https://github.com/lineupjs/lineupjs). Details about the LineUp visualization technique can be found at [http://lineup.caleydo.org](http://lineup.caleydo.org).
7+
This is a [HTMLWidget](http://www.htmlwidgets.org/) wrapper around the JavaScript library [LineUp.js](https://github.com/lineupjs/lineupjs). Details about the LineUp visualization technique can be found at [ https://jku-vds-lab.at/tools/lineup/](https://jku-vds-lab.at/tools/lineup/).
88

9-
It can be used within standalone [R Shiny](https://shiny.rstudio.com/) apps or [R Markdown](http://rmarkdown.rstudio.com/) files. **Integrated plotting does not work due to an outdated integrated Webkit version in RStudio**.
9+
It can be used within standalone [R Shiny](https://shiny.rstudio.com/) apps or [R Markdown](https://rmarkdown.rstudio.com/) files.
1010
[Crosstalk](https://rstudio.github.io/crosstalk/) is supported for synching selections and filtering among widgets.
1111

1212
Installation

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lineup_htmlwidget",
3-
"version": "4.2.0",
3+
"version": "4.6.0",
44
"description": "LineUp.js as HTMLWidget",
55
"bugs": {
66
"url": "https://github.com/lineupjs/lineup_htmlwidget/issues"
@@ -14,7 +14,7 @@
1414
"lineupjs": "4.6.2"
1515
},
1616
"scripts": {
17-
"postinstall": "shx mkdir -p inst/htmlwidgets/dist && shx cp -r \"node_modules/lineupjs/build/LineUp*\" \"node_modules/lineupjs/build/*.eot\" \"node_modules/lineupjs/build/*.svg\" \"node_modules/lineupjs/build/*.ttf\" \"node_modules/lineupjs/build/*.woff\" inst/htmlwidgets/dist"
17+
"postinstall": "shx rm -f inst/htmlwidgets/dist/* && shx mkdir -p inst/htmlwidgets/dist && shx cp -r \"node_modules/lineupjs/build/LineUp*\" \"node_modules/lineupjs/build/*.eot\" \"node_modules/lineupjs/build/*.svg\" \"node_modules/lineupjs/build/*.ttf\" \"node_modules/lineupjs/build/*.woff\" inst/htmlwidgets/dist && shx rm inst/htmlwidgets/dist/*.map"
1818
},
1919
"devDependencies": {
2020
"shx": "^0.3.4"

vignettes/crosstalk.Rmd

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,20 @@ knitr::opts_chunk$set(echo = TRUE)
1616

1717
## Cross Talk
1818

19-
The LineUp HTMLWidget supports [Crosstalk](http://rstudio.github.io/crosstalk/) to sync selection and filtering among widgets.
19+
The LineUp HTMLWidget supports [Crosstalk](https://rstudio.github.io/crosstalk/) to sync selection and filtering among widgets.
2020

2121

2222
```{r crosstalk_iris}
2323
library(crosstalk)
2424
library(lineupjs)
2525
26-
remotes::install_github("jcheng5/d3scatter", auth_token = NULL, dependencies = FALSE, uprade = "never")
27-
library(d3scatter)
28-
2926
sharedIris <- SharedData$new(iris)
27+
```
3028

31-
d3scatter(sharedIris, ~Petal.Length, ~Petal.Width, ~Species, width = "100%")
29+
```{r crosstalk_iris_lineup1}
30+
lineup(sharedIris, width = "100%")
3231
```
3332

34-
```{r crosstalk_iris_lineup}
33+
```{r crosstalk_iris_lineup2}
3534
lineup(sharedIris, width = "100%")
3635
```

0 commit comments

Comments
 (0)