Closed parente closed 8 years ago
The padding is based on the cell margin, so it could have something to do with the space between cells. However, in this case it looks wrong. Make sure removing it preserves the apparent space between cells in a grid.
Make sure removing it preserves the apparent space between cells in a grid.
I'll dig a bit more into what is providing the space in the gridstack case today vs what dashboard server is doing.
Added a test_padding notebook. Here it is in notebook server with jupyter_dashboards 0.5.2:
Here it is in dashboard server WITH the fix in this PR:
Here it is in dashboard server WITHOUT the fix in this PR:
Note the excessive left-right padding without the fix.
I am not sure completely removing the padding is the correct solution. In the notebook, we add margin to the inner-cell
container to visually add space between each cell (seen on hover when authoring dashboard). The padding in dashboard server was an attempt to mimic that so the spacing is identical, so perhaps it just needed to be modified rather than removed.
In the colors example above (with @parente's fix), I think it just happens to look the same between the notebook and the dashboard server because the phosphor widgets have their own padding that happens to match the cell margin we were adding in the notebook. This exposes another issue since the notebook is not yet using the new JS libs that use Phosphor widgets. Perhaps this was the original issue in the first place instead of our padding being wrong.
I made another example notebook using Markdown cells containing images and observed a spacing difference (with @parente's fix):
Notebook:
Dashboard server:
Dashboard preview in the 0.5.2 layout extension (which uses Gridstack) does not include any extra padding on cells:
Our read-only Gridstack-light clone here in dashboard server dynamically adds padding which causes full cells to overflow and misalign (see right edge of table):
This PR removes the extra padding. @jhpedemonte, @dalogsdon any reason why it should remain?