Skip to content

Commit

Permalink
Update network.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasAbraham authored May 10, 2024
1 parent 7efb8c7 commit f89ef12
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions pyeed/network/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,8 @@ def create_cytoscape_graph(

def set_layout(
self,
layout_name: str = "force-directed",
properties_dict: dict = {
"defaultSpringCoefficient": 4e-5,
"defaultSpringLength": 100,
"defaultNodeMass": 3,
"numIterations": 50,
},
):
if layout_name == 'force-directed':
p4c.layout_network(layout_name, base_url=self._base_url)
# ['numIterations', 'defaultSpringCoefficient', 'defaultSpringLength', 'defaultNodeMass', 'isDeterministic', 'singlePartition']
p4c.set_layout_properties(
layout_name=layout_name, properties_dict=properties_dict, base_url=self._base_url
)

p4c.layout_network(layout_name, base_url=self._base_url)
else:
p4c.layout_network(layout_name, base_url=self._base_url)
layout_name: str = "force-directed"):
p4c.layout_network(layout_name, base_url=self._base_url)

def hide_under_threshold(self, threshold):
p4c.unhide_all(base_url=self._base_url)
Expand Down Expand Up @@ -519,4 +503,4 @@ def _get_edges_cytoscape_graph(self, hidden_included = False):
return p4c.get_all_edges()

def _get_edges_visibilities(self):
return p4c.get_edge_property(visual_property='EDGE_VISIBLE')
return p4c.get_edge_property(visual_property='EDGE_VISIBLE')

0 comments on commit f89ef12

Please sign in to comment.