Skip to content

Commit 58fc79d

Browse files
committed
Fix issue by cycling BRG for nested colors
1 parent 82163d3 commit 58fc79d

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
@@ -902,8 +902,13 @@ def _get_dot(self, prefix=None, hierarchy=None, colored=False,
902902
prefix = ' '
903903
if hierarchy is None:
904904
hierarchy = []
905-
colorset = ['#FFFFC8', '#0000FF', '#B4B4FF', '#E6E6FF', '#FF0000',
906-
'#FFB4B4', '#FFE6E6', '#00A300', '#B4FFB4', '#E6FFE6']
905+
colorset = ['#FFFFC8', # Y
906+
'#0000FF', '#B4B4FF', '#E6E6FF', # B
907+
'#FF0000', '#FFB4B4', '#FFE6E6', # R
908+
'#00A300', '#B4FFB4', '#E6FFE6', # G
909+
'#0000FF', '#B4B4FF'] # loop B
910+
if level > len(colorset) - 2:
911+
level = 3 # Loop back to blue
907912

908913
dotlist = ['%slabel="%s";' % (prefix, self.name)]
909914
for node in nx.topological_sort(self._graph):
@@ -942,8 +947,6 @@ def _get_dot(self, prefix=None, hierarchy=None, colored=False,
942947
colored=colored,
943948
simple_form=simple_form, level=level + 3))
944949
dotlist.append('}')
945-
if level == 6:
946-
level = 2
947950
else:
948951
for subnode in self._graph.successors_iter(node):
949952
if node._hierarchy != subnode._hierarchy:

0 commit comments

Comments
 (0)