Upload 3 files
Browse files- .gitattributes +1 -0
- Dockerfile +34 -11
- STATUS1.xlsx +3 -0
- app.R +53 -46
.gitattributes
CHANGED
|
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
STATUS1.xlsx filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
CHANGED
|
@@ -1,14 +1,37 @@
|
|
| 1 |
-
FROM rocker/
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
dplyr \
|
| 8 |
-
ggplot2 \
|
| 9 |
-
readr \
|
| 10 |
-
ggExtra
|
| 11 |
-
|
| 12 |
-
COPY . .
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM rocker/shiny:latest
|
| 2 |
|
| 3 |
+
# Instalar pacotes R necessários
|
| 4 |
+
RUN R -e "install.packages(c('shiny','readxl','dlookr','rpivotTable'), repos='https://cloud.r-project.org')"
|
| 5 |
|
| 6 |
+
# Criar diretório da app
|
| 7 |
+
RUN mkdir -p /srv/shiny-server/app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Copiar arquivos da app
|
| 10 |
+
COPY app.R /srv/shiny-server/app/app.R
|
| 11 |
+
COPY STATUS1.xlsx /srv/shiny-server/app/STATUS1.xlsx
|
| 12 |
+
|
| 13 |
+
# Criar diretório www para relatórios
|
| 14 |
+
RUN mkdir -p /srv/shiny-server/app/www
|
| 15 |
+
|
| 16 |
+
# Configurar shiny-server para rodar na porta 7860 (Hugging Face Spaces)
|
| 17 |
+
RUN echo "run_as shiny;\n\
|
| 18 |
+
server {\n\
|
| 19 |
+
listen 7860;\n\
|
| 20 |
+
location / {\n\
|
| 21 |
+
site_dir /srv/shiny-server/app;\n\
|
| 22 |
+
log_dir /var/log/shiny-server;\n\
|
| 23 |
+
directory_index off;\n\
|
| 24 |
+
}\n\
|
| 25 |
+
}" > /etc/shiny-server/shiny-server.conf
|
| 26 |
+
|
| 27 |
+
# Definir diretório de trabalho
|
| 28 |
+
WORKDIR /srv/shiny-server/app
|
| 29 |
+
|
| 30 |
+
# Permissões
|
| 31 |
+
RUN chown -R shiny:shiny /srv/shiny-server /var/log/shiny-server
|
| 32 |
+
|
| 33 |
+
# Expor porta 7860 (padrão Hugging Face Spaces)
|
| 34 |
+
EXPOSE 7860
|
| 35 |
+
|
| 36 |
+
# Comando para iniciar o servidor
|
| 37 |
+
CMD ["/usr/bin/shiny-server"]
|
STATUS1.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27869b5509c04e945c22d2b0d7583dfefcc7944e9a1e5c5488bb3d9a10ac3fc7
|
| 3 |
+
size 196277
|
app.R
CHANGED
|
@@ -1,58 +1,65 @@
|
|
| 1 |
library(shiny)
|
| 2 |
-
library(
|
| 3 |
-
library(
|
| 4 |
-
library(
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
varSelectInput("yvar", "Y variable", df_num, selected = "Bill Depth (mm)"),
|
| 16 |
-
checkboxGroupInput("species", "Filter by species",
|
| 17 |
-
choices = unique(df$Species), selected = unique(df$Species)
|
| 18 |
),
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
)
|
| 26 |
|
| 27 |
server <- function(input, output, session) {
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
})
|
| 32 |
|
| 33 |
-
output$
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
theme_light() +
|
| 37 |
-
list(
|
| 38 |
-
theme(legend.position = "bottom"),
|
| 39 |
-
if (input$by_species) aes(color = Species),
|
| 40 |
-
geom_point(),
|
| 41 |
-
if (input$smooth) geom_smooth()
|
| 42 |
-
)
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
}
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
shinyApp(ui, server)
|
|
|
|
| 1 |
library(shiny)
|
| 2 |
+
library(readxl)
|
| 3 |
+
library(dlookr)
|
| 4 |
+
library(rpivotTable)
|
| 5 |
+
|
| 6 |
+
ui <- fluidPage(
|
| 7 |
+
titlePanel("EDA no Browser – rpivotTable + dlookr"),
|
| 8 |
+
|
| 9 |
+
sidebarLayout(
|
| 10 |
+
sidebarPanel(
|
| 11 |
+
h4("Dataset"),
|
| 12 |
+
p("Arquivo: STATUS1.xlsx"),
|
| 13 |
+
|
| 14 |
+
actionButton("diag", "Gerar diagnóstico dlookr")
|
|
|
|
|
|
|
|
|
|
| 15 |
),
|
| 16 |
+
|
| 17 |
+
mainPanel(
|
| 18 |
+
tabsetPanel(
|
| 19 |
+
tabPanel(
|
| 20 |
+
"Pivot Table",
|
| 21 |
+
rpivotTableOutput("pivot")
|
| 22 |
+
),
|
| 23 |
+
tabPanel(
|
| 24 |
+
"Diagnóstico",
|
| 25 |
+
uiOutput("diag_ui")
|
| 26 |
+
)
|
| 27 |
+
)
|
| 28 |
+
)
|
| 29 |
+
)
|
| 30 |
)
|
| 31 |
|
| 32 |
server <- function(input, output, session) {
|
| 33 |
+
|
| 34 |
+
STATUS <- reactive({
|
| 35 |
+
read_excel("STATUS1.xlsx")
|
| 36 |
})
|
| 37 |
|
| 38 |
+
output$pivot <- renderRpivotTable({
|
| 39 |
+
rpivotTable(STATUS())
|
| 40 |
+
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
+
observeEvent(input$diag, {
|
| 43 |
+
|
| 44 |
+
# Criar diretório www se não existir
|
| 45 |
+
if (!dir.exists("www")) {
|
| 46 |
+
dir.create("www")
|
| 47 |
+
}
|
|
|
|
| 48 |
|
| 49 |
+
diagnose_web_report(
|
| 50 |
+
STATUS(),
|
| 51 |
+
output_dir = "www",
|
| 52 |
+
output_file = "diagnostico.html"
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
output$diag_ui <- renderUI({
|
| 56 |
+
tags$iframe(
|
| 57 |
+
src = "diagnostico.html",
|
| 58 |
+
width = "100%",
|
| 59 |
+
height = "800px"
|
| 60 |
+
)
|
| 61 |
+
})
|
| 62 |
+
})
|
| 63 |
}
|
| 64 |
|
| 65 |
shinyApp(ui, server)
|