Skip to content

Commit 95601a8

Browse files
author
wjm41
committed
caption_transform now affects title
1 parent e570f4f commit 95601a8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

molplotly/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def add_molecules(
120120
smiles_col : str | list[str], optional
121121
name of the column in df containing the smiles plotted in fig (default 'SMILES').
122122
If provided as a list, will add a slider to choose which column is used for rendering the structures.
123+
mol_col : Mol | list[Mol], optional
124+
name of the column in df containing RDKit Mol objects of the molecules plotted in fig (default None).
125+
If not None, the structures will be drawn using the coordinates of the Mol objects.
126+
If provided as a list, will add a slider to choose which column is used for rendering the structures.
123127
show_img : bool, optional
124128
whether or not to generate the molecule image in the dash app (default True).
125129
svg_size : float, optional
@@ -296,7 +300,10 @@ def display_hover(hoverData, value):
296300
)
297301

298302
if title_col is not None:
299-
title = df_row[title_col]
303+
title = df_row[title_col].astype(str)
304+
if title_col in caption_transform:
305+
title = caption_transform[title_col](title)
306+
300307
if len(title) > wraplen:
301308
if wrap:
302309
title = textwrap.fill(title, width=wraplen)

0 commit comments

Comments
 (0)