Skip to content

Commit

Permalink
Merge pull request #19 from lineupjs/develop
Browse files Browse the repository at this point in the history
upgrade setup and release to CRAN
  • Loading branch information
sgratzl authored Sep 11, 2022
2 parents 0f23d26 + 0d31c9d commit 0faade2
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 118 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ node_modules
^\.bumpversion\.cfg$
^\.editorconfig$
^\.lintr$
^docs$
^Makefile$
^CRAN-SUBMISSION$
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-node@v3
- uses: r-lib/actions/setup-r@v1
with:
r-version: 3.6
r-version: 4.2
- uses: r-lib/actions/setup-pandoc@v1
- name: Cache R packages
uses: actions/cache@v2
Expand Down Expand Up @@ -44,10 +44,6 @@ jobs:
run: styler::style_dir(filetype=c('R', 'Rmd'), dry="fail")

- name: Build Package
env:
GITHUB_PAT: ''
GITHUB_TOKEN: ''
CI: ''
shell: Rscript {0}
run: |
devtools::document()
Expand All @@ -62,9 +58,6 @@ jobs:
- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
GITHUB_PAT: ''
GITHUB_TOKEN: ''
CI: ''
shell: Rscript {0}
run: devtools::check(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")

Expand Down
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 4.3.0
Date: 2022-07-28 01:13:21 UTC
SHA: 183d4c30dd7a561518ae8093b89c4c156269fe6a
Version: 4.6.0
Date: 2022-08-12 00:38:58 UTC
SHA: 1fec4f1a3a68b4b88da3b637ebaaf62b30d9b5da
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Title: 'HTMLWidget' Wrapper of 'LineUp' for Visual Analysis of Multi-Attribute R
Description: 'LineUp' is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes.
This is a 'htmlwidget' wrapper around the JavaScript library 'LineUp.js'.
It is designed to be used in 'R Shiny' apps and 'R Markddown' files.
Due to an outdated 'webkit' version of 'RStudio' it won't work in the intergrated viewer.
Version: 4.3.0
Date: 2021-08-30
Due to an outdated 'webkit' version of 'RStudio' it won't work in the integrated viewer.
Version: 4.6.0
Date: 2022-08-10
Authors@R: person("Samuel", "Gratzl", email = "[email protected]", role = c("aut", "cre"))
Maintainer: Samuel Gratzl <[email protected]>
URL: https://github.com/lineupjs/lineup_htmlwidget/
Expand All @@ -24,8 +24,8 @@ Suggests:
testthat,
lintr,
remotes,
styler
LazyData: true
styler,
shiny
RoxygenNote: 7.2.0
VignetteBuilder: knitr
Language: en-US
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ export(renderLineup)
export(renderTaggle)
export(taggle)
export(taggleOutput)
importFrom(htmlwidgets,shinyRenderWidget)
importFrom(htmlwidgets,shinyWidgetOutput)
143 changes: 55 additions & 88 deletions R/lineup.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
defaultSlopeGraphMode = "item",
ignoreUnsupportedBrowser = FALSE
)
#' taggle - factory for Taggle HTMLWidget

#' lineup builder pattern function
#'
#' @param data data frame like object i.e. also crosstalk shared data frame
#' @param options LineUp options
Expand All @@ -43,12 +44,11 @@
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
#' }
#'
#' @return lineup builder objects
#' @return lineup builder object
#'
#' @examples
#' \dontrun{
#' taggle(mtcars)
#' taggle(iris)
#' lineupBuilder(iris) |> buildLineUp()
#' }
#'
#' @export
Expand Down Expand Up @@ -130,16 +130,20 @@ lineupBuilder <- function(data,
}
}

