Skip to content

Commit

Permalink
2.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Oct 14, 2023
1 parent 60e29c9 commit 3611e8c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion d3graph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

__author__ = 'Erdogan Tasksen'
__email__ = '[email protected]'
__version__ = '2.4.11'
__version__ = '2.4.12'


# module level doc-string
Expand Down
27 changes: 27 additions & 0 deletions d3graph/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@
import numpy as np
from d3graph import d3graph, adjmat2vec, vec2adjmat

# %%
# Import
from d3graph import d3graph
# intialize to load example dataset
d3 = d3graph(support=False)
adjmat = d3.import_example('bigbang')

# Initialize with clustering colors
d3.graph(adjmat, color='cluster')


# We will first set all label properties to None and then we will adjust two of them
d3.set_edge_properties(directed=True, marker_color='#000FFF', label=None)
d3.edge_properties['Amy', 'Bernadette']['weight_scaled']=10
d3.edge_properties['Amy', 'Bernadette']['label']='amy-bern'
d3.edge_properties['Amy', 'Bernadette']['label_color']='#000FFF'
d3.edge_properties['Amy', 'Bernadette']['label_fontsize']=8
d3.edge_properties['Bernadette', 'Howard']['label']='bern-how'
d3.edge_properties['Bernadette', 'Howard']['label_fontsize']=20
d3.edge_properties['Bernadette', 'Howard']['label_color']='#000000'

# Set some node properties
d3.set_node_properties(marker=['circle', 'circle', 'circle', 'rect', 'rect', 'rect', 'rect'])

d3.show(filepath=r'c:\temp\\d3graph\network_to_square.html')


# %% opacity
from d3graph import d3graph, adjmat2vec
Expand Down Expand Up @@ -33,6 +59,7 @@
# Set all edge labels to "test"
d3.set_edge_properties(directed=True, minmax_distance=None)
d3.show(filepath=r'c:\temp\\d3graph\edge_labels_1.html')

d3.set_edge_properties(directed=True)
d3.show(filepath=r'c:\temp\\d3graph\edge_labels_3.html')
d3.set_edge_properties(directed=True, minmax_distance=[20, 200])
Expand Down

0 comments on commit 3611e8c

Please sign in to comment.