igraph_as_svg: Turn igraph object into SVG.

Description Usage Arguments Examples

View source: R/igraph.R

Description

Turn igraph object into SVG.

Usage

1
2
igraph_as_svg(x, radius_min = 5, radius_tf = TRUE, edgeColor = "black",
  fontSize = 8, textOffset = 3, width = 800, height = 800)

Arguments

x

An igraph object.

radius_min

...

radius_tf

...

edgeColor

...

fontSize

font size of the vertex labels

textOffset

where to put text

width

the width of the svg

height

the height of the svg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(gradget)
library(magrittr)
library(igraph)
library(shiny)

G <- merkel2008 %>%
  igraph_add_coordinates(layout = "kamada.kawai", dim = 2) %>%
  igraph_normalize_coordinates(width = 800, height = 800, margin = 50)
S <- igraph_as_svg(G)
w <- svgPanZoom::svgPanZoom(S)

w <- htmlwidgets::appendContent(
  w,
  shiny::includeScript(path = system.file(package = "gradget", "js", "svg_js_extensions.js"))
  )
   

PolMine/polmineR.graph documentation built on April 27, 2020, 3:24 a.m.