Skip to content
Back to skills

NetworkD3

ASecurity

R networkD3 package for D3 network graphs. Use for force-directed, Sankey, and tree diagrams.

  • 5 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added June 4, 2026
datajavascriptgojavanode

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill networkD3 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of NetworkD3?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for NetworkD3
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-networkd3/badge)](https://www.skillsdirectory.com/skills/leolin990405-networkd3)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: networkD3
description: R networkD3 package for D3 network graphs. Use for force-directed, Sankey, and tree diagrams.
---

# networkD3 Package

D3 JavaScript network graphs.

## Force Network

```r
library(networkD3)

# Simple
simpleNetwork(links_df, Source = "source", Target = "target")

# Full control
forceNetwork(
  Links = links,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  NodeID = "name",
  Group = "group",
  opacity = 0.8,
  zoom = TRUE
)
```

## Sankey Diagram

```r
sankeyNetwork(
  Links = links,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  Value = "value",
  NodeID = "name",
  units = "TWh"
)
```

## Tree Diagrams

```r
# Radial tree
radialNetwork(hierarchy_list)

# Diagonal tree
diagonalNetwork(hierarchy_list)

# Dendrogram
dendroNetwork(hclust_obj)
```

## Data Format

```r
# Links (0-indexed!)
links <- data.frame(
  source = c(0, 0, 1, 2),
  target = c(1, 2, 3, 3),
  value = c(10, 20, 15, 25)
)

# Nodes
nodes <- data.frame(
  name = c("A", "B", "C", "D"),
  group = c(1, 1, 2, 2)
)
```

## Customization

```r
forceNetwork(
  Links = links,
  Nodes = nodes,
  Source = "source",
  Target = "target",
  NodeID = "name",
  Group = "group",
  fontSize = 14,
  fontFamily = "Arial",
  linkDistance = 100,
  charge = -300,
  bounded = TRUE,
  colourScale = JS("d3.scaleOrdinal(d3.schemeCategory10)")
)
```

## Save

```r
library(htmlwidgets)
saveWidget(network, "network.html")
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.