|
|
@ -74,18 +74,21 @@ class Svg(object): |
|
|
|
etree.PI( |
|
|
|
etree.PI( |
|
|
|
u('xml-stylesheet'), u('href="%s"' % css))) |
|
|
|
u('xml-stylesheet'), u('href="%s"' % css))) |
|
|
|
else: |
|
|
|
else: |
|
|
|
if not os.path.exists(css): |
|
|
|
if css.startswith('inline:'): |
|
|
|
css = os.path.join( |
|
|
|
css_text = css[len('inline:'):] |
|
|
|
os.path.dirname(__file__), 'css', css) |
|
|
|
else: |
|
|
|
with io.open(css, encoding='utf-8') as f: |
|
|
|
if not os.path.exists(css): |
|
|
|
css_text = template( |
|
|
|
css = os.path.join( |
|
|
|
f.read(), |
|
|
|
os.path.dirname(__file__), 'css', css) |
|
|
|
style=self.graph.config.style, |
|
|
|
with io.open(css, encoding='utf-8') as f: |
|
|
|
colors=colors, |
|
|
|
css_text = template( |
|
|
|
font_sizes=self.graph.config.font_sizes(), |
|
|
|
f.read(), |
|
|
|
id=self.id) |
|
|
|
style=self.graph.config.style, |
|
|
|
if not self.graph.pretty_print: |
|
|
|
colors=colors, |
|
|
|
css_text = minify_css(css_text) |
|
|
|
font_sizes=self.graph.config.font_sizes(), |
|
|
|
|
|
|
|
id=self.id) |
|
|
|
|
|
|
|
if not self.graph.pretty_print: |
|
|
|
|
|
|
|
css_text = minify_css(css_text) |
|
|
|
all_css.append(css_text) |
|
|
|
all_css.append(css_text) |
|
|
|
self.node( |
|
|
|
self.node( |
|
|
|
self.defs, 'style', type='text/css').text = '\n'.join(all_css) |
|
|
|
self.defs, 'style', type='text/css').text = '\n'.join(all_css) |
|
|
|