Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
^.*\.Rproj$
^\.Rproj\.user$
^JSONdata
.travis.yml
.sass-cache
^.*\.o$
^README\.Rmd$
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
name: R-CMD-check

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
51 changes: 51 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
name: test-coverage

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## Install package
R CMD INSTALL .
## Run tests
Rscript -e 'testthat::test_package("networkD3")'
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 0 additions & 2 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Type: Package
Title: D3 JavaScript Network Graphs from R
Description: Creates 'D3' 'JavaScript' network, tree, dendrogram, and Sankey
graphs from 'R'.
Version: 0.4.9000
Date: 2017-06-18
Version: 0.4.1
Date: 2025-04-14
Authors@R: c(
person("J.J.", "Allaire", role = "aut"),
person("Peter", "Ellis", role = "ctb"),
Expand Down Expand Up @@ -33,6 +33,7 @@ Imports:
Suggests:
htmltools (>= 0.2.6),
tibble
Encoding: UTF-8
Enhances: knitr, shiny
LazyData: true
RoxygenNote: 6.0.1
RoxygenNote: 7.3.2
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
[Pull Request](https://github.com/christophergandrud/networkD3/pulls) number.
Please see those for more details.

# 0.4.1

- Minor link changes

# 0.4

## Major changes
Expand Down
2 changes: 1 addition & 1 deletion R/chordNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#'
#' @source
#'
#' Mike Bostock: \url{https://github.com/mbostock/d3/wiki/Chord-Layout}.
#' Mike Bostock: \url{https://github.com/d3/d3/wiki/Chord-Layout}.
#'
#' @export
#'
Expand Down
6 changes: 3 additions & 3 deletions R/data-definitions.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
#'
#' @format A data set with 77 observations of 2 variables, plus made up
#' node size variable.
#' @source See Mike Bostock \url{http://bl.ocks.org/mbostock/4062045}.
#' @source See Mike Bostock \url{https://bl.ocks.org/mbostock/4062045}.
"MisNodes"

#' Les Miserables character links
#'
#' A data file of links from Knuth's Les Miserables characters data base.
#'
#' @format A data set with 254 observations of 3 variables.
#' @source See Mike Bostock \url{http://bl.ocks.org/mbostock/4062045}.
#' @source See Mike Bostock \url{https://bl.ocks.org/mbostock/4062045}.
"MisLinks"

#' Edge list of REF (2014) journal submissions for Politics and International
#' Relations
#'
#' @format A data set with 2732 rows and 3 variables.
#' @source See REF 2014 \url{http://results.ref.ac.uk/DownloadSubmissions/ByUoa/21}.
#' @source See REF 2014 \url{https://results.ref.ac.uk/DownloadSubmissions/ByUoa/21}.
"SchoolsJournals"
4 changes: 2 additions & 2 deletions R/dendroNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
#' treeOrientation = "vertical")
#' }
#'
#' @source Mike Bostock: \url{http://bl.ocks.org/mbostock/4063570}.
#' @source Mike Bostock: \url{https://bl.ocks.org/mbostock/4063570}.
#'
#' Fabio Nelli: \url{http://www.meccanismocomplesso.org/en/dendrogramma-d3-parte1/}
#' Fabio Nelli: https://www.meccanismocomplesso.org/en/dendrogramma-d3-parte1/
#'
#' @importFrom stats setNames
#' @importFrom utils modifyList
Expand Down
2 changes: 1 addition & 1 deletion R/forceNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
#'

#' @source
#' D3.js was created by Michael Bostock. See \url{http://d3js.org/} and, more
#' D3.js was created by Michael Bostock. See \url{https://d3js.org/} and, more
#' specifically for force directed networks
#' \url{https://github.com/d3/d3/blob/master/API.md#forces-d3-force}.
#' @seealso \code{\link{JS}}.
Expand Down
2 changes: 1 addition & 1 deletion R/networkD3.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @name networkD3-package
#' @aliases networkD3
#' @docType package
#' _PACKAGE
NULL


Expand Down
6 changes: 3 additions & 3 deletions R/sankeyNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#'
#' @examples
#' \dontrun{
#' # Recreate Bostock Sankey diagram: http://bost.ocks.org/mike/sankey/
#' # Recreate Bostock Sankey diagram: https://bost.ocks.org/mike/sankey/
#' # Load energy projection data
#' URL <- paste0('https://cdn.rawgit.com/christophergandrud/networkD3/',
#' 'master/JSONdata/energy.json')
Expand All @@ -65,8 +65,8 @@
#'
#' }
#' @source
#' D3.js was created by Michael Bostock. See \url{http://d3js.org/} and, more
#' specifically for Sankey diagrams \url{http://bost.ocks.org/mike/sankey/}.
#' D3.js was created by Michael Bostock. See \url{https://d3js.org/} and, more
#' specifically for Sankey diagrams \url{https://bost.ocks.org/mike/sankey/}.
#'
#' @seealso \code{\link{JS}}
#'
Expand Down
2 changes: 1 addition & 1 deletion R/simpleNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' simpleNetwork(NetworkData)
#' simpleNetwork(NetworkData, fontFamily = "sans-serif")
#'
#' @source D3.js was created by Michael Bostock. See \url{http://d3js.org/} and,
#' @source D3.js was created by Michael Bostock. See \url{https://d3js.org/} and,
#' more specifically for directed networks
#' \url{https://github.com/d3/d3/blob/master/API.md#forces-d3-force}
#'
Expand Down
8 changes: 4 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param ... character string to evaluate
#'
#' @source A direct import of \code{JS} from Ramnath Vaidyanathan, Yihui Xie,
#' JJ Allaire, Joe Cheng and Kenton Russell (2015). \link{htmlwidgets}: HTML
#' JJ Allaire, Joe Cheng and Kenton Russell (2015). htmlwidgets: HTML
#' Widgets for R. R package version 0.4.
#'
#' @export
Expand Down Expand Up @@ -33,7 +33,7 @@ toJSONarray <- function(dtf){

name.value <- function(i){
quote <- '';
if(class(dtf[, i])!='numeric' && class(dtf[, i])!='integer'){
if (!inherits(dtf[, i], "numeric") && !inherits(dtf[, i], "integer")){
quote <- '"';
}
paste('"', i, '" : ', quote, dtf[,i], quote, sep='')
Expand Down Expand Up @@ -104,7 +104,7 @@ margin_handler <- function(margin){
#'
#' @param g an \code{igraph} class graph object
#' @param group an object that contains node group values, for example, those
#' created with igraph's \code{\link{membership}} function.
#' created with igraph's \code{\link[igraph]{membership}} function.
#' @param what a character string specifying what to return. If
#' \code{what = 'links'} or \code{what = 'nodes'} only the links or nodes are
#' returned as data frames, respectively. If \code{what = 'both'} then both
Expand Down Expand Up @@ -133,7 +133,7 @@ margin_handler <- function(margin){
#' \dontrun{
#' # Example with data from data frame
#' # Load data
#' ## Original data from http://results.ref.ac.uk/DownloadSubmissions/ByUoa/21
#' ## Original data from https://results.ref.ac.uk/DownloadSubmissions/ByUoa/21
#' data('SchoolsJournals')
#'
#' # Convert to igraph
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ output: md_document

Development version: `r packageVersion("networkD3")`
[![CRAN Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3)
[![Build Status](https://travis-ci.org/christophergandrud/networkD3.svg?branch=master)](https://travis-ci.org/christophergandrud/networkD3)
[![R-CMD-check](https://github.com/christophergandrud/networkD3/workflows/R-CMD-check/badge.svg)](https://github.com/christophergandrud/networkD3/actions)
![CRAN Monthly Downloads](http://cranlogs.r-pkg.org/badges/last-month/networkD3)
![CRAN Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/networkD3)

Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ D3 JavaScript Network Graphs from R
===================================

Development version: 0.4.9000 [![CRAN
Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3)
[![Build
Status](https://travis-ci.org/christophergandrud/networkD3.svg?branch=master)](https://travis-ci.org/christophergandrud/networkD3)
![CRAN Monthly
Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3) [![R-CMD-check](https://github.com/christophergandrud/networkD3/workflows/R-CMD-check/badge.svg)](https://github.com/christophergandrud/networkD3/actions) ![CRAN Monthly
Downloads](http://cranlogs.r-pkg.org/badges/last-month/networkD3) ![CRAN
Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/networkD3)

Expand Down Expand Up @@ -42,7 +39,7 @@ Here's `forceNetwork`:

Here's `sankeyNetwork` using a downloaded JSON data file:

# Recreate Bostock Sankey diagram: http://bost.ocks.org/mike/sankey/
# Recreate Bostock Sankey diagram: https://bost.ocks.org/mike/sankey/
# Load energy projection data
URL <- paste0("https://cdn.rawgit.com/christophergandrud/networkD3/",
"master/JSONdata/energy.json")
Expand All @@ -55,7 +52,7 @@ Here's `sankeyNetwork` using a downloaded JSON data file:

### Interacting with igraph

You can use [igraph](http://igraph.org/r/) to create network graph data
You can use [igraph](https://igraph.org/r/) to create network graph data
that can be plotted with **networkD3**. The `igraph_to_networkD3`
function converts igraph graphs to lists that work well with
**networkD3**. For example:
Expand Down
2 changes: 1 addition & 1 deletion man/JS.Rd

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

6 changes: 4 additions & 2 deletions man/MisLinks.Rd

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

8 changes: 5 additions & 3 deletions man/MisNodes.Rd

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

6 changes: 4 additions & 2 deletions man/SchoolsJournals.Rd

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

10 changes: 8 additions & 2 deletions man/as_treenetdf.data.frame.Rd

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

3 changes: 1 addition & 2 deletions man/as_treenetdf.list.Rd

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

Loading