#' lineup - factory for LineUp HTMLWidget
#' factory for LineUp HTMLWidget based on a LineUpBuilder
#'
#' @param x LineUpBuilder object
#' @param width width of the element
#' @param height height of the element
#' @param elementId unique element id
#' @param dependencies include crosstalk dependencies
#'
#' @return html lineup widget
#' @return lineup html widget
#'
#' @examples
#' \dontrun{
#' lineupBuilder(iris) |> buildLineUp()
#' }
#' @export
buildLineUp <- function(x, width = "100%",
height = NULL,
Expand All @@ -148,16 +152,15 @@ buildLineUp <- function(x, width = "100%",
.buildLineUpWidget(x, width, height, elementId, dependencies, lineupType = "lineup")
}

#' taggle - factory for Taggle HTMLWidget
#' factory for LineUp HTMLWidget based on a LineUpBuilder
#' @inheritParams buildLineUp
#'
#' @param x LineUpBuilder object
#' @param width width of the element
#' @param height height of the element
#' @param elementId unique element id
#' @param dependencies include crosstalk dependencies
#' @return taggle html widget
#'
#' @return html taggle widget

#' @examples
#' \dontrun{
#' lineupBuilder(iris) |> buildTaggle()
#' }
#' @export
buildTaggle <- function(x, width = "100%",
height = NULL,
Expand All @@ -169,40 +172,18 @@ buildTaggle <- function(x, width = "100%",

#' lineup - factory for LineUp HTMLWidget
#'
#' @param data data frame like object i.e. also crosstalk shared data frame
#' @inheritParams lineupBuilder
#' @param width width of the element
#' @param height height of the element
#' @param elementId unique element id
#' @param options LineUp options
#' @param ranking ranking definition created using \code{\link{lineupRanking}}
#' @param dependencies include crosstalk dependencies
#' @param ... additional ranking definitions like 'ranking1=...' due to restrictions in converting parameters
#'
#' @section LineUp options:
#' \describe{
#' \item{filterGlobally}{whether filter within one ranking applies to all rankings (default: TRUE)}
#' \item{singleSelection}{restrict to single item selection (default: FALSE}
#' \item{noCriteriaLimits}{allow more than one sort and grouping criteria (default: FALSE)}
#' \item{animated}{use animated transitions (default: TRUE)}
#' \item{sidePanel}{show side panel (TRUE, FALSE, 'collapsed') (default: 'collapsed')}
#' \item{hierarchyIndicator}{show sorting and grouping hierarchy indicator (TRUE, FALSE) (default: TRUE)}
#' \item{labelRotation}{how many degrees should a label be rotated in case of narrow columns (default: 0)}
#' \item{summaryHeader}{show summary histograms in the header (default: TRUE)}
#' \item{overviewMode}{show overview mode in Taggle by default (default: FALSE)}
#' \item{expandLineOnHover}{expand to full row height on mouse over (default: FALSE)}
#' \item{defaultSlopeGraphMode}{default slope graph mode: item,band (default: 'item')}
#' \item{ignoreUnsupportedBrowser}{ignore unsupported browser detection at own risk (default: FALSE)}
#' \item{rowHeight}{height of a row in pixel (default: 18)}
#' \item{rowPadding}{padding between two rows in pixel (default: 2)}
#' \item{groupHeight}{height of an aggregated group in pixel (default: 40)}
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
#' }
#'
#' @return html lineup widget
#' @inheritSection lineupBuilder LineUp options
#' @return lineup html widget
#'
#' @examples
#' \dontrun{
#' lineup(mtcars)
#' lineup(iris)
#' }
#'
Expand All @@ -222,40 +203,14 @@ lineup <- function(data,

#' taggle - factory for Taggle HTMLWidget
#'
#' @param data data frame like object i.e. also crosstalk shared data frame
#' @param width width of the element
#' @param height height of the element
#' @param elementId unique element id
#' @param options LineUp options
#' @param ranking ranking definition created using \code{\link{lineupRanking}}
#' @param dependencies include crosstalk dependencies
#' @inheritParams lineup
#' @param ... additional ranking definitions like 'ranking1=...' due to restrictions in converting parameters
#' @inheritSection lineup LineUp options
#'
#' @section LineUp options:
#' \describe{
#' \item{filterGlobally}{whether filter within one ranking applies to all rankings (default: TRUE)}
#' \item{singleSelection}{restrict to single item selection (default: FALSE}
#' \item{noCriteriaLimits}{allow more than one sort and grouping criteria (default: FALSE)}
#' \item{animated}{use animated transitions (default: TRUE)}
#' \item{sidePanel}{show side panel (TRUE, FALSE, 'collapsed') (default: 'collapsed')}
#' \item{hierarchyIndicator}{show sorting and grouping hierarchy indicator (TRUE, FALSE) (default: TRUE)}
#' \item{labelRotation}{how many degrees should a label be rotated in case of narrow columns (default: 0)}
#' \item{summaryHeader}{show summary histograms in the header (default: TRUE)}
#' \item{overviewMode}{show overview mode in Taggle by default (default: FALSE)}
#' \item{expandLineOnHover}{expand to full row height on mouse over (default: FALSE)}
#' \item{defaultSlopeGraphMode}{default slope graph mode: item,band (default: 'item')}
#' \item{ignoreUnsupportedBrowser}{ignore unsupported browser detection at own risk (default: FALSE)}
#' \item{rowHeight}{height of a row in pixel (default: 18)}
#' \item{rowPadding}{padding between two rows in pixel (default: 2)}
#' \item{groupHeight}{height of an aggregated group in pixel (default: 40)}
#' \item{groupPadding}{padding between two groups in pixel (default: 5)}
#' }
#'
#' @return html taggle widget
#' @return taggle html widget
#'
#' @examples
#' \dontrun{
#' taggle(mtcars)
#' taggle(iris)
#' }
#'
Expand Down Expand Up @@ -334,14 +289,21 @@ lineupRanking <- function(columns = c("_*", "*"),
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
#' \code{'800px'}, \code{'auto'}) or a number, which will be coerced to a
#' string and have \code{'px'} appended.
#' @param expr An expression that generates a lineup
#' @param env The environment in which to evaluate \code{expr}.
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
#' is useful if you want to save an expression in a variable.
#'
#' @name lineup-shiny#'
#' @importFrom htmlwidgets shinyWidgetOutput
#' @rdname lineup-shiny
#' @return An output or render function that enables the use of the widget within Shiny applications.
#' @examples # !formatR
#' library(shiny)
#' app <- shinyApp(
#' ui = fluidPage(lineupOutput("lineup")),
#' server = function(input, output) {
#' lineup <- lineupBuilder(iris) |> buildLineUp()
#' output$lineup <- renderLineup(lineup)
#' }
#' )
#'
#' \donttest{
#' if (interactive()) app
#' }
#' @export
lineupOutput <- function(outputId,
width = "100%",
Expand All @@ -351,11 +313,11 @@ lineupOutput <- function(outputId,

#' Shiny render bindings for lineup
#'
#' @rdname lineup-shiny
#' @param expr An expression that generates a taggle
#' @param env The environment in which to evaluate \code{expr}.
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
#' is useful if you want to save an expression in a variable.
#' @rdname lineup-shiny
#' @export
renderLineup <- function(expr,
env = parent.frame(),
Expand All @@ -371,18 +333,22 @@ renderLineup <- function(expr,
#' Output and render functions for using taggle within Shiny
#' applications and interactive Rmd documents.
#'
#' @param outputId output variable to read from
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
#' \code{'800px'}, \code{'auto'}) or a number, which will be coerced to a
#' string and have \code{'px'} appended.
#' @param expr An expression that generates a taggle
#' @param env The environment in which to evaluate \code{expr}.
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
#' is useful if you want to save an expression in a variable.
#'
#' @name taggle-shiny
#' @importFrom htmlwidgets shinyWidgetOutput
#' @inheritParams lineupOutput
#' @rdname taggle-shiny
#' @return An output or render function that enables the use of the widget within Shiny applications.
#' @examples # !formatR
#' library(shiny)
#' app <- shinyApp(
#' ui = fluidPage(taggleOutput("taggle")),
#' server = function(input, output) {
#' taggle <- lineupBuilder(iris) |> buildTaggle()
#' output$taggle <- renderTaggle(taggle)
#' }
#' )
#'
#' \donttest{
#' if (interactive()) app
#' }
#' @export
taggleOutput <- function(outputId,
width = "100%",
Expand All @@ -392,8 +358,9 @@ taggleOutput <- function(outputId,

#' Shiny render bindings for taggle
#'
#' @importFrom htmlwidgets shinyRenderWidget
#' @inheritParams renderLineup
#' @rdname taggle-shiny
#'
#' @export
renderTaggle <- function(expr,
env = parent.frame(),
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ LineUp.js as HTMLWidget
[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url]

LineUp is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes.
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).
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/).

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**.
It can be used within standalone [R Shiny](https://shiny.rstudio.com/) apps or [R Markdown](https://rmarkdown.rstudio.com/) files.
[Crosstalk](https://rstudio.github.io/crosstalk/) is supported for synching selections and filtering among widgets.

Installation
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lineup_htmlwidget",
"version": "4.2.0",
"version": "4.6.0",
"description": "LineUp.js as HTMLWidget",
"bugs": {
"url": "https://github.com/lineupjs/lineup_htmlwidget/issues"
Expand All @@ -14,7 +14,7 @@
"lineupjs": "4.6.2"
},
"scripts": {
"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"
"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"
},
"devDependencies": {
"shx": "^0.3.4"
Expand Down
11 changes: 5 additions & 6 deletions vignettes/crosstalk.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ knitr::opts_chunk$set(echo = TRUE)

## Cross Talk

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


```{r crosstalk_iris}
library(crosstalk)
library(lineupjs)
remotes::install_github("jcheng5/d3scatter", auth_token = NULL, dependencies = FALSE, uprade = "never")
library(d3scatter)
sharedIris <- SharedData$new(iris)
```

d3scatter(sharedIris, ~Petal.Length, ~Petal.Width, ~Species, width = "100%")
```{r crosstalk_iris_lineup1}
lineup(sharedIris, width = "100%")
```

```{r crosstalk_iris_lineup}
```{r crosstalk_iris_lineup2}
lineup(sharedIris, width = "100%")
```

0 comments on commit 0faade2

Please sign in to comment.