toyplot
toyplot copied to clipboard
Set default table column widths based on content.
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

You can see that there is no visible margin between the STATE and ZONE columns (at the bottom "CALIFORNIAIII" instead of "CALIFORNIA
I know I can manually edit the column widths, but it would be nice if the default was not overlapping, focusing on safe readability.
I just realised the output when used directly in a Jupyter Notebook shows what I mean.

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.
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.