{"id":42396828,"url":"https://github.com/smwindecker/mixchar-gui","last_synced_at":"2026-01-28T01:01:38.873Z","repository":{"id":330076226,"uuid":"1102835977","full_name":"smwindecker/mixchar-gui","owner":"smwindecker","description":"Graphical User Interface for mixchar R package","archived":false,"fork":false,"pushed_at":"2025-12-23T08:16:32.000Z","size":95456,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T19:24:04.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.smwindecker.com/mixchar-gui/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smwindecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-24T05:25:13.000Z","updated_at":"2025-12-23T08:38:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/smwindecker/mixchar-gui","commit_stats":null,"previous_names":["smwindecker/mixchar-gui"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/smwindecker/mixchar-gui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smwindecker%2Fmixchar-gui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smwindecker%2Fmixchar-gui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smwindecker%2Fmixchar-gui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smwindecker%2Fmixchar-gui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smwindecker","download_url":"https://codeload.github.com/smwindecker/mixchar-gui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smwindecker%2Fmixchar-gui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-28T01:01:11.776Z","updated_at":"2026-01-28T01:01:38.863Z","avatar_url":"https://github.com/smwindecker.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mixchar-gui\n\nShiny GUI for the `mixchar` package (thermogravimetric deconvolution).\n\n## Overview\n\nThis Shiny application provides an interactive workbench for analyzing thermogravimetric data through the mixchar package. It guides users through a five-step workflow: data loading, processing, deconvolution, visualization, and carbon fraction calculation.\n\n## Requirements\n- R (\u003e= 4.0)\n- `mixchar` package — **fixed_carbon branch** (latest carbon-fraction work)  \n  ```r\n  install.packages(\"remotes\")  # if remotes is not installed\n  remotes::install_github(\"smwindecker/mixchar\", ref = \"fixed_carbon\")\n  # or install from your local fixed_carbon checkout:\n  # remotes::install_local(\"/path/to/mixchar\")\n  ```\n- Shiny runtime (`shiny`, `DT`) and `plotly` for the Sankey diagram:  \n  ```r\n  install.packages(c(\"shiny\", \"DT\", \"plotly\"))\n  ```\n\n### Quick install \u0026 run (copy-paste)\n```r\ninstall.packages(c(\"shiny\",\"DT\",\"bslib\",\"plotly\",\"remotes\"), repos = \"https://cloud.r-project.org\")\nremotes::install_github(\"smwindecker/mixchar\", ref = \"fixed_carbon\", upgrade = \"never\")\nshiny::runApp(\".\")\n```\n\n## Getting the GUI\n- Download/clone the GUI repo: \u003chttps://github.com/smwindecker/mixchar-gui\u003e\n- (Already here) place the example data `beech_example.csv` in the repo root; keep `ui.R` and `server.R` together.\n\n## Run\nIn the repo root:\n```r\nshiny::runApp(\".\")\n```\n\n## Notes\n- Make sure the `mixchar` fixed-carbon branch is installed before running the GUI.\n- You can upload your own CSV in the app and set skip rows/column mapping; or use the bundled `beech_example.csv`.\n\n---\n\n## Architecture \u0026 Code Structure\n\n### File Organization\n\n- **`ui.R`**: User interface definition\n  - Sidebar layout with workflow step navigation\n  - Conditional panels for step-specific inputs\n  - Dynamic content area (rendered server-side)\n\n- **`server.R`**: Server-side logic and data processing\n  - Reactive state management (`rv` reactiveValues)\n  - Data processing, deconvolution, and fraction calculations\n  - Output rendering and download handlers\n\n- **`sankey.R`**: Sankey diagram visualization\n  - Carbon fraction flow visualization\n  - Plotly-based interactive diagrams\n\n### Application State Management\n\nThe app uses Shiny's `reactiveValues` (`rv`) to manage state:\n\n- `rv$raw`: Raw uploaded/example data\n- `rv$processed`: Processed data from `mixchar::process()`\n- `rv$decon`: Deconvolution results from `mixchar::deconvolve()`\n- `rv$source`: Data source identifier (\"upload\", \"example\", or \"none\")\n- `rv$file_reset`: Counter for file input reset\n- `rv$example_path`: Path to example data file\n\n### Workflow Steps\n\n1. **Load data** (`input$step == \"read\"`)\n   - Upload CSV or use example data\n   - Configure skip rows for metadata\n\n2. **Process data** (`input$step == \"process\"`)\n   - Map columns (temperature, mass loss, time, stage)\n   - Set processing parameters (initial mass, pyrolysis window)\n   - View stage summary and plots\n\n3. **Deconvolution** (`input$step == \"decon\"`)\n   - Configure peak count (auto, 3, or 4)\n   - Set random seed for reproducibility\n   - View weights table\n\n4. **Visualization** (`input$step == \"viz\"`)\n   - Configure plot appearance (bw, quantile bands)\n   - View deconvolution plots\n\n5. **Carbon fractions** (`input$step == \"fractions\"`)\n   - Adjust fixed carbon percentages\n   - View table or Sankey diagram\n   - Export reproducible R script\n\n---\n\n## Development Guide\n\n### Adding a New Workflow Step\n\n1. **Update `ui.R`**:\n   - Add step to `radioButtons` choices in sidebar\n   - Create new `conditionalPanel` for step-specific inputs\n   - Use `conditionalPanel(\"input.step == '\u003cstep_name\u003e'\")` syntax\n\n2. **Update `server.R`**:\n   - Add new case to `output$step_body` switch statement\n   - Create any required observers (`observeEvent`) or outputs\n   - Update `rv` reactiveValues if new state is needed\n\n3. **Example**:\n   ```r\n   # In ui.R sidebarPanel:\n   conditionalPanel(\n     \"input.step == 'newstep'\",\n     numericInput(\"new_param\", \"New Parameter\", value = 0)\n   )\n   \n   # In server.R output$step_body:\n   newstep = tagList(\n     h3(\"New Step\"),\n     plotOutput(\"new_plot\")\n   )\n   ```\n\n### Modifying Data Processing\n\n- Processing logic is in `observeEvent(input$do_process, ...)`\n- Validation occurs before processing\n- Errors are caught and displayed via `showNotification()`\n- Processing results are stored in `rv$processed`\n\n### Adding New Visualizations\n\n1. Create output renderer (e.g., `output$new_plot \u003c- renderPlot({...})`)\n2. Add download handler if needed (e.g., `output$dl_new_plot \u003c- downloadHandler({...})`)\n3. Include in appropriate step's UI (via `output$step_body`)\n\n### Modifying Sankey Diagram\n\n- Edit `sankey.R` functions:\n  - `build_sankey_labels()`: Change node label formatting\n  - `render_fractions_sankey()`: Modify layout, colors, or links\n- Node positions: Adjust `node_x` and `node_y` arrays\n- Colors: Modify `col_hemi`, `col_cell`, etc.\n- Links: Update `link_sources`, `link_targets`, `link_values` arrays\n\n### Code Style \u0026 Documentation\n\n- Functions are documented with purpose, parameters, and return values\n- Complex logic includes inline comments explaining \"why\"\n- File headers describe purpose, architecture, and modification notes\n- Use `req()` to ensure dependencies before rendering outputs\n- Use `validate(need(...))` for user input validation\n\n### Testing Changes\n\n1. Ensure `mixchar` fixed-carbon branch is installed\n2. Run `shiny::runApp(\".\")` from project root\n3. Test each workflow step with example data\n4. Verify error handling with invalid inputs\n5. Check download handlers produce correct files\n\n### Common Modifications\n\n**Change default values**:\n- Edit `example_defaults` list in `server.R`\n- Modify `value` parameters in `ui.R` inputs\n\n**Add new input field**:\n- Add to appropriate `conditionalPanel` in `ui.R`\n- Access via `input$\u003cid\u003e` in `server.R`\n- Update validation if required\n\n**Modify color scheme**:\n- Edit `app_theme` in `ui.R` for overall theme\n- Edit color variables in `sankey.R` for diagram colors\n- Modify CSS in `tags$style()` for custom styling\n\n---\n\n## Troubleshooting\n\n- **\"mixchar fixed-carbon branch required\"**: Install via `remotes::install_github('smwindecker/mixchar', ref = 'fixed-carbon')`\n- **Processing fails**: Check temperature units match data (C vs K), verify pyrolysis window is appropriate\n- **Deconvolution fails**: Ensure processing completed successfully, check data quality\n- **Sankey diagram missing**: Requires 3-peak deconvolution; run deconvolution with 3 peaks first\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmwindecker%2Fmixchar-gui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmwindecker%2Fmixchar-gui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmwindecker%2Fmixchar-gui/lists"}