Repository navigation
Customdata missing in hoverdata in Ploly 6.0.0 #7375
Description
I have written an app in Python using Dash 2.18.2. In that app I have a map with a cycling track and several graphs to show distance vs. speed, distance vs. power etc. I have written an JS-script to show hover-info on the graphs when hovering over the map and vice versa. I use therefore 'customdata' that is encapsulated in the hoverdata. with this Dash code:
customdata = np.stack((df0['Dist'], overall_focus, df0['Lons'], df0['Lats']), axis=1)
hovertemplate=('Dist: %{customdata[0]:.1f}<br>'+
focus+': '+ '%{customdata[1]:.1f}<br>'+
'%{customdata[2]:.6f}<br>'+
'%{customdata[3]:.6f}<br>'+
'<extra></extra>')
# Create the scatter map figure with plotly.express
fig_trck = px.scatter_map(
map_style=map_mode,
center={'lat': center[1], 'lon': center[0]},
zoom=zoom,
lat=overall_lats,
lon=overall_lons
)
# Update traces with custom data and styling
fig_trck.update_traces(
customdata=customdata,
hovertemplate=hovertemplate,
marker_size=3,
marker_color=overall_focus,
marker_colorscale='Rainbow',
marker_showscale=False,
line_width=2,
line_color='Blue',
mode=mode
)
When I use Plotly 5.24.1 it gives this result in the DOM:
Object
points:Array(1)
0:
bbox:{x0: 894.0113118377704, x1: 896.0113118377704, y0: 354.0555201566335, y1: 356.0555201566335}
curveNumber: 0
customdata :( 4) [33519.2, 22.104, 4.507961, 51.843206]
lat:51.843206
lon:4.507961
pointIndex:4327
pointNumber:4327
[[Prototype]]:Object
when I use Plotly 6.0.0, I get this result:
Object
points : Array(1)
0:
bbox: {x0: 894.0113118377704, x1: 896.0113118377704, y0: 354.0555201566335, y1: 356.0555201566335}
curveNumber:0
customdata : undefined
lat:51.843206
lon:4.507961
pointIndex:4327
pointNumber:4327
[[Prototype]]: Object
length: 1
Can anyone explain this? Is it a bug or is customdata removed to another position in the DOM?
Activity
dgibbon-plotly commentedon Feb 22, 2025
@Hermeij I can't help you with this question technically ... but I AM super intrigued wrt what you're looking to display -> specifically "cycling track and several graphs to show distance vs. speed, distance vs. power etc." ... Do you have any screenshots, animated gifs, video of that??
Hermeij commentedon Feb 23, 2025
@dgibbon-plotly
Here is a link to a video I made for you:
https://1drv.ms/v/s!AuWRFk9aKH8Oi-QsAyQoccIL_PgWBA?e=WKaSVw
jonasvdd commentedon Mar 7, 2025
Hi @gvwilson, @Hermeij – I've been experimenting with plotly6, and it seems that this issue occurs when
customdatais not provided explicitly as a Python list. Ifcustomdatais passed as a numpy array or pandas Series instead (similar to how x and y trace properties are handled), the data gets base64-encoded, likely causingcustomdatato become undefined, hinting towards no consistent handling of encoded data across all trace-related properties!!.When this is fixed, this should at least result in several tests (for other array-alike traces as well)!
(In my use-case, I tried to utilize the
customdataof points during a clientside traceSelectedDatacallback)📷 ⬇ ~ customdata when using list and

plotly6.0.0📷 ⬇ ~ customdata when using numpy array / pd.Series
Hermeij commentedon Mar 15, 2025
@jonasvdd Thanks for your research into this issue. For now I will use an explicit list for customdata.
emilykl commentedon Oct 27, 2025
@Hermeij Would you be able to provide a minimal code snippet which reproduces the issue you are seeing?
The code you provided gives a general idea, but the variables
df0andoverall_focusare not defined within the code so I can't be sure what types they are.I just merged a PR #7608 which might possibly resolve this issue and I'd like to verify.
Hermeij commentedon Oct 29, 2025
@emilykl
This code gave at that time no customdata in hoverinfo. I see now that it is working correct with dash 3.2.0 and plotly 6.3.1
emilykl commentedon Oct 29, 2025
Great news @Hermeij ! Looks good on my end as well.
I'm going to close this issue, but feel free to reopen if you encounter it again.
AnnMarieW commentedon Nov 14, 2025
@emilykl
I tried the Generic Crossfilter Recipe example from the dash docs with the latest Plotly 6.4.0 and there is still an error.
As a workaround you can fix the error by making the
customdataa listcustomdata=list(df.index)Link to current open issue: plotly/plotly.py#5119. The fix might be similar to the one in pr 7608?