lmcinnes / lmcinnes/umap

plot.show fails for interactive plots with interactive_text_search set to True

Open
#902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.3k
Forks
871
Avg merge
1d 13h
Merged PRs (30d)
5

Description

executing:

p = umap.plot.interactive( (...), interactive_text_search=True)
umap.plot.show(p)

yields:
ValueError: The type of ``plot_to_show`` was not valid, or not understood.

in umap/plot.py (lines 468:477), the function expects bokeh objects to be of type bpl.Figure, while interactive plots with search enabled return an object of type bokeh.models.layouts.Column:

p = umap.plot.interactive( (...), interactive_text_search=True)
print(type(p))

yields:
<class 'bokeh.models.layouts.Column'>

when passing the umap interactive plot directly to 'bokeh.plotting.show', instead of to umap.plot.show, the plot displays as expected:

from bokeh.plotting import show as show_interactive
(...)
p = umap.plot.interactive( (...), interactive_text_search=True)
#umap.plot.show(p)
show_interactive(p)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided interactive plot with interactive_text_search=True and inspect umap/plot.py lines 468-477, where plot.show validates the Bokeh object type. Confirm the returned bokeh.models.layouts.Column is handled and verify that umap.plot.show displays the plot successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.