Releases: kcuilla/reactablefmtr
Releases · kcuilla/reactablefmtr
reactablefmtr 2.0.0
reactablefmtr 2.0.0
New Features
add_legend() & add_icon_legend()
- Place a legend below a reactable table
add_legend()
can be used to display the color palette used within the tableadd_icon_legend()
can be used to display the icon set used withinicon_sets()
- The legends can be aligned to either the right or left of the table
- A title and/or footer can be added to the legend with
title
orfooter
- The number of bins displayed within
add_legend()
can be adjusted withbins
background_img()
- Embed an image from the web into the background of a cell
- Unlike
embed_img()
, an image withinbackground_img()
will take up the entire contents of a cell background_img()
can also be used in conjunction withembed_img()
bubble_grid()
- Build a customizable bubble grid chart
- The size of the bubbles are in relation to the values within each column - the bigger the value, the bigger the size of the bubble
- The shapes of the bubble can either be circles or squares specified by
shape
cell_style()
cell_style()
can be used to customize the appearance of certain cells within a table. For example, if you wanted to display a particular value or set of values in a column as bold and in red text, you can do so by specifying either the row number or values themselves- Custom styling options include: the color, size, style, and weight of the font within the cell, the color, width, and style of the border around the cell, the vertical and horizontal alignment within the cell, and the background color of the cell. Animation is also applied to
cell_style()
by default, but can be turned off by setting to 'none'
gauge_chart()
- Build a customizable gauge chart
- Show the minimum and maximum values of the column on the gauge by setting
show_min_max
to TRUE - Many options that are available in
data_bars()
are available ingauge_chart()
google_font()
- Apply any font from Google Fonts https://fonts.google.com/ to a reactable table using
google_font()
group_border_sort()
- Add a styled border beneath rows of specified groups on sort
- Credit to Greg Lin, creator of {reactable} for writing the JS function
group_merge_sort()
- Hide rows containing duplicate values on sort
- Credit to Greg Lin, creator of {reactable} for writing the JS function
html()
- Apply HTML attributes to to text within
add_title()
,add_subtitle()
, andadd_source()
with thehtml()
helper function
merge_column()
- Merge and arrange two columns together
- Can be used with both numeric and non-numeric columns
- Control the appearance of both the established column and the merged text with options such as text size, color, font weight, font style, and text decoration
pill_buttons()
pill_buttons()
can be used to surround text or numeric values in a colored pill button. It is similar tocolor_tiles()
but is more condensed and round and the width of the pill dynamically adjusts based on the size of the text/values- As with
color_tiles()
,color_scales()
, anddata_bars()
, colors can be conditionally assigned from another column in the dataset and many of the other options available incolor_tiles()
are available inpill_buttons()
- Set
box_shadow
to TRUE to apply a box shadow to the buttons
sparklines
- Interactive sparklines can now be added to reactable tables via
react_sparkline()
andreact_sparkbar()
- In order to use the sparklines, one must download the {dataui} package from GitHub (https://github.com/timelyportfolio/dataui)
tooltip
- Add a tooltip to cells (used with
color_scales()
) - Used within
cell
ofreactable::colDef
Enhancements
add_title(), add_subtitle(), add_source()
- Added the ability to control the margin around each with
margin()
animate
- The animation of
data_bars()
can now be controlled withanimate
. Theanimate
parameter has also been added tocolor_scales()
,color_tiles()
,icon_sets()
, andicon_assign()
. The duration and timing function of the animation can be changed withinanimate
or the animation can be turned off by setting it to 'none'. For available timing functions, see CSS Transitions
color_tiles()
- Set
box_shadow
to TRUE to apply a box shadow to the tiles
data_bars()
- Optionally force a range of values to display their text labels on the outside-end of the filled bars when the text_position is set to either "inside-end", "inside-base", or "center". This can be useful when the length of the filled data bars is too short to the text labels on the inside of the filled bars
- Control the size of the text labels with
text_size
- Borders around the filled data bars can now be adjusted with the
border_style
,border_width
, andborder_color
options - Set
box_shadow
to TRUE to apply a box shadow to the bars
embed_img()
- The horizontal alignment within a cell can now be controlled with the
horizontal_align
option
icon_assign()
- The alignment of the icons within a column can now be changed to either left, right, or center with
align_icons
. Previously, icons could only be aligned to the left
icon_sets()
- Custom pre-selected icon sets can be assigned to values via
icon_set
. Options are "ski rating", "medals", and "batteries". Can be used withadd_icon_legend()
Bug Fixes
- Fixed a bug that would not assign colors to values within
color_scales()
,color_tiles()
, anddata_bars()
if there was no variance within the column - Fixed the sparkline tooltip to allow all values to show clearly on hover
- Fixed issue with
icon_assign()
that displayed an error for columns containing all zeros
Other Modifications
- The default color of
fill_color
withindata_bars()
andicon_assign()
has been changed to #67a9cf - The default position of
text_position
withindata_bars()
has been changed from "outside-end" to "inside-end" - Text is now centered vertically within
data_bars()
by default - The size of the text within
data_bars()
can now be changed withtext_size
- Added two additional themes: sanfran and no_lines
- Changed the underlying package in
save_reactable()
from {webshot2} to {webshot}. The {webshot} package is available on CRAN, so there is no need for users to manually download {webshot2} from GitHub - The entire contents of a table can be vertically centered by setting
centered
to TRUE within any of the {reactablefmtr} themes
reactablefmtr 0.2.0
reactablefmtr 0.2.0
New Features
- Data bars can now accept gradient colors by using
data_bars_gradient()
- Columns can now be conditionally formatted with
color_tiles()
- Images from the web can now be embedded into a column using
embed_img()
- Columns can now be formatted using formatters from the
scales
package using thenumber_fmt()
option - By default, values displayed with the
color_scales()
andcolor_tiles()
packages will automatically be shown in black or white color depending on the saturation of the background color of the cell. This option can be turned off by settingbright_values = FALSE
- Data bars are now animated on sort when using any of the three data bars formatters (
data_bars()
,data_bars_pos_neg()
,data_bars_gradient()
) - Conditional colors can now be applied to values in relation to the entire dataset or to a group of columns by providing column names or column positions with the
span
option withincolor_scales()
andcolor_tiles()
. Special thanks to June Chao for the contribution for this feature. - Icons can be assigned to each value in a column by using
icon_assign()
Bug Fixes
- An issue where aligning values while using
data_bars()
did not always align properly has been fixed
Other
- Due to the addition of
number_fmt()
which allows for the use of formatters from thescales
package, theadd_plus_sign()
formatter will be retired in the next CRAN release as well as thecommas
option in thedata_bars()
formatter, and thepercent
option in thedata_bars_pos_neg()
andicon_sets()
formatters