Create a gist now

Instantly share code, notes, and snippets.

@chan-ume /ui.R
Last active Aug 5, 2017

What would you like to do?
library(shiny)
library(googleAuthR)
library(googleAnalyticsR)
library(listviewer)
navbarPage("疑似query explorer",
tabPanel("Google アカウント連携", tabName = "setup", icon = icon("cogs"),
h1("Setup"),
googleAuthUI("Google_login"),
authDropdownUI("viewId_select")
),
tabPanel("metricsとdimention指定", tabName = "calc_metrics", icon = icon("calculator"),
h2("Calculated Metrics"),
fluidRow(
column(width = 6,
textInput("calculated_name", label = "Calculated Name", value = "Sessions Per Pageview")
),
column(width = 6,
textInput("calculated_exp", label = "Calculated Expression", value = "ga:sessions / ga:pageviews")
)
),
fluidRow(
column(width = 6,
multi_selectUI("metrics_calc", "Normal Metrics")
),
column(width = 6,
multi_selectUI("dimensions_calc", "Dimensions")
)
),
fluidRow(
column(width = 6,
dateRangeInput("date_clac", "Date Range")
),
column(width = 6,
br()
)
),
helpText("Calculated Metricsのところは適当なmetrics同士を計算させることができます"),
actionButton("get_calc", "Calculated Metric dataを取得!", icon = icon("download"), class = "btn-success"),
hr(),
h2("Results"),
dataTableOutput("calc_table")
),
tabPanel("複数期間", tabName = "multi_dates", icon = icon("calendar"),
h2("Multiple Dates"),
fluidRow(
column(width = 6,
multi_selectUI("metric_md", "Metric")
),
column(width = 6,
multi_selectUI("dim_md", "Dimensions")
)
),
fluidRow(
column(width = 6,
dateRangeInput("date1_md", "Date Range 1", start = Sys.Date() - 30)
),
column(width = 6,
dateRangeInput("date2_md", "Date Range 2", start = Sys.Date() - 60, end = Sys.Date() - 31)
)
),
helpText("2期間のデータを指定して、それぞれに関してデータを取得することができます"),
actionButton("get_md", "Multidate Dataを取得", icon = icon("download"), class = "btn-success"),
hr(),
h2("Results"),
dataTableOutput("md_table"),
hr()
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment