-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at data grid viewer in webR app
- Loading branch information
1 parent
629676f
commit 87d30c9
Showing
13 changed files
with
168 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Index: R-4.4.0/src/unix/system.c | ||
=================================================================== | ||
--- R-4.4.0.orig/src/unix/system.c | ||
+++ R-4.4.0/src/unix/system.c | ||
@@ -115,7 +115,24 @@ void R_FlushConsole(void) { | ||
} | ||
#endif | ||
|
||
+/* Dataviewer under Emscripten */ | ||
+#ifdef __EMSCRIPTEN__ | ||
+#include <emscripten.h> | ||
+static SEXP emscripten_do_dataviewer(SEXP call, SEXP op, SEXP args, SEXP rho) { | ||
+ SEXP data = CAR(args); | ||
+ SEXP title = CADR(args); | ||
+ if (!isString(title) || LENGTH(title) < 1) | ||
+ errorcall(call, _("invalid '%s' argument"), "title"); | ||
|
||
+ EM_ASM({ | ||
+ const title = UTF8ToString($1); | ||
+ globalThis.Module.webr.dataViewer($0, title); | ||
+ }, data, R_CHAR(STRING_ELT(title, 0))); | ||
+ | ||
+ return R_NilValue; | ||
+} | ||
+#endif | ||
+ | ||
void R_setupHistory(void) | ||
{ | ||
int value, ierr; | ||
@@ -326,6 +343,10 @@ int Rf_initialize_R(int ac, char **av) | ||
ptr_R_EditFile = NULL; /* for future expansion */ | ||
R_timeout_handler = NULL; | ||
R_timeout_val = 0; | ||
+ | ||
+ #ifdef __EMSCRIPTEN__ | ||
+ ptr_do_dataviewer = emscripten_do_dataviewer; | ||
+ #endif | ||
|
||
R_GlobalContext = NULL; /* Make R_Suicide less messy... */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters