{"id":13733119,"url":"https://github.com/INWTlab/shinyMatrix","last_synced_at":"2025-05-08T09:31:38.594Z","repository":{"id":34218505,"uuid":"161631653","full_name":"INWTlab/shinyMatrix","owner":"INWTlab","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-29T13:13:06.000Z","size":6778,"stargazers_count":20,"open_issues_count":3,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-04T09:46:10.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://inwtlab.github.io/shinyMatrix/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/INWTlab.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":"2018-12-13T11:49:50.000Z","updated_at":"2025-02-16T21:07:06.000Z","dependencies_parsed_at":"2024-04-10T13:39:07.583Z","dependency_job_id":"0c92eb6f-dd8d-47bc-a2eb-d27a8c738fa1","html_url":"https://github.com/INWTlab/shinyMatrix","commit_stats":null,"previous_names":["inwtlab/shinymatrix","inwtlab/shiny-matrix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INWTlab%2FshinyMatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INWTlab%2FshinyMatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INWTlab%2FshinyMatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INWTlab%2FshinyMatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/INWTlab","download_url":"https://codeload.github.com/INWTlab/shinyMatrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253036479,"owners_count":21844221,"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":[],"created_at":"2024-08-03T03:00:37.872Z","updated_at":"2025-05-08T09:31:38.167Z","avatar_url":"https://github.com/INWTlab.png","language":"JavaScript","readme":"# Matrix Input for Shiny\n\n[![R-CMD-check](https://github.com/INWTlab/shiny-matrix/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/INWTlab/shiny-matrix/actions/workflows/R-CMD-check.yaml)\n[![Coverage Status](https://img.shields.io/codecov/c/github/INWTlab/shiny-matrix/master.svg)](https://app.codecov.io/github/INWTlab/shiny-matrix?branch=master)\n[![CRAN status](https://www.r-pkg.org/badges/version/shinyMatrix)](https://cran.r-project.org/package=shinyMatrix)\n\n# Matrix Input for Shiny\n\nThis package provides an input field to enter matrix conveniently in a shiny application. It supports tabbing and jumping linewise in the matrix.\n\n![Screenshot Simple Matrix](https://github.com/INWTlab/shiny-matrix/raw/master/screenshot1.png)\n\n## Installation\nFrom CRAN:\n```r\ninstall.packages(\"shinyMatrix\")\n```\nFrom GitHub:\n\n```r\nif (require(\"devtools\")) install_github(\"INWTlab/shiny-matrix\")\n```\n\n## Usage\n\n### UI\n\nThe input field is generated by the function `matrixInput`\n\n```r\nmatrixInput \u003c- function(inputId,\n                        value = matrix(\"\", 1, 1),\n                        inputClass = \"\",\n                        rows = list(),\n                        cols = list(),\n                        class = \"character\"\n                        pagination = FALSE,\n                        lazy = FALSE){\n  [...]\n}\n```\nYou can define parameters as follows:\n\n| Parameter | Description |\n|-|-|\n| `inputId` | `id` of html element |\n| `value` | matrix |\n| `inputClass` | `class` of html element (Class `matrix-input` is added automatically) |\n| `rows` | `list` of parameters (see below) |\n| `cols` | `list` of parameters (see below) |\n| `class` | class of resulting matrix (`numeric` and `character`) is supported |\n| `pagination` | Should the matrix be paginated (10 rows per page) |\n| `lazy` | Lazy update data on server |\n\nParameter `rows` / `cols` take a list of arguments. The following is supported\n\n| Parameter | Description |\n|-|-|\n|`n`| number of rows (is calculated from `value` per default) |\n|`names`| show row/colnames (names are taken from `value`)|\n|`editableNames`| should row/colnames be editable? |\n| `extend`| should rows/cols be automatically be added if table is filled to the last row / column? |\n| `delta` | how many blank rows/cols should be added \n| `multiheader` | Display multiheader - currently only header spanning two columns are supported\n\nCall the matrixInput function in your UI generating, e.g. ui.R\n\n```r\n## numeric matrix\nmatrixInput(\"matrix1\", class = \"numeric\")\n\n## editable rownames\nmatrixInput(\"matrix2\",\n  rows = list(\n    names = TRUE,\n    editableNames = TRUE),\n  data = matrix(letters[1:12], 3, 4)\n)\n```\n### Get value\n\nYou can access the value from the matrix input using `input$inputId` in your server function. The result will always be a matrix of the class defined in `matrixInput`.\n\n\n### Update Input Field\n\nYou can update the input field using `updateMatrixInput`\n\n```r\nupdateMatrixInput(session, inputId, value = NULL)\n```\n\n`value` is the data object. In the future there should be also support to update the other parameters.\n\n## Example Apps\n\nYou find the code for the example app in `inst/appXXX`.\n\n### Basic functionality\n\n- Fixed matrix width\n- Editable matrix content\n- No column and rownames\n\nUse the matrix on the left to input values, matrix on the right displays the result.\n\n```r\nlibrary(shinyMatrix)\n\nstartApplication(\"app\")\n```\n\n### Update Matrix Input from R\n\n- Generate a random matrix within the shiny server function by clicking on \"Update Matrix\"\n- The matrixInput field gets updated with `updateMatrixInput` from R\n\n```r\nstartApplication(\"appUpdate\")\n```\n\n### Editable row and column names\n\n- Edit row and column names by clicking on the cell\n- The result will be shown on the right\n\n```r\nstartApplication(\"appRownames\")\n```\n\n### Uneditable cells\n\n- Make table cells uneditable\n- No clicking into cells, no changing values\n\n```r\nstartApplication(\"appUneditableCells\")\n```\n\n### Extend Matrix Automatically\n\n- If matrix is full (last row and columns contain values) rows and columns are added automatically \n\n\n```r\nstartApplication(\"appExtend\")\n```\n\n### Custom Column Header\n\n- Replace default header with a multiheader\n- Automatically add 2 columns if matrix is full\n\n```r\nstartApplication(\"appDoubleHeader\")\n```\n\n### Delete Rows and Columns\n\n- add a button to delete rows and columns. This also works for multiheader.\n\n```r\nstartApplication(\"appDelete\")\n```\n\n### Lazy Update of server values\n\n- Only update data on server when no input field is visible\n\n```r\nstartApplication(\"appLazy\")\n```\n\n","funding_links":[],"categories":["JavaScript","UI Components"],"sub_categories":["Special Input"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FINWTlab%2FshinyMatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FINWTlab%2FshinyMatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FINWTlab%2FshinyMatrix/lists"}