workflow: improve styling of workflow graph

This commit is contained in:
Frédéric Péters 2012-08-16 11:20:29 +02:00
parent 5312df6e83
commit 2d185c2213
1 changed files with 9 additions and 1 deletions

View File

@ -57,6 +57,10 @@ def remove_attribute(node, att):
def remove_style(node, top):
remove_tag(node, TITLE)
if node.get('fill') == 'white' and node.get('stroke') == 'white':
# this is the general white background, wipe it to be transparent
node.attrib['fill'] = 'transparent'
node.attrib['stroke'] = 'transparent'
for child in node:
remove_attribute(child, XLINK_TITLE)
style = child.get('style', None)
@ -65,7 +69,10 @@ def remove_style(node, top):
m = re.search('(?:stroke|fill):salmon', style)
if m:
top.set('class', top.get('class','') + ' page-subject')
if child.get('font-family'):
del child.attrib['font-family']
if child.get('font-size'):
child.attrib['font-size'] = str(float(child.attrib['font-size'])*0.8)
remove_attribute(child, 'style')
remove_style(child, top)
@ -78,6 +85,7 @@ def graphviz_post_treatment(content):
'''
tree = etree.fromstring(content)
tree.attrib['style'] = 'width: 100%'
for root in tree:
remove_tag(root, TITLE)
# remove_tag(root, POLYGON)