Git Product home page Git Product logo

basictabler's People

Contributors

cbailiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

basictabler's Issues

Update getSimpleColoredTblTheme()

Bring inline with changes in pivottabler:
Rename to getSimpleColoredTheme
Add new theme argument.
See same function in pivottabler for details of the changes to make.

Assigning multiple styles to the same cell in separate calls not possible

Assigning a style to the same cell more than once is not possible, and yields the following error message:

Error in cell$setPropertyValues(declarations) :
attempt to apply non-function

Minimal reproducable example:

tbl <- BasicTable$new()
tbl$addData(data.frame(a = c(1)), columnNamesAsColumnHeaders = F)
tbl$setStyling(
  declarations = list("font-weight" = "bold"),
  cells = tbl$getCells(specifyCellsAsList = FALSE, rowNumbers = c(1), columnNumbers = c(1)))
tbl$setStyling(
  declarations = list("text-align" = "center"),
  cells = tbl$getCells(specifyCellsAsList = FALSE, rowNumbers = c(1), columnNumbers = c(1)))
tbl$renderTable()

Of course, one can overcome this by gathering all styles to be applied to a given cell, and apply it in a single call. However, it would be desirable to be able to do this in multiple runs as well.

Work-around:

tbl <- BasicTable$new()
tbl$addData(data.frame(a = c(1)), columnNamesAsColumnHeaders = F)
tbl$setStyling(
  declarations = list("font-weight" = "bold", "text-align" = "center"),
  cells = tbl$getCells(specifyCellsAsList = FALSE, rowNumbers = c(1), columnNumbers = c(1)))
tbl$renderTable()

Treating cells as HTML elements

Hi, I'm making a table where one column includes URL adresses. I'm displaying the table inside a Shiny app.
Can I parse cell contents of that column (or specific cells) as valid HTML?
E.g.
'<a href="https://www.google.com/">https://www.google.com/</a>' should display as a link to Google.

Also, by using the $getHtml() method, I see that the cell contents look like this:
&lt;a href="https://www.google.com/"&gt;https://www.google.com/&lt;/a&gt

Basically the < and > symbols are being interpreted literally, perhaps that is preventing the conversion to actual HTML?

Add support for fmtFuncArgs to formatValue

Documentation note:
#' @param fmtFuncArgs If format is a custom R function, then fmtFuncArgs
#' specifies any additional arguments (in the form of a list) that will be
#' passed to the custom function.

Make jsonlite optional

Template:

   #' @description
   #' Return the contents of this object as JSON for debugging.
   #' @return A JSON representation of various object properties.
   asJSON = function() {
      if (!requireNamespace("jsonlite", quietly = TRUE)) {
         stop("The jsonlite package is needed to convert to JSON.  Please install the jsonlite package.", call. = FALSE)
      }
      jsonliteversion <- utils::packageDescription("jsonlite")$Version
      if(numeric_version(jsonliteversion) < numeric_version("1.1")) {
         stop("Version 1.1 or above of the jsonlite package is needed to convert to JSON.  Please install an updated version of the jsonlite package.", call. = FALSE)
      }
      return(jsonlite::toJSON(self$asList()))
   }

And remove the @import jsonlite lines from the inline documentation.

Add new function setColour/ColorStyling

Arguments:

  • cells
  • styleProperty (e.g. colour)
  • rangeType: discrete, continuous
  • discreteComparison: < <= = >= > (default >=)
  • a list of alternate value, colour, value, colour, etc.

Implementation:

  • Check list elements
  • Restructure into a list of lists (each a value, colour)
  • Order list by value
  • For each cell
    • If exactly matches a value, then use it, else
    • Find which pair of values it relates to and calculate the intermediate colour

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.