Skip to content

v0.4.0

Compare
Choose a tag to compare
@glin glin released this 04 Dec 20:58
· 70 commits to main since this release

Documentation - reactable 0.4.0

New features

  • Experimental support for rendering tables to static HTML in R. Use reactable(static = TRUE) to render a table to static HTML, or options(reactable.status = TRUE) to enable static rendering globally. With static rendering, tables are pre-rendered to their initial HTML so they appear immediately without any flash of content. Tables are then made interactive and subsequently rendered by JavaScript as needed. Static rendering requires the V8 package, which is not installed with reactable by default. Learn more in the Static Rendering article.
  • reactable() gains a meta argument to pass arbitrary data from R to JavaScript render functions and style functions. Custom metadata can be accessed using the state.meta property, and updated using updateReactable() in Shiny or Reactable.setMeta() in the JavaScript API. See examples of using custom metadata for custom rendering or custom metadata for conditional styling. (#255)
  • New Reactable.onStateChange() method in the JavaScript API that sets up a function to be called whenever the table state changes. (#265)
  • New Reactable.setData() method in the JavaScript API for updating the table data. (#278)
  • Reactable.downloadDataCSV() in the JavaScript API now supports an additional options argument to change the field or decimal separator, include specific columns, and exclude column headers. (#239, #293)
  • New Reactable.getDataCSV() method in the JavaScript API to get the table data as a CSV string.
  • New Reactable.toggleHideColumn() and Reactable.setHiddenColumns() methods in the JavaScript API to toggle or set hidden columns. JavaScript render functions and style functions also receive a new state.hiddenColumns property for the hidden columns in the table. (#246)
  • getReactableState() now includes the current sorted columns. (#265)

Minor improvements and bug fixes

  • Updated the documentation site for Internet Explorer 11 (IE 11) deprecation, Bootstrap 5 theming, and better accessibility. Examples now use modern JavaScript features that aren't supported in IE 11, like template literals and arrow functions. Examples now also use scalable font sizes and length units where appropriate (i.e., rem/em instead of px). The documentation site uses the default root font size of 16px, so examples may look different on pages that change the root font size. For example, Bootstrap 3 sets a default root font size of 10px, so you may need to adjust the rem values before adapting examples to your site. (Bootstrap 4 and above no longer change the default root font size).
  • R style functions no longer apply to aggregated cells and rows incorrectly. (@fawda123, #250)
  • JavaScript render functions and style functions no longer receive an invalid cellInfo.index or rowInfo.index property for aggregated cells and rows. (#250)
  • Column group header widths are now calculated correctly with hidden columns in the column group. (@Patrikios, #253)
  • NULL values in list-columns now correctly appear as missing values instead of [object Object]. NULL values are now represented as null values in JavaScript instead of an empty object like {}.
  • reactableTheme() styles no longer override custom user CSS in the HTML document <head>.
  • getReactableState() now accepts multiple values in its name argument to return a subset of state values.
  • reactable() now respects htmlwidget::sizingPolicy()'s viewer.fill and browser.fill and fills the RStudio Viewer pane by default. (@cpsievert, #280)
  • Using reactable() on a dplyr grouped data frame ( dplyr::group_by() or grouped_df) with rownames = TRUE no longer adds a stringsAsFactors column to the table. (@daattali, #283)

Breaking changes

  • Numeric NA values are now represented as null in JavaScript instead of an "NA" string. Numeric NaN, Inf, and -Inf values are now represented as NaN, Infinity, and -Infinity in JavaScript instead of "NaN", "Inf", and "-Inf" strings. (@daattali, #261)

    function(cellInfo) {
      // Old
      cellInfo.value // "NA", "NaN", "Inf", "-Inf"
    
      // New
      cellInfo.value // null, NaN, Infinity, -Infinity
    }
  • Support for Internet Explorer 11 (IE 11) is deprecated. Existing features will continue to work in IE 11, but new features may not support IE 11, and IE 11 is no longer tested.

  • The documentation website no longer supports IE 11.