Skip to content

Latest commit

 

History

History
96 lines (79 loc) · 4.08 KB

TODO.org

File metadata and controls

96 lines (79 loc) · 4.08 KB

Explicitly typed columns

Having FatTable infer column types from the content of a table is nice, but as I learned from the need to have force_string!, sometimes we want to restrict the type of the column and throw an error if the content does not conform. So, perhaps when the table columns are specified, we can allow them to be terminated with a “sigil” that restricts its type:

@
at Date or DateTime column,
#
a Numeric column
?
a Boolean column
~
a String Column,
*
a tolerant Column, i.e., it infers the type from the content, but allows strings to be added as items in an otherwise typed column but treat them a nil for calculation purposes.
@*, #*, ?*
a Date, Numeric, or Boolean column that is also tolerant. `~*` could be treated the same as `~`.

Specify Column Widths

Allow a formatter to specify column widths. This could be a number of characters, which would be interpreted as a number of “ems” for LaTeX. Cell content larger than the width would be truncated. Any column without a width specified would be set at the width of the longest value in that cell, after initial formatting.

tab.to_text do |f|
  f.widths(a: 13, b: 30)
end

Possible enhancements:

  • specify an overall width and column widths as decimal or fractions, so that a column’s width would be that fraction of the overall width.
  • specify a Range for a width, so that the column would at least min and at most max, otherwise the width of its largest cell.

Conversion to Spreadsheets

  • State “TODO” from [2017-04-21 Fri 10:36]

This is a gem that I can include into the Table model to convert a table into a spread-sheet, or even a sheet in a multi-sheet spreadsheet file.

Conversion to HTML

Perhaps an obvious formatter would be HTML tables, but CSS controls the styling, so have to think on that one.

Conversion to JSON, YAML

These would need no color formatting and might prove useful.

Add Quandl or EODDATA Queries

Possible replacements for YQL.

CNCL Add from_yql for fetching from Yahoo

  • State “TODO” from [2017-04-21 Fri 10:35]

Cancelled because Yahoo shut down the YQL api service.

Add a constructor to allow fetching stock data from yql. Perhaps grab all available fields, then allow a select of those of interest.

Allow sorting by expression

Either by a single string argument as the sole argument to order_by, or use another method, such a order_with. Note that this can be done now by creating a new column having the sort expression with select and then just order_by that column. Perhaps that is an easy way to implement it.

Ensure that columns resulting from aggregates have proper type

  • State “WAIT” from “TODO” [2017-12-29 Fri 05:34]
  • State “TODO” from [2017-11-27 Mon 04:46]

After applying avg, does the column have the proper Numeric or Date, or DateTime type. How about Boolean aggregates?

Formatters

  • State “WAIT” from “TODO” [2017-04-21 Fri 10:36]
  • State “TODO” from [2017-04-21 Fri 10:35]

Need to think about ways to define formatters for Table for different output types, including tty, color-tty, latex, csv, spreadsheet?

Add a Group Boundary concept

  • State “WAIT” from “TODO” [2017-04-21 Fri 10:36]
  • State “TODO” from [2017-04-21 Fri 10:35]

If I want a table to perform sub-totals at various break points, need to have a way for a table to record its grouping boundaries. Maybe an array of row numbers? Automatically injected by the group-by method?

Add uniq method and set operations

  • State “WAIT” from “TODO” [2017-03-02 Thu 15:54]
  • State “TODO” from [2017-03-02 Thu 15:54]

For tables, add a method that eliminates any duplicate rows. Perhaps just apply Array#uniq to the columns?