knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-Images/"
)

Travis-CI Build Status

Steps to take

  1. Turn edgelist into graph
  2. Determine number of axes based on number of clusters (or other option)
  3. Determine size based on a measure, page rank to start
  4. Determine position based on closeness or other measure
  5. Plot these coordinates

Example code

library(igraph)
library(dplyr)
library(magrittr)
library(HivePlot)
# load data
data(flights)
head(flights)
# turn into a graph
g <- graph.data.frame(flights, directed=FALSE)
# Perform clustering to determine number of axes
# it defaults to walktrap.community but any function that returns a clustering should work
g %<>% findAxes
V(g)$axis
# calculate the size of the nodes, defaulting to page.rank
g %<>% nodeSize
V(g)$nodeSize
# find how high up the axis each node should be, defaulting to closeness
g %<>% nodePosition
V(g)$nodePosition

Plotting

Until the package for [Sigma.js](https://github.com/jaredlander/sigma) is ready we will use igraph for plotting

plot(g, layout=layout_with_hive(g))

Axis Positions

The first axis will always be the positive side of the x-axis on the cartesian plane (eventually we will be able to specify a starting offset for this first axis)

More Reading



jaredlander/HivePlot documentation built on May 18, 2019, 3:46 p.m.