Switch to Reactable table

Still have todo list
This commit is contained in:
Carlos R. Mercado 2022-08-15 10:54:48 -04:00
parent da410ae2aa
commit 3a7c90eab6
6 changed files with 73 additions and 29 deletions

3
.gitignore vendored
View File

@ -49,4 +49,5 @@ po/*~
rsconnect/
# ShroomDK api key
api_key.txt
api_key.txt
task.txt

View File

@ -1,3 +1,4 @@
library(shinyjs)
library(jsonlite)
library(httr)
library(shroomDK)
@ -5,6 +6,7 @@ library(ggplot2)
library(plotly)
library(dplyr)
library(DT)
library(reactable)
# gitignored - get your own ShroomDK key from Flipside Crypto!
api_key <- readLines("api_key.txt")
@ -93,8 +95,8 @@ tbl_eoa <- function(eoadh = eoa_daily_history, eoa_activity){
x = data.frame(
"Days Active" = eoa_activity$DAYS_ACTIVE,
"Number of Tx" = eoa_activity$NUM_TX,
"Active Days Percentile" = {
"Tx Count" = eoa_activity$NUM_TX,
"Percentile" = {
paste0(
100 *
round(
@ -106,19 +108,7 @@ tbl_eoa <- function(eoadh = eoa_daily_history, eoa_activity){
)
datatable(x,
options = list(paging = FALSE, ## paginate the output
searching = FALSE,
autoWidth = TRUE, ## use smart column width handling
server = FALSE, ## use client-side processing
dom = 't',
columnDefs = list(list(targets = '_all',
className = 'dt-center'))
),
extensions = 'Buttons',
filter = 'none',
rownames = FALSE
)
return(x)
}

View File

@ -15,8 +15,10 @@ shinyServer(function(input, output) {
})
output$compare <- DT::renderDataTable({
output$compare <- renderReactable({
reactable(
tbl_eoa(eoa_daily_history, eoa_activity = results())
)
})
output$main_plot <- renderPlotly({

View File

@ -1,5 +1,4 @@
library(shiny)
library(shinyjs)
source("global.R")
# Define UI -------
@ -55,20 +54,20 @@ shinyUI(fluidPage(
div( # re-using chart classes to make smoother outlining
class = 'chart-container',
div(
class = 'chart-block',
class = 'chart-block eoa-bar',
fluidRow(
column(10, class = 'eoa-bar',
column(10,
textInput(inputId = "address", label = "",
placeholder = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
width = '100%')
),
column(2, class = 'eoa-btn',
column(2, class = 'eoa-btn',
actionButton("submit", label = "Search")
)
),
conditionalPanel("input.submit > 0",
div(class = 'eoa-tbl',
dataTableOutput("compare")
reactableOutput("compare")
)
)
)),

View File

@ -3,11 +3,11 @@
/*PUT CUSTOM CLASSES HERE*/
/*******************/
.eoa-bar {
text-align: center;
margin: 0% 5%;
.eoa-bar {
text-align: center;
}
.eoa-btn {
.eoa-btn {
margin-top: 30px;
}
@ -152,6 +152,7 @@ hr {
background: #10151A;
border: 1px solid #03FFFF;
border-radius: 4px;
margin-left: 30px;
font-family: Roboto Mono !important;
color: #FFFFFF;
}

View File

@ -33,6 +33,16 @@
"Hash": "4bf2c61e656bbc238634c798c208d386",
"Requirements": []
},
"Matrix": {
"Package": "Matrix",
"Version": "1.4-1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "699c47c606293bdfbc9fd78a93c9c8fe",
"Requirements": [
"lattice"
]
},
"R6": {
"Package": "R6",
"Version": "2.5.1",
@ -273,6 +283,7 @@
"glue",
"gtable",
"isoband",
"mgcv",
"rlang",
"scales",
"tibble",
@ -392,6 +403,14 @@
"rlang"
]
},
"lattice": {
"Package": "lattice",
"Version": "0.20-45",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "b64cdbb2b340437c4ee047a1f4c4377b",
"Requirements": []
},
"lazyeval": {
"Package": "lazyeval",
"Version": "0.2.2",
@ -430,6 +449,17 @@
"rlang"
]
},
"mgcv": {
"Package": "mgcv",
"Version": "1.8-40",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "c6b2fdb18cf68ab613bd564363e1ba0d",
"Requirements": [
"Matrix",
"nlme"
]
},
"mime": {
"Package": "mime",
"Version": "0.12",
@ -454,7 +484,9 @@
"Source": "Repository",
"Repository": "CRAN",
"Hash": "9469aeaeddf4f48a7ac70877d0b7ba36",
"Requirements": []
"Requirements": [
"lattice"
]
},
"openssl": {
"Package": "openssl",
@ -629,11 +661,30 @@
"xtable"
]
},
"shinyjs": {
"Package": "shinyjs",
"Version": "2.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "802e4786b353a4bb27116957558548d5",
"Requirements": [
"digest",
"jsonlite",
"shiny"
]
},
"shroomDK": {
"Package": "shroomDK",
"Version": "0.1.0",
"Source": "unknown",
"Hash": "3ff435b21b1512b7ad7f271c5e787471",
"Source": "GitHub",
"RemoteType": "github",
"RemoteHost": "api.github.com",
"RemoteRepo": "sdk",
"RemoteUsername": "FlipsideCrypto",
"RemoteRef": "HEAD",
"RemoteSha": "c5dd70f702d57374f294d7107109ca1819dca863",
"RemoteSubdir": "r/shroomDK",
"Hash": "020a689f6cd0bb4d8e0d7411c7fbe3ab",
"Requirements": [
"httr",
"jsonlite"