Commit 0a5177f6 authored by Lucas Bourneuf's avatar Lucas Bourneuf

fixup! dirty fix to get proportionnal distance between label and nodes based...

fixup! dirty fix to get proportionnal distance between label and nodes based on label number of lines
parent 25ca2ce4
......@@ -185,9 +185,10 @@ def visual_config_from_atoms(atoms:dict, base_atoms:dict,
if not isinstance(props[key], str):
text = treat_texts(props[key], (node, node))
props[key] = text
if labeldistance_multiplier is not None:
# print('TEXT:', repr(text), len(text.split('\\n')))
props['labeldistance'] = str(1 + labeldistance_multiplier * (len(text.split('\\n')) - 1))
if labeldistance_multiplier is not None:
text_size = len(text.replace('\\n', '\n').split('\n'))
# print('TEXT:', repr(text), text_size)
props['labeldistance'] = str(1 + labeldistance_multiplier * text_size)
for node in lower_annotations:
props = lower_annotations[node]
......@@ -197,9 +198,10 @@ def visual_config_from_atoms(atoms:dict, base_atoms:dict,
if not isinstance(props[key], str):
text = treat_texts(props[key], (node, node))
props[key] = text
if labeldistance_multiplier is not None:
# print('TEXT:', repr(text), len(text.split('\\n')))
props['labeldistance'] = str(1 + labeldistance_multiplier * (len(text.split('\\n')) - 1))
if labeldistance_multiplier is not None:
text_size = len(text.replace('\\n', '\n').split('\n'))
# print('TEXT:', repr(text), text_size)
props['labeldistance'] = str(1 + labeldistance_multiplier * text_size)
for key in properties:
if 'color' in properties[key]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment