Skip to content

Commit

Permalink
yfiles -> property changed from effect to sign to fit current network…
Browse files Browse the repository at this point in the history
… representation
  • Loading branch information
ivanovaos committed Jul 3, 2024
1 parent 2263bac commit 02cb8d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion networkcommons/_visual/vis_yfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def visualize(self, graph_layout="Organic", directed=True):

for edge in self.network.edges(data=True):
styled_edge = self.styles['default']['edges']
styled_edge = {"color": get_edge_color(edge[2]['effect'], self.styles)}
styled_edge = {"color": get_edge_color(edge[2]['sign'], self.styles)}
edge_objects.append({
"id": (edge[0], edge[1]),
"start": edge[0],
Expand Down
6 changes: 3 additions & 3 deletions networkcommons/_visual/yfiles_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_styles():
'Conflicting': '#ffcc00'
}
},
'effects': {
'signs': {
'activation': 'green',
'inhibition': 'red',
'form complex': 'blue',
Expand Down Expand Up @@ -113,13 +113,13 @@ def get_edge_color(effect, styles):
Get the color for an edge based on its effect.
Args:
effect (str): The effect type of the edge.
signs (str): The effect type of the edge.
styles (dict): The styles dictionary.
Returns:
str: The color for the edge.
"""
return styles['effects'].get(effect, styles['effects']['default'])
return styles['signs'].get(effect, styles['signs']['default'])


def update_edge_property(edge, type="color", value="blue"):
Expand Down

0 comments on commit 02cb8d5

Please sign in to comment.