Swap in Favorite Day, relabel some items

Got some early user feedback on labels; centered footers, added github link
This commit is contained in:
Carlos R. Mercado 2022-08-26 14:03:44 -04:00
parent e27cd1fe0c
commit 07cebf04f3
3 changed files with 27 additions and 14 deletions

View File

@ -15,11 +15,13 @@ shinyServer(function(input, output, session) {
api_key = readLines("api_key.txt"),
ttl = 0)
x$date <- as.Date(x$DAY_)
xx <<- x
results$table <- x
}
})
eoa_stats <- reactive({
eoa_activity <- list(
"txn" = sum(results$table$NUM_TX),
@ -33,23 +35,27 @@ shinyServer(function(input, output, session) {
output$fees <- renderText(ifelse(eoa_stats()$fees != '0 Ξ', eoa_stats()$fees, ""))
output$median_days <- renderText(ifelse(eoa_stats()$txn > 0, "<1 day", ""))
output$favorite_days <- renderText({
ifelse(eoa_stats()$txn > 0,
names(which.max(table(rep(weekdays(results$table$date), results$table$NUM_TX)))),
"")
})
output$percentile <- renderText({
round(
paste0(round(
100*(eoa_daily_history[eoa_daily_history$UNIQUE_DAYS == eoa_stats()$days, "eoa_cumprop"]),
2)
2),"%")
})
output$main_plot <- renderPlotly({
txn = as.numeric(eoa_stats()$txn)
days = as.numeric(eoa_stats()$days)
x = cut(txn,
x = cut(days,
breaks = c(0, 1,10,100,1000, Inf),
labels = c("1","2-10","11-100","101-1000","1001+"))
if(txn == 0){
if(days == 0){
plot_eoa(eoadh = eoa_daily_history, user_bar = NULL)
} else {
plot_eoa(eoadh = eoa_daily_history, user_bar = x)

View File

@ -4,7 +4,7 @@ source("global.R")
# Define UI -------
shinyUI(fluidPage(
title = 'Ethereum Dedication',
title = 'Ethereum Activity',
useShinyjs(),
tags$head(
@ -40,7 +40,7 @@ shinyUI(fluidPage(
div(class = "timecard-holder",
fluidRow(class='solid',
div(class='title', 'Ethereum Dedication'),
div(class='title', 'Ethereum Activity'),
div(class = "subtitle", 'Your Onchain Timecard'),
),
br(),
@ -87,10 +87,10 @@ shinyUI(fluidPage(
fluidRow(
column(6, class = 'light-left',
div(style = "height: 60px; width: 100%",
"Days Active: Chain Median", div(class = "show-result", textOutput("median_days")))),
"Favorite Day", div(class = "show-result", textOutput("favorite_days")))),
column(6, class = 'light-left',
div(style = "height: 60px; width: 100%",
"Your Percentile", div(class = "show-result", textOutput("percentile"))))
"More Active than", div(class = "show-result", textOutput("percentile"))))
),
fluidRow(
@ -107,7 +107,7 @@ shinyUI(fluidPage(
div(class = "subtitle", 'About this Timecard'),
),
fluidRow(
column(6, class = 'light-left',
column(6, class = 'light-left foot',
div(style = "height: 60px; width: 100%",
HTML(
paste0(
@ -115,16 +115,19 @@ shinyUI(fluidPage(
"<u><a href = 'https://sdk.flipsidecrypto.xyz/shroomdk'>ShroomDK</a></u>"
))
)),
column(6, class = 'light-right',
column(6, class = 'light-right foot',
div(style = "height: 60px; width: 100%",
p("Part 1 of our mission to clock you onchain. What do you want to know about yourself?"),
))
),
fluidRow(
column(12, class = 'light-left',
column(12, class = 'light-left foot',
div(style = "height: 60px; width: 100%, text-align: center",
HTML(
paste0("Join us in ","<u><a href = 'https://flipsidecrypto.com/discord'>Discord</a></u>")
paste0("Join us in ",
"<u><a href = 'https://flipsidecrypto.com/discord'>Discord</a></u>",
br(),"Code is open source on ",
"<u><a href = 'https://github.com/FlipsideCrypto/eth_activity'>Github</a></u>")
)
))
)

View File

@ -89,6 +89,10 @@
background: linear-gradient(180deg, rgba(60,47,110,1) 0%, rgba(13,12,28,1) 67%);
}
.foot {
text-align: center;
}
/*******************/
/* GENERAL Page */