MyNixOS website logo
Description

Graph Visualisation Engine Widget for R and 'shiny' Apps.

Create stunning network experiences powered by the 'G6' graph visualisation engine 'JavaScript' library <https://g6.antv.antgroup.com/en>. In 'shiny' mode, modify your graph directly from the server function to dynamically interact with nodes and edges. Select your favorite layout among 20 choices. 15 behaviors are available such as interactive edge creation, collapse-expand and brush select. 17 plugins designed to improve the user experience such as a mini-map, toolbars and grid lines. Customise the look and feel of your graph with comprehensive options for nodes, edges and more.

g6R

R-CMD-check Lifecycle:experimental CRANstatus

g6R hex logo

{g6R} provides R bindings to the G6 graph library. It allows to create interactive network in R, with stunning set of features, including:

  • Support for various layouts, such as force-directed, radial, circular, and hierarchical layouts.
  • Interactive behaviors like zooming, dragging, and selecting elements.
  • Plugins for additional functionality, such as minimaps and tooltips, context menus, and node grouping features like bubble sets, hulls and legends.
  • Various data sources including data frames, lists and remote JSON urls.
  • Support for combos allowing for nested nodes.
  • High performance rendering (>20000 nodes).

g6R layers example

Installation

You can install the development version of {g6R} from GitHub with:

# install.packages("pak")
pak::pak("cynkra/g6R")

Example

To create a {g6R} graph:

library(g6R)
nodes <- data.frame(
  id = 1:10,
  label = 1:10
)

# Generate random edges
edges <- data.frame(
  source = c(2, 6, 7),
  target = c(1, 3, 9)
)

g6(nodes, edges) |>
  g6_options(
    node = list(
      style = list(
        labelBackground = TRUE,
        labelBackgroundFill = '#FFB6C1',
        labelBackgroundRadius = 4,
        labelFontFamily = 'Arial',
        labelPadding = c(0, 4),
        labelText = JS(
          "(d) => {
              return d.id
            }"
        )
      )
    )
  ) |>
  g6_layout(d3_force_layout()) |>
  g6_behaviors(
    "zoom-canvas",
    drag_element_force(fixed = TRUE),
    click_select(
      multiple = TRUE,
      onClick = JS(
        "(e) => {
            console.log(e);
          }"
      )
    ),
    brush_select(),
    create_edge()
  ) |>
  g6_plugins(
    "minimap",
    "tooltip",
    context_menu()
  )
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows