(5.0) means API change, consider for version 5.0
Bug: HTML borders aren't precollapsed, should they be? (Check status.)
Fixing border properties.
j2 <- jams %>% merge_cells(1, 1:2) %>% set_all_borders()
j2[2]
which gives "Price" as the heading, which you thought had been hidden!
Have something like output.class.format()
using S3 double dispatch?
Or, maybe simpler, just output(x, format)
... where output
is an S3
generic.
Fixing borders.
left_border()<-
function and friends.[.huxtable
, [<-.huxtable
, and delete_props
and merge_props
, called by the other methods; and in set_attr_dimnames
.top_border(ht)[x + 1,]
and bottom_border(ht)[x,]
would overwrite each
other; similarly left and right borders.
Proper tidyselect for set_xxx
- i.e. set_bold(jams, everywhere, Price)
should work?
final()
, stripe
and everywhere
like last_col()
?eval_select
doesn't work with logicals. Another, maybe deeper one is the conflict
between set_bold(1:3, c(gear, mpg))
and set_bold(1:3, some_vector)
where this could be logical or numeric or character.>{\huxb{255,255,255}{2}}|
after each vertical border line - or =. It has to be the same width as
the vertical border, because it isn't centred otherwise.
So you could have it as a general property
(roughly speaking, do
vertical borders have "priority"); then maybe a convenience function
trim_borders
which would set the relevant border width and set vertical
border priority.In HTML (on FF), at the 4 "outer" corners different colours split diagonally; at all other corners, horizontal borders have priority except on the top row. i.e. it's an unreliable mess!
transparent colours in HTML, RTF, docx?
This is a better more general solution than autoformat
, which could
maybe be retired....
Get rid of max_width in to_screen, to_md. It's a huge hassle for the code, and who uses it?
though the problem is having to keep to options(screen)
, not
the fact that it is an argument.
Drop shadows? :-)
looks like a Tikz job in TeX...
Separate out table format representation and output from table creation.
maybe separate output formats into different packages?
Fix problem of different classes in padding, col_widths etc. (5.0)
pct()
so you can still do pct(.5, .25, .25)
units
(and errors
?) package would be relevantthe easiest thing is probably to have widths as always character if you have multiple units. And autoconvert numbers to percentages when they are input.
Border API rework (5.0)
similarly for padding: `set_padding(ht, 1:2, 1:2, pad("all", 2))
Text class also? (5.0)
set_text(ht, text(10, 'black', 'italic', 'cmss'))
one could also have e.g. escaped("$\lambda$") which would autoset escape_contents
Could hux$foo <- 1:5 (when foo is a new column) copy properties like cbind? (5.0)
Changes to a shadowed cell should be redirected to the shadowing cell (5.0), or generally affect the merged cell (e.g. borders will work for the relevant area, assuming they are not between two merged cells)
But be aware you could have accidents e.g. if a border is set below a row, and one merged cell then picks it up (as now!)
After e.g. June, set huxtable.add_colnames to TRUE by default (5.0).
headers property? (5.0)
set_
syntax; e.g. a headers() function returning a
matrixmaybe headers might have a numeric level rather than simple TRUE or FALSE. Then you could have different styles for different levels.
use tidyselect::vars_select for columns in set_ interface (5.0)
ht %>% set_bold(TRUE) %>% insert_row("Blah", "blah")
, should the new row have bold TRUE?having it instead of copying would mean that only properties set with e.g. everywhere
on a
row would be copied to a new column. But what about new rows when the header row is different?
And with the <-
syntax, you can't tell what the subset applied is, right?
opendocument text/spreadsheet for libreoffice?
At some point. Guess not a lot of demand.
as_datatable for DT::renderDT()?
is there a use case for going via huxtable and not directly to renderDT?
Look at perl's Latex::Table and how they do it
autouses 'p{5cm}' column for cols with > 30 chars in a cell
Use more purrr and rlang features, as we depend on these packages anyway
Use cli
for to_screen
? Could maybe get ideas on code. It also has double borders.
col_to_headers
which would take a column, sort by unique values, and replace the column with a rowspan-merged header?
headers
flag, if we allow header rows to be in the middle of datamaybe allow multiple columns
Rotate whole table using "rotating" package (for PDF) and what for HTML (simple CSS rotation on table element, probably)?
Better centring of LaTeX tables and handling of width. Maybe push \resizebox
Replace latex_float by float and use the CSS float property on the table (deals with text flow)?
wraparound()
, and keep latex_float()
separate.You can combine options between HTML float (left/right) and wrapfig float.
rescale numeric row_height and col_width when subsetting, as now under rbind/cbind?
Rename clean_contents and export it?
Conceivably, people might want to override some individual cell contents with raw HTML/TeX/plain text. This still wouldn't affect properties.
use \hhline double-line feature to handle multiple border widths? i.e. top line is background, bottom line is border?
not sure we can change colours halfway through though
facilities for re-writing a table in an existing document.
id
table-level property, automatically set to a random
number)this may be a separate package.
collapsed_border_xxx should return left, right, top, bottom rather than vert, horiz?
You do the collapsing, but might want to provide lrtb borders
special-case single horizontal lines across whole table?
make \booktabs or similar work
way to address a particular subset of a matrix, e.g.
just too hard in TeX
table of descriptive statistics using skimr
:
think if this is even a good idea and people shouldn't just DIY with
skim_to_wide
? Yeah, maybe not
Methods for R packages?
tibble::glimpse prints stuff and returns the original
Use arydshln in LaTeX? Seems incompatible with hhline
latex row height is of \textheight when numeric, not % table height. Hard to fix.
when inserting one hux into another, row heights/col widths may no longer make sense,
because they are implicit proportions.
Could S4 classes work to cbind data frames? Probably not, or hella complex and requires reworking internals: https://stackoverflow.com/questions/47967264/dispatch-of-rbind-and-cbind-for-a-data-frame
Implement dplyr::bind_rows
and bind_cols
?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.