Skip to content

Commit d886223

Browse files
author
Oliver Scott
committed
Add method for removing embedded images.
1 parent c0f7d8e commit d886223

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

scaffoldgraph/vis/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ def embed_node_mol_images(graph, size=(350, 300), draw_options=None, skip_existi
104104
data['img'] = ''
105105

106106

107+
def remove_node_mol_images(graph):
108+
"""Remove embeded images from a graph.
109+
110+
Parameters
111+
----------
112+
graph : ScaffoldGraph
113+
Input ScaffoldGraph
114+
115+
"""
116+
for node, data in graph.nodes(data=True):
117+
_ = data.pop('img', None)
118+
119+
107120
def add_root_node(graph):
108121
"""Add a root node to a scaffoldgraph.
109122

0 commit comments

Comments
 (0)