Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Highlight dataTable cell(s) based on surface hoverdata

$
0
0

@papalazorous wrote:

I’ve got a surface plot and a dataTable next to it and I want to generate a highlighted region on the dataTable based on what I am hovering over on the surface, so based on this hover I should be highlighting the following cell:

I am attempting to do this via a callback with Input as surfaceGraph=hoverdata, Output as table=selected_cells.

My output is currently formatted as:
selectedCellsList = [{‘row’:str(tenorLocation), ‘column’:str(strikeLocation)}]

…I can get everything from the hoverdata and match it to a point on the surface (to give me integers for row and column), but I receive the following error:
dash.exceptions.InvalidCallbackReturnValue: Invalid number of output values for …volGrid.selected_cells…
Expected 1 got 2

I have tried to convert this to a string, but then i receive the error:
Expected the output type to be a list or tuple but got…str(selectedCellsList)

I’m a bit stumped. On the initialisation of another table I can get an area to be selected with the following option:
selected_cells=[{‘row’: ‘5’, ‘column’: ‘2’}]

So I think I have everything in the correct format…

Any suggestions/resolutions would be greatly appreciated.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles