{"id":24562787,"url":"https://github.com/jhk0530/shinyassemble","last_synced_at":"2025-04-19T17:43:04.905Z","repository":{"id":137114810,"uuid":"245811316","full_name":"jhk0530/shinyAssemble","owner":"jhk0530","description":"Visualize shiny applications structure","archived":false,"fork":false,"pushed_at":"2020-04-19T07:56:18.000Z","size":59,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-04T09:39:27.429Z","etag":null,"topics":["shinyapps","visualize"],"latest_commit_sha":null,"homepage":"https://jhkim.shinyapps.io/shinyAssemble/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhk0530.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-08T12:36:02.000Z","updated_at":"2023-04-29T13:58:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff2ca2d8-b22c-4b2b-8a00-3b4bded37ded","html_url":"https://github.com/jhk0530/shinyAssemble","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhk0530%2FshinyAssemble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhk0530%2FshinyAssemble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhk0530%2FshinyAssemble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhk0530%2FshinyAssemble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhk0530","download_url":"https://codeload.github.com/jhk0530/shinyAssemble/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235253790,"owners_count":18960485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shinyapps","visualize"],"created_at":"2025-01-23T09:17:56.086Z","updated_at":"2025-01-23T09:17:57.597Z","avatar_url":"https://github.com/jhk0530.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :yellow_heart: shinyAssemble \u003cimg src = 'shinyAssemble.png' width = 120 align = 'right'\u003e\u003c/img\u003e\n\n\nshinyAssemble reads Shiny applications code ( one file `app.R` with `ui`, `server` ) \u003cbr\u003e\nto Visualize shiny application's structure ( as **Assembly Instruction Style** :stuck_out_tongue_winking_eye: ) \u003cbr\u003e\nnote that, hovering node will show element's type ! \u003cbr\u003e\n\n\n### :wrench: Install\nuse this code\n\n```R \n\nremotes::install_github('jhk0530/shinyAssemble')\n\nlibrary(shinyAssemble)\n\nshinyAssemble()\n\n```\n\n### :page_facing_up: How to Use\n\n1. Give code in code area in left.\n2. Select color options in right-top.\n3. push `investigate` button.\n\n4. push `module` button. (optional) \n\n## [Example, Shiny Text](https://shiny.rstudio.com/articles/basics.html) \n\n\n![image](https://user-images.githubusercontent.com/6457691/76185995-41247e00-6214-11ea-92c2-0fbcc07869f4.png)\n\n\n### Result\n![I](https://user-images.githubusercontent.com/6457691/76186983-68c91580-6217-11ea-93bd-6f946b4920e4.gif)\n\n \n### Codes (prepared in Shiny App)\n \n ```R\n # Define UI for dataset viewer app ----\nui \u003c- fluidPage(\n\n # App title ----\n titlePanel(\"Shiny Text\"),\n\n # Sidebar layout with a input and output definitions ----\n sidebarLayout(\n\n   # Sidebar panel for inputs ----\n   sidebarPanel(\n\n     # Input: Selector for choosing dataset ----\n     selectInput(\n       inputId = \"dataset\",\n       label = \"Choose a dataset:\",\n       choices = c(\"rock\", \"pressure\", \"cars\")\n     ),\n\n     # Input: Numeric entry for number of obs to view ----\n     numericInput(\n       inputId = \"obs\",\n       label = \"Number of observations to view:\",\n       value = 10\n     )\n   ),\n\n   # Main panel for displaying outputs ----\n   mainPanel(\n\n     # Output: Verbatim text for data summary ----\n     verbatimTextOutput(\"summary\"),\n\n     # Output: HTML table with requested number of observations ----\n     tableOutput(\"view\")\n   )\n )\n)\n\n# Define server logic to summarize and view selected dataset ----\nserver \u003c- function(input, output) {\n\n # Return the requested dataset ----\n datasetInput \u003c- reactive({\n   switch(input$dataset,\n     \"rock\" = rock,\n     \"pressure\" = pressure,\n     \"cars\" = cars\n   )\n })\n\n # Generate a summary of the dataset ----\n output$summary \u003c- renderPrint({\n   dataset \u003c- datasetInput()\n   summary(dataset)\n })\n\n # Show the first \"n\" observations ----\n output$view \u003c- renderTable({\n   head(datasetInput(), n = input$obs)\n })\n}\n ```\n\n------\n\n\n\u003cdetails\u003e\n \u003csummary\u003e \n \n ### [Example 2 Miles per Gallon](https://shiny.rstudio.com/articles/build.html) \n \n \u003c/summary\u003e\n \n ### Codes\n \n ``` R\n # Define UI for miles per gallon app ----\nui \u003c- fluidPage(\n\n  # App title ----\n  titlePanel(\"Miles Per Gallon\"),\n\n  # Sidebar layout with input and output definitions ----\n  sidebarLayout(\n\n    # Sidebar panel for inputs ----\n    sidebarPanel(\n\n      # Input: Selector for variable to plot against mpg ----\n      selectInput(\n        \"variable\", \"Variable:\",\n        c(\n          \"Cylinders\" = \"cyl\",\n          \"Transmission\" = \"am\",\n          \"Gears\" = \"gear\"\n        )\n      ),\n\n      # Input: Checkbox for whether outliers should be included ----\n      checkboxInput(\"outliers\", \"Show outliers\", TRUE)\n    ),\n\n    # Main panel for displaying outputs ----\n    mainPanel(\n\n      # Output: Formatted text for caption ----\n      h3(textOutput(\"caption\")),\n\n      # Output: Plot of the requested variable against mpg ----\n      plotOutput(\"mpgPlot\")\n    )\n  )\n)\n\n# Data pre-processing ----\n# Tweak the \"am\" variable to have nicer factor labels -- since this\n# doesn't rely on any user inputs, we can do this once at startup\n# and then use the value throughout the lifetime of the app\nmpgData \u003c- mtcars\nmpgData$am \u003c- factor(mpgData$am, labels = c(\"Automatic\", \"Manual\"))\n\n# Define server logic to plot various variables against mpg ----\nserver \u003c- function(input, output) {\n\n  # Compute the formula text ----\n  # This is in a reactive expression since it is shared by the\n  # output$caption and output$mpgPlot functions\n  formulaText \u003c- reactive({\n    paste(\"mpg ~\", input$variable)\n  })\n\n  # Return the formula text for printing as a caption ----\n  output$caption \u003c- renderText({\n    formulaText()\n  })\n\n  # Generate a plot of the requested variable against mpg ----\n  # and only exclude outliers if requested\n  output$mpgPlot \u003c- renderPlot({\n    boxplot(as.formula(formulaText()),\n      data = mpgData,\n      outline = input$outliers,\n      col = \"#75AADB\", pch = 19\n    )\n  })\n}\n\n ```\n \n ### Result\n \n ![image](https://user-images.githubusercontent.com/6457691/76186147-bc862f80-6214-11ea-9b9b-b8a25e22ea24.png)\n \n \u003c/details\u003e\n \n  \n### :paperclip: Dependency\n\n* [shiny](https://github.com/rstudio/shiny) - 1.4.0\n* [shinyCyJS](https://github.com/jhk0530/shinyCyJS) - 0.0.11\n* [shinymaterial](https://github.com/ericrayanderson/shinymaterial) - 1.0.1\n* [colourpicker](https://github.com/daattali/colourpicker) - 1.0\n\n* [shinyjs](https://github.com/daattali/shinyjs) - 1.1\n\n### :exclamation:\tImpotant\n\n- If you load both `colourpicker` and `shinyjs` library, they will make collision. `shinyAssemble` only needs to load `colourpicker` and use ```R  shinyjs::runjs() ``` instead load `shinyjs`\n\n- use `styled code`, (more specifically I used tidyverse style with `styler`)\n\n\n### :blush: Authors\n\n* :octocat: jhk0530 [@jhk0530](https://github.com/jhk0530)\n\n### :cloud: ShinyApps\n\nhttps://jhkim.shinyapps.io/shinyAssemble/\n\n### :memo: License\nCopyright :copyright: 2020 Jinhwan Kim\n\nThis project is [MIT](https://opensource.org/licenses/MIT) licensed\n\n*This README was generated with :two_hearts: by [shinyReadme](http://github.com/jhk0530/shinyReadme)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhk0530%2Fshinyassemble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhk0530%2Fshinyassemble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhk0530%2Fshinyassemble/lists"}