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

Set default table column widths based on content. #178

Open
kannes opened this issue Jul 31, 2017 · 3 comments
Open

Set default table column widths based on content. #178

kannes opened this issue Jul 31, 2017 · 3 comments

Comments

@kannes
Copy link
Contributor

kannes commented Jul 31, 2017

data_table = toyplot.data.read_csv("/usr/share/gdal/stateplane.csv")
data_table = data_table[:10]
canvas = toyplot.Canvas()
table = canvas.table(data_table)

gives me

untitled

You can see that there is no visible margin between the STATE and ZONE columns (at the bottom "CALIFORNIAIII" instead of "CALIFORNIAIII" and the headers of PROJ_METHOD DATUM as well as USGS_CODE and EPSG_PCS_CODE overlap.

I know I can manually edit the column widths, but it would be nice if the default was not overlapping, focusing on safe readability.

@kannes
Copy link
Contributor Author

kannes commented Jul 31, 2017

I just realised the output when used directly in a Jupyter Notebook shows what I mean.
untitled

@tshead2 tshead2 changed the title Table plot has overlapping headers Set default table column widths based on content. Aug 1, 2017
@tshead2
Copy link
Member

tshead2 commented Aug 1, 2017

Until recently we had no way to know the width of column text. Now that we handle all text layout internally, there's no reason not to set the column width based on content.

@tshead2 tshead2 added this to the Toyplot 0.16.0 milestone Sep 1, 2017
@tshead2 tshead2 modified the milestones: Toyplot 0.16.0, Toyplot 0.17.0 Nov 1, 2017
@tshead2
Copy link
Member

tshead2 commented Apr 3, 2019

Same goes for default row heights ... it would be nice if row heights were appropriate for their content. The only caveat is that we have to maintain the ability to explicitly size the table.

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

No branches or pull requests

2 participants