Skip to content

graph_objects.Table element takes up too much vertical space #3480

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

Closed
frobnitzem opened this issue Nov 19, 2021 · 2 comments
Closed

graph_objects.Table element takes up too much vertical space #3480

frobnitzem opened this issue Nov 19, 2021 · 2 comments

Comments

@frobnitzem
Copy link

Plotly is an amazing tool! However, the plotly.graph_objects.Table element takes up way too much vertical space.

This can be observed even inside the tables rendered in the plotly documentation:
https://plotly.com/python/table/

On my firefox browser, the very first table in that page only needs about 150 px of vertical space, but is somehow requesting a height of 525!

The rendered HTML in question looks like:

<g class="table" overflow="visible"
   style="box-sizing: content-box; position: absolute; left: 0px; overflow: visible; shape-rendering: crispedges; pointer-events: all;"
   width="734" height="525" transform="">
<g class="table-control-view"...></g></g>

The other tables on that page have similar issues.

For a work-around, I noticed the dash-sample-apps manually create HTML table elements (e.g. make_dash_table in https://github.com/plotly/dash-sample-apps/blob/main/apps/dash-drug-discovery/helpers.py)

@empet
Copy link

empet commented Dec 27, 2021

You can set accordingly the layout height and margin to remove the empty vertical space.

import plotly.graph_objects as go

fig = go.Figure(go.Table(header=dict(values=['A Scores', 'B Scores']),
                         cells=dict(values=[[100, 90, 80, 90], [95, 85, 75, 95]])))
fig.update_layout(height=100, margin=dict(t=10, b=2))
fig.show()

for more details print/display: help(go.layout.Margin)

@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

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

3 participants