Releases: cbouy/mols2grid
Releases · cbouy/mols2grid
v2.2.0 - 2025/12/20
v2.1.0 - 2025/11/15
Minor update to follow the latest practices for interactive widgets.
Changed
- Switched to
anywidgetas the widget backend. - Using
uvfor venv and running tasks.
Added
ruffandblackfor linting/formatting.poethepoetfor managing dev commands.- Support for python 3.11 to 3.13.
rdkitis now part of the dependencies.
Removed
- Dropped support for python 3.7 to 3.9
v2.0.0 - 2023-07-23
This release is a major change on the UI contributed by @themoenen, refer to
PR#55 for the full list of changes:
Added
background_color="white"parameter added todisplayandsaveto control the background
color of each cell.- Property values displayed via subset or tooltip can now be copied by clicking them.
Changed
- Responsiveness: the grid as well as all UI components are now fully responsive, up until around
~415px wide. Smaller usage seems unlikely. n_items_per_pagereplaces then_rowsandn_colsparameters. The responsive CSS assumes
results to be a multiple of 12, otherwise a gap is displayed at the end of the grid.- Hover tooltips: now displayed when hovering the
iicon, and anchored by clicking this icon. - Save CVS: When exporting as CSV we now use a semicolon
;as delineator instead of a tab, this
way CSVs are properly previewed on Mac. - Templates: the
pages/tabletemplates and corresponding functions have been renamed to
interactive/staticfor clarity. - Parameters
widthandheighthave been renamed toiframe_widthandiframe_heightto be more
descriptive. - Improved the sorting UI to be more intuitive.
- You can now toggle between text/SMARTS search instead of having to click a dropdown.
- The checkbox menu icon was replaced with a more standard triple dot menu.
- The mols2grid-id is now permanently displayed next to the checkbox in the corner.
- SVGs are now rendered with a transparent background.
- The entire cell is now clickable, instead of just the tiny checkbox.
- Implemented some basic keyboard navigation: ENTER / ESC for selecting / unselecting, arrows and
TAB for navigation. - Copy to clipboard: this will now record a tab delineated text which is ready to be pasted into a
spreadsheet, instead of the less useful dictionary format. - The
tooltip_triggerparameter has been removed since callback and hover functionalities don't
overlap anymore. - We're now automatically adding
"img"to the subset instead of throwing an error. - A smaller default font size (12px) makes the experience out of the box a bit more practical.
Fixed
- Docstring now mention default values and some inconsistencies have been fixed.
- All UI elements are now neatly aligned and displayed on top so they're accessible without
scrolling. - Longer property values are now only truncated in the interactive grid, and broken into multiple
lines by default in the static grid, as it is mostly meant for printing. A new parameter
truncatelets you override the default truncating behavior. - The tooltip display zone (around which the tooltip is displayed) is now the entire cell instead
of only the image, so it never overlaps with any of the cell's data or functionality. - When you download a CSV or SMILES file without any cells selected, you will now download data for
all cells instead of an empty document. - Parameter
gapin static template didn't work. - We no longer resize the iframe if a custom
iframe_heightis set by the display function.
v1.1.1 - 2023-03-18
Added
- Support for
pathlib.Pathobjects as input fordisplay,save,MolGrid.from_sdf
andsdf_to_dataframe.
Changed
- The hover tooltip placement has been changed from
"bottom"to"auto". - Code and notebook formatting with
blackandisort. - Switched to
hatchlingfor the build process,tbumpfor versioning, and migrated to
using only thepyproject.tomlfile. - Refactored tests to use Pytest's
contest.pyfile.
Fixed
- CSV export when sorting the grid was not using the selected molecules.
v1.1.0 - 2022-12-24
Added
- Predefined JavaScript callbacks in the
mols2grid.callbacksmodule. Those can be
extensively configured:info: displays a bigger image alongside some common descriptors for the moleculeshow_3d: displays the molecule in 3Dexternal_link: opens a new tab. By default, opens Leruli.com
using the SMILES of the molecule.
- Support for
tupleof molecules indisplayandsave.
Changed
- The
"click"event is now automatically removed fromtooltip_triggerwhen
specifying a callback.
Fixed
- Issue #34: text searches containing any of the following regex characters
-[]{}()*+?.,\^$|#would automatically return an empty grid, preventing searching
for CAS numbers and any other identifier or text containing the above characters. This
has been temporarily patched until a proper fix is released in the underlying
list.jslibrary. - The link to the KNIME component on the corresponding badges has been fixed.
v1.0.0 - 2022-06-07
Added
- Notebooks running in VSCode and Jupyter Lab now support accessing selections from
Python, executing Python callback functions, and filtering based on other widgets.
Changed
- Python callbacks can now also be
lambdafunctions. - If
prerender=True, substructure highlighting will be automatically disabled by
default instead of raising an error. - When exporting a selection to a SMILES file through the GUI, the output no longer
contains a header. - Relies on a custom ipywidget to handle communication between the front-end/Javascript
and the back-end/Python. - When calling
grid.filterand other filtering methods, mols2grid will now use the
filtering code based on ipywidgets, except for Streamlit where it will use the older
JavaScript version of the code to maintain compatibility.
Fixed
- Automatically fitting to the content's height in Streamlit.
Removed
mappingargument for renaming fields, replaced byrenameinv0.1.0.mols2grid.selection, replaced bymols2grid.get_selection()inv0.1.0.
v0.2.4 - 2022/05/29
Fixed
- Calling
MolGrid.get_selection()when 2 grids with different names are present now returns the correct selection (Issue #31)
v0.2.3 - 2022/05/10
Fixed
- Doing a substructure search on molecules with explicit hydrogens should now highlight
the correct atoms.
v0.2.2 - 2022/04/04
Added
- A proper documentation page with tutorials can now be accessed online.
- Added a
single_highlight=Falseparameter to only highlight a single match per
molecule in substructure queries. - Added a "Check matching" button that only selects items that match the current search
and/or filters. - Added
custom_css,custom_headerandsort_byto the "table" template
Changed
- Compounds matching a substructure search are now aligned to the query molecule before
rendering the image. - When doing a substructure search, all matches are now highlighted by default. To only
show a single one, usesingle_highlight=True. - The Check all, Uncheck all and Invert selection buttons have been fixed. They now
actually check/uncheck ALL items, and not just the ones matching the current search. A
Check matching button has been added to reproduce the old behaviour. - If both
subsetandtooltipareNone, the index and image will be directly
displayed on the grid while the remaining fields will be in the tooltip. This makes the
default representation much more readable. - The default number of columns is now 5 for
template="table"(same as the other default
template)
Fixed
template="table"now correctly displays images whenprerender=True(Issue #27)- Displaying the grid with
template="table"in a notebook now automatically fits to the
content of the table.
v0.2.1 - 2022/02/23
Fixes
- Field names containing spaces are now correctly delt with
- The text search now looks for matches inside the values of the tooltip fields, rather than inside the HTML code of the tooltip which included tags and other irrelevant text
- Fixed an encoding bug when saving the grid as an HTML file on French Windows, which uses CP-1252 encoding instead of UTF-8