Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No display in sidecar when using Tab widget with GridSpecLayout and Ipyleaflet #42

Open
nikhil003 opened this issue Apr 15, 2020 · 0 comments

Comments

@nikhil003
Copy link

I created a simple app using Ipywidgets where I used GridSpecLayout to define the layout of my app and then used a tab within the GridSpecLayout to have multiple tabs for the map.

Code with Tab widget

        self.app = GridspecLayout(9, 8, width='auto', height='600px')
        self.app[:, 2:] = Tab()
        self.app[0, :2] = VBox([Label("Vector:"), self._geomSelector])
        self.app[1, :2] = VBox([Label("Forcing GCM:"), self._gcmSelector])
        self.app[2, :2] = VBox([Label("Projection Year:"), self._yearsSelector])
        self.app[3, :2] = VBox([Label("Variable:"), self._variableSelector])
        self.app[4, :2] = VBox([Label("Frequency:"), self._freqSelector])
        self.app[5, :2] = VBox([Label("Time Slice:"), self._timeSelector])
        self.app[6:8, :2] = VBox([Label("Emission Scenario:"), self._emissionSelector])
        raster_im = self.get_overlay()

        self.app[:, 2:].children = [self.map]
        self.app[:, 2:].set_title(0, "State")
        self.map.add_layer(self._geoms[self._geomSelector.value])
        self.map.add_layer(raster_im)

Code without tab widget

        self.app = GridspecLayout(9, 8, width='auto', height='600px')
        self.app[:, 2:] = self.map
        self.app[0, :2] = VBox([Label("Vector:"), self._geomSelector])
        self.app[1, :2] = VBox([Label("Forcing GCM:"), self._gcmSelector])
        self.app[2, :2] = VBox([Label("Projection Year:"), self._yearsSelector])
        self.app[3, :2] = VBox([Label("Variable:"), self._variableSelector])
        self.app[4, :2] = VBox([Label("Frequency:"), self._freqSelector])
        self.app[5, :2] = VBox([Label("Time Slice:"), self._timeSelector])
        self.app[6:8, :2] = VBox([Label("Emission Scenario:"), self._emissionSelector])
        raster_im = self.get_overlay()

        self.map.add_layer(self._geoms[self._geomSelector.value])
        self.map.add_layer(raster_im)

When I used the code without tab widget, I could see the app in the Sidecar, however, when I used the tab widget, I can't see the map in the Sidecar.

Screenshot of app in Sidecar without Tab widget

sidecar_without_tab_widget

Screenshot of app in Sidecar with Tab widget

sidecar_with_tab_widget

Screenshot of app in notebook code cell

app_in_notebook_cell

I am not sure if this is some kind of incompatibility of Sidecar with the tab widget. The following screenshot show the behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant