bqplot icon indicating copy to clipboard operation
bqplot copied to clipboard

Error is thrown when a cell is selected in GridHeatmap

Open ChakriCherukuri opened this issue 2 years ago • 0 comments

Describe the bug When selection is enabled (interactions={"click": "select"}) in the GridHeatmap and a cell is clicked below exception is thrown:

File ~/miniconda3/envs/mlviz/lib/python3.9/site-packages/bqplot/traits.py:177, in array_to_json(ar, obj, force_contiguous)
    175         return [array_to_json(np.array(row), obj, force_contiguous) for row in ar]
    176     else:
--> 177         raise ValueError("Unsupported dtype object")
    179 if ar.dtype.kind in ['S', 'U']:  # strings to as plain json
    180     return ar.tolist()

ValueError: Unsupported dtype object

To Reproduce Code to reproduce the error:

fig = plt.figure(padding_y=0)

grid_map = plt.gridheatmap(
    np.random.rand(4, 4), 
    interactions={"click": "select"}
)
fig

When you click on any cell to select it, the above exception is thrown

Expected behavior grid_map.selected should be updated with the [row_id, col_id]

Screenshots If applicable, add screenshots to help explain your problem.

Additional context bqplot >= 0.12.36 ipywidgets >= 7.7.0

ChakriCherukuri avatar Oct 13 '23 17:10 ChakriCherukuri