Skip to content

Commit

Permalink
Merge pull request no-types#1 from vbisrikkanth/master
Browse files Browse the repository at this point in the history
Bugfixes and update
  • Loading branch information
Praveen N authored May 19, 2018
2 parents 54ccc51 + a248e95 commit ddc2315
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Package: RagGrid
Type: Package
Title: A Wrapper of the JavaScript Library 'DataTables'
Title: A Wrapper of the JavaScript Library 'ag-Grid'.
Version: 0.1.1
Authors@R: c(
person("Praveen", "N", email = "[email protected]", role = c("aut", "cre")),
person("Srikkanth", "M",email = "[email protected]",role = c("aut", "ctb"))
)
Maintainer: Praveen N<[email protected]>, Srikkanth M<[email protected]>
Description: Data objects in R can be rendered as HTML tables using the
JavaScript library 'DataTables' (typically via R Markdown or Shiny). The
'DataTables' library has been included in this R package. The package name
'DT' is an abbreviation of 'DataTables'.
JavaScript library 'ag-grid' (typically via R Markdown or Shiny). The
'ag-grid' library has been included in this R package. The package name
'RagGrid' is an abbreviation of 'R agGrid'.
URL: https://github.com/praveenn-vbi/RagGrid/
BugReports: https://github.com/praveenn-vbi/RagGrid/issues
License: MIT
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# R agGrid
R interface to ag-grid.

This package provides a function `RagGrid()` to display R data via the [ag-grid](https://www.ag-grid.com/) library.

## Installation

We're still actively developing and hopefully it'll be available in CRAN soon.

But feel free to install from github.
You may install the development version using **devtools**:

```r

# the development version
devtools::install_github('praveenn-vbi/RagGrid')

# then try DT::datatable(iris) as a hello world example
```
15 changes: 10 additions & 5 deletions inst/htmlwidgets/RagGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ HTMLWidgets.widget({
factory: function(el, width, height) {
let gridOptions={};
// TODO: define shared variables for this instance
var sel_handle = new crosstalk.SelectionHandle();
var filter_handle = new crosstalk.FilterHandle();
const sel_handle = new crosstalk.SelectionHandle();
const filter_handle = new crosstalk.FilterHandle();
sel_handle.on("change", function(e) {
if (e.sender !== sel_handle) {
// scatter.clearBrush();
Expand Down Expand Up @@ -55,8 +55,11 @@ HTMLWidgets.widget({
sel_handle.set(selectionKeys);
}
}
sel_handle.setGroup(x.settings.crosstalk_group);
filter_handle.setGroup(x.settings.crosstalk_group);

if(x.settings.crosstalk_group){
sel_handle.setGroup(x.settings.crosstalk_group);
filter_handle.setGroup(x.settings.crosstalk_group);
}

gridOptions=Object.assign(defaultGridOptions,x.gridOptions);
const rowHeaders = Object.keys(data);
Expand All @@ -77,7 +80,9 @@ HTMLWidgets.widget({
rowHeaders.forEach((rowHeader)=>{
rowData[filedRowHeaderMap[rowHeader]] = data[rowHeader][rowIndex];
});
rowData.ctKey=x.settings.crosstalk_key[rowIndex];
if(x.settings.crosstalk_key){
rowData.ctKey=x.settings.crosstalk_key[rowIndex];
}
rowDataList.push(rowData);
}
if(x.licenseKey){
Expand Down

0 comments on commit ddc2315

Please sign in to comment.