import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches

from matplotlib.path import Path


class HivePlot(object):
    """
    The HivePlot class will take in the following and return
    a hive plot:
    - nodes:    a dictionary of nodes, in which there are at most 3 keys
                in the dictionary, and the nodes are sorted in a
                pre-specified order. One common grouping is by a node
                attribute and one possible ordering is by degree centrality.

    - edges:    a dictionary of {group:edgelist}, where each edgelist is a
                list of (u,v,d) tuples (in NetworkX style), where u and v are
                the nodes to join, and d are the node attributes.

    The user will have to pre-sort and pre-group the nodes, and pre-map