Skip to content

Commit cfcc576

Browse files
committed
Fix color graphing to loop through blue, red, green.
1 parent 3f48cb7 commit cfcc576

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

nipype/pipeline/engine/workflows.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,13 @@ def _get_dot(self, prefix=None, hierarchy=None, colored=False,
923923
prefix = ' '
924924
if hierarchy is None:
925925
hierarchy = []
926-
colorset = ['#FFFFC8', '#0000FF', '#B4B4FF', '#E6E6FF', '#FF0000',
927-
'#FFB4B4', '#FFE6E6', '#00A300', '#B4FFB4', '#E6FFE6']
926+
colorset = ['#FFFFC8', # Y
927+
'#0000FF', '#B4B4FF', '#E6E6FF', # B
928+
'#FF0000', '#FFB4B4', '#FFE6E6', # R
929+
'#00A300', '#B4FFB4', '#E6FFE6', # G
930+
'#0000FF', '#B4B4FF'] # loop B
931+
if level > len(colorset) - 2:
932+
level = 3 # Loop back to blue
928933

929934
dotlist = ['%slabel="%s";' % (prefix, self.name)]
930935
for node in nx.topological_sort(self._graph):
@@ -963,8 +968,6 @@ def _get_dot(self, prefix=None, hierarchy=None, colored=False,
963968
colored=colored,
964969
simple_form=simple_form, level=level + 3))
965970
dotlist.append('}')
966-
if level == 6:
967-
level = 2
968971
else:
969972
for subnode in self._graph.successors_iter(node):
970973
if node._hierarchy != subnode._hierarchy:

0 commit comments

Comments
 (0)