lineupjs
lineupjs copied to clipboard
Automatic column width adjustment (AutoFit)
Is there an option to adjust the column width according to the column name or according to the longest entry in a column? In MS Excel this feature is called AutoFit I think.
If no: Could you imagine adding this feature or are there some technical/visual constraints?
Thanks for your request, we'll have to look into this. It might be difficult for all column types and visualizations (renderer). Probably we might need to set a minimum width (e.g., bar charts of numerical columns).
Would you expect that the autofit considers also the width of the header title (or just the row content)?
Thank you for considering this!
A minimum width is probably required. Maybe it's even better to keep the fixed width for numerical columns with charts.
I believe the autofit should consider both the header and the content of a column as a default. From a user perspective it would be perfect to control this behavior with a high level configuration option.
I would love to offer a PR, but my Javascript/Typescript knowledge is pretty much nonexistent. I'm personally using lineupjs in a R shiny app with the R API.
This feature would be great, but while its missing is there anyway to adjust column widths via the javascript api?
when building the ranking you can specify the width: https://github.com/lineupjs/lineupjs/blob/790a0bbd36906539c27bae08ce517c27885ae56a/src/builder/column/ColumnBuilder.ts#L66
in an existing ranking you find the right column and then call https://github.com/lineupjs/lineupjs/blob/790a0bbd36906539c27bae08ce517c27885ae56a/src/model/Column.ts#L289