Skip to content

ipywidgets GridspecLayout not supported #2694

@itsergiu

Description

@itsergiu
import plotly.graph_objects as go

fig = go.FigureWidget(go.Bar(
            x=[20, 14, 23],
            y=['giraffes', 'orangutans', 'monkeys'],
            orientation='h'))

from ipywidgets.widgets import HBox
HBox([fig,fig])

image

from ipywidgets import GridspecLayout
grid = GridspecLayout(1, 2)
grid[1,1]=fig
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-551846bd84cb> in <module>
      1 from ipywidgets import GridspecLayout
      2 grid = GridspecLayout(1, 2)
----> 3 grid[1,1]=fig

/opt/conda/lib/python3.8/site-packages/ipywidgets/widgets/widget_templates.py in __setitem__(self, key, value)
    316         self._id_count += 1
    317         obj_id = 'widget%03d' % self._id_count
--> 318         value.layout.grid_area = obj_id
    319 
    320         rows, columns = self._get_indices_from_slice(row, column)

/opt/conda/lib/python3.8/site-packages/plotly/basedatatypes.py in __setattr__(self, prop, value)
   4978         if match is None:
   4979             # Set as ordinary property
-> 4980             super(BaseLayoutHierarchyType, self).__setattr__(prop, value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions