Trying to display HBox with widgets and luck

Here’s my code from a Jupyter Notebook (note–not JupyterLab):

!/opt/app-root/miniconda3/bin/jupyter nbextension enable --py --user widgetsnbextension
# import numpy as np; import pandas as pd

import plotly.graph_objects as go
from ipywidgets import widgets

reset_button = widgets.Button(
    description='Reset',  disabled=False,
# reset_button shows a button here
fig = go.Figure()
fig.add_bar(x=['giraffes', 'orangutans', 'monkeys'], y=[20, 14, 23],
                  hoverinfo="text", showlegend=False,
                  marker=dict(color="crimson", opacity=0.8))
# fig shows a bar chart here
widgets.HBox([reset_button, go.FigureWidget(fig)])

I expect that the HBox widget would display the reset button adjacent to the bar chart plot. What do I need to do to make widgets and plots active in the same bounded space?

This worked fine for me in Plotly version 4. Have things changed that much in version 5?

I am sure that this is related to the fact that I cannot get the trivial FigureWidget code to work. When I use the example (from the Plotly documentation at Plotly FigureWidget Overview | Python | Plotly):

f = go.FigureWidget()

nothing is displayed. When I use the explicit

I see the default empty graph.

Since I am using a classic notebook, I’ve tried downgrading to Plotly 4.14.3 (which allows me to explicitly install and enable the plotlywidget nbextension). But this has not changed anything. I still get no display of the FigureWidget by default.

And now it works! Somehow a poor set of dependencies possibly in the conda-forge channel. I was installing plotly before ipywidgets and that was possibly screwing things up. I expect plotly would have required ipywidgets, but no. And installing them after the fact seems to not Do The Right Thing. Wierd!