Commit 14723987 authored by Lukas Pravda's avatar Lukas Pravda
Browse files

add more info to svg annotation file

parent f66e1a66
......@@ -182,13 +182,15 @@ def convert_svg(svg_string, ccd_id, mol: rdkit.Chem.Mol):
x = label_svg.attrib.get('x')
y = label_svg.attrib.get('y')
if any('nan' in x for x in [x,y]): # check for broken labels with 'nan' and '-nan'
if 'nan' in x or 'nan' in y: # check for broken labels with 'nan' and '-nan'
continue
temp = {
'x': float(x),
'y': float(y),
'style': label_svg.attrib.get('style'),
'dominant-baseline': label_svg.attrib.get('dominant-baseline'),
'text-anchor': label_svg.attrib.get('text-anchor'),
'tspans': [{
'value': tspan.text,
'style': '' if tspan.attrib.get('style') is None else tspan.attrib.get('style')
......
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