-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
[RFC]: add support for pretty printing tabular data in the REPL #2067
Comments
One option would be to have the package live in |
What exactly would a "base" implementation do? Meaning, how feasible is it to actually make a "base" implementation? My sense is that we'd first need to create concrete implementations and then back out common logic, rather than the other way around. Atm, it's hard for me to envision what a base implementation would look like and whether it's even possible. |
There may be common logic around defining column widths (number of visible characters) and subsequent content truncation, or precision, but I'd be interested in seeing a concrete implementation first. Not wholly opposed to a |
I suppose we have some precedent for this with |
Yes, @Snehil-Shah will probably start with one implementation for the ASCII case in |
@kgryte @Planeshifter Found this package. It supports the output type using the argument I think we can have sub packages inside the Also I had a doubt, should I include box drawing characters (like '┐', '─') along with the ASCII designs or should I stick to only ASCII? Or should I include them in unicode? From what I read they are included with the extended ASCII sets so should be compatible with all terminal environments. |
I am not sure it makes sense to distinguish In which case, re: box drawing characters, if we supported, e.g., |
@Planeshifter @kgryte understood. Also I'll be following |
@Snehil-Shah As a first step, I would not create a "base" implementation. First, create the Unicode/ASCII implementation with an emphasis on clear separation of concerns. You really won't know what the contours of a "base" package should be until you've done a couple implementations (e.g., Unicode/ASCII, Markdown, LaTeX, HTML, etc). |
For reference, when I wrote the sparkline packages, I started with concrete sparkline implementations and then extracted out the common components to allow for code reuse. I suggest following a similar protocol here. |
Description
This RFC proposes adding support for displaying tabular data in the REPL. Possible signature:
It could work in a manner similar to
head
/tail
, where, ifn > 0
, show the firstn
rows, and, ifn < 0
, show the lastn
rows.The function could also support options, such as maximum cell width (e.g., to enforce showing abbreviated cell contents (such as truncating long strings)).
If
data
is an array of objects, could use keys as headers. Otherwise, if array of arrays, could support providing a list of headers.Related Issues
No.
Questions
@stdlib/plot/ascii/table
or similar) and then the REPL would just use that package for displaying tabular data? This probably makes sense, and we'd just need to define the API surface of the ASCII table package.ndarray
data.Other
ASCII tables are fairly common, so prior art should be relatively easy to find. For example,
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: