Big Bang network
Default
from d3graph import d3graph
size = [10, 20, 10, 10, 15, 10, 5]
# Initialize
d3 = d3graph()
# Load example
adjmat = d3.import_example('bigbang')
# Process adjmat
d3.graph(adjmat)
# Show
d3.show()
Node colors
d3.set_node_properties(color=adjmat.columns.values)
d3.show()
Node fontcolors
d3.set_node_properties(color='cluster', fontcolor='node_color')
d3.show()
Node sizes
d3.set_node_properties(color=adjmat.columns.values, size=size)
d3.show()
Edge sizes
d3.set_node_properties(color=adjmat.columns.values, size=size, edge_size=size[::-1])
d3.show()
Edge colors
d3.set_node_properties(color=adjmat.columns.values, size=size, edge_size=size[::-1], edge_color='#00FFFF')
d3.show()
Colormap
d3.set_node_properties(color=adjmat.columns.values, size=size, edge_size=size[::-1], edge_color='#00FFFF', cmap='Set2')
d3.show()
Directed arrows
d3.set_edge_properties(directed=True)
d3.set_node_properties(color=adjmat.columns.values, size=size, edge_size=size, edge_color='#000FFF', cmap='Set1')
d3.show()
Karate Club network
from d3graph import d3graph
# Initialize
d3 = d3graph()
# Load karate example
adjmat, df = d3.import_example('karate')
label = df['label'].values
node_size = df['degree'].values
d3.graph(adjmat)
d3.set_node_properties(color=df['label'].values, label=label)
d3.show()
d3.set_node_properties(label=label, color=label, cmap='Set1')
d3.show()
d3.set_node_properties(size=node_size)
d3.show()
d3.set_node_properties(color=label, size=node_size, label=label)
d3.show()
d3.set_edge_properties(edge_distance=100)
d3.set_node_properties(color=node_size, size=node_size, label=label)
d3.show()
d3 = d3graph(charge=1000)
d3.graph(adjmat)
d3.set_node_properties(color=node_size, size=node_size, label=label)
d3.show()
d3 = d3graph(collision=1, charge=250)
d3.graph(adjmat)
d3.set_node_properties(color=label, size=node_size, edge_size=node_size, cmap='Set1', label=label)
d3.show()
d3 = d3graph(collision=1, charge=250)
d3.graph(adjmat)
d3.set_node_properties(color=label, size=node_size, edge_size=node_size, edge_color='#00FFFF', cmap='Set1', label=label)
d3.show()