plotly / plotly/plotly.py

Hover data not showing correctly for px.scatter inside go.FigureWidget

Open
#4,801 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Environment requirements

Python 3.11 on Linux, in Jupyter Notebook inside VSCode.

Extensions:
ms-toolsai.jupyter v2024.1.1

Packages:
plotly: 5.24.1
ipywidgets: 8.1.5
jupyterlab 3.6.8

Issue description

Hello, I'm having this issue where the hover data doesn't seem to show correctly, but it instead shows "%{customdata[0}" on the hover box.

fig_scatter = go.FigureWidget(px.scatter(df,
x='some_column1', y='some_column2',
title=f'Scatterplot',
hover_data=['column_in_df']
))

If I have the px.scatter plotted using a go.Figure directly it works but with go.FigureWidget it doesn't.

x and y columns show on the hover data, while this extra column_in_df doesn't even though it's also part of the df.

Let me know if any additional information is needed. Any help is appreciated, thank you!

image

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 reported behavior with px.scatter wrapped in go.FigureWidget in a Jupyter Notebook, using the stated Python, Plotly, and ipywidgets versions. Compare it with the same px.scatter passed to go.Figure and inspect how hover_data is represented; done means the hover box shows the column_in_df value instead of the literal %{customdata[0} text.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.