Contains all supporting JARs for working with the GraphStream Java APIs. () Version number matches version number of included 'graphstreamjars' libraries.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.3 KiB

4 years ago
4 years ago
[![Project Status: WIP – Initial development is in progress, but there
has not yet been a stable, usable release suitable for the
public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/graphstreamjars.svg?branch=master)](https://travis-ci.org/hrbrmstr/graphstreamjars)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.2.0-blue.svg)
![License](https://img.shields.io/badge/License-LGPL-blue.svg)
4 years ago
# graphstreamjars
4 years ago
Java Archive Wrapper Supporting the ‘graphstream’ Package
4 years ago
## Description
Contains all supporting JARs for working with the GraphStream Java APIs.
4 years ago
(<http://graphstream-project.org/>) Version number matches version
4 years ago
number of included ‘graphstreamjars’ libraries.
4 years ago
## What’s Inside The Tin
4 years ago
4 years ago
The following functions are implemented:
4 years ago
4 years ago
## Installation
4 years ago
``` r
4 years ago
install.packages("graphstreamjars", repos = "https://cinc.rud.is")
# or
4 years ago
remotes::install_git("https://git.rud.is/hrbrmstr/graphstreamjars.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/graphstreamjars")
# or
remotes::install_gitlab("hrbrmstr/graphstreamjars")
# or
remotes::install_bitbucket("hrbrmstr/graphstreamjars")
# or
remotes::install_github("hrbrmstr/graphstreamjars")
4 years ago
```
4 years ago
NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.
4 years ago
4 years ago
## Usage
4 years ago
``` r
4 years ago
library(rJava)
4 years ago
library(graphstreamjars)
packageVersion("graphstreamjars")
4 years ago
## [1] '1.3.0'
4 years ago
```
``` r
library(graphstreamjars)
SingleGraph <- J("org.graphstream.graph.implementations.SingleGraph")
(graph <- .jnew(SingleGraph, "Tutorial 1"))
4 years ago
## [1] "Java-Object{Tutorial 1}"
4 years ago
graph$addNode("A")
4 years ago
## [1] "Java-Object{A}"
4 years ago
graph$addNode("B")
4 years ago
## [1] "Java-Object{B}"
4 years ago
graph$addNode("C")
4 years ago
## [1] "Java-Object{C}"
4 years ago
graph$addEdge("AB", "A", "B")
4 years ago
## [1] "Java-Object{AB[A--B]}"
4 years ago
graph$addEdge("BC", "B", "C")
4 years ago
## [1] "Java-Object{BC[B--C]}"
4 years ago
graph$addEdge("CA", "C", "A")
4 years ago
## [1] "Java-Object{CA[C--A]}"
4 years ago
graph$setStrict(FALSE)
graph$setAutoCreate(TRUE)
graph$addEdge("AB", "A", "B")
4 years ago
## [1] "Java-Object{AB[A--B]}"
4 years ago
graph$addEdge("BC", "B", "C")
4 years ago
## [1] "Java-Object{BC[B--C]}"
4 years ago
graph$addEdge("CA", "C", "A")
4 years ago
## [1] "Java-Object{CA[C--A]}"
4 years ago
(A <- graph$getNode("A"))
4 years ago
## [1] "Java-Object{A}"
4 years ago
(AB <- graph$getEdge("AB"))
4 years ago
## [1] "Java-Object{AB[A--B]}"
4 years ago
ni <- graph$getNodeIterator()
while(ni$hasNext()) {
print(.jrcall(ni, "next"))
}
4 years ago
## [1] "Java-Object{A}"
## [1] "Java-Object{B}"
## [1] "Java-Object{C}"
4 years ago
```
## `graphstreamjars` Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :---- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| XML | 1 | 0.08 | 66 | 0.32 | 0 | 0.00 | 0 | 0.00 |
4 years ago
| Maven | 2 | 0.17 | 58 | 0.28 | 9 | 0.22 | 6 | 0.08 |
| Rmd | 1 | 0.08 | 29 | 0.14 | 21 | 0.52 | 26 | 0.33 |
| Java | 2 | 0.17 | 28 | 0.13 | 5 | 0.12 | 18 | 0.23 |
| R | 5 | 0.42 | 15 | 0.07 | 1 | 0.02 | 28 | 0.36 |
4 years ago
| make | 1 | 0.08 | 13 | 0.06 | 4 | 0.10 | 0 | 0.00 |