matplotlib / ipympl

Matplotlib Jupyter Integration
https://matplotlib.org/ipympl/
BSD 3-Clause "New" or "Revised" License
1.57k stars 227 forks source link

Make handle_binary compliant with the KernelMessage.IMessage spec #505

Closed mctoohey closed 1 year ago

mctoohey commented 1 year ago

I found that ipympl was failing to display plots on more recent versions of the Jupyterlab 4.0 prereleases. This pull request fixes an issue where the handle_binary expects a DataView but new versions of Jupyterlab will pass it an ArrayBuffer.

Since Jupyterlab v4.0.0a21 the buffers deserialized from a KernelMessage are now of type ArrayBuffer instead of the DataView type handle_binary expects. However, it turns out that the spec for KernelMessage.IMessage has always specified that buffers could be either an ArrayBuffer or an ArrayBufferView. This commit ensures either type is accepted.

github-actions[bot] commented 1 year ago

Binder :point_left: Launch a binder notebook on branch mctoohey/ipympl/main