{"id":20548795,"url":"https://github.com/zenika/hoc-react-datgui","last_synced_at":"2025-04-14T10:53:31.732Z","repository":{"id":57264753,"uuid":"87815802","full_name":"Zenika/hoc-react-datgui","owner":"Zenika","description":"HOC adding dat.GUI plugged to React.Component props.","archived":false,"fork":false,"pushed_at":"2017-04-18T09:26:44.000Z","size":139,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-11T15:09:38.705Z","etag":null,"topics":["datgui","graphic-user-interface","gui","hoc","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Zenika.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}},"created_at":"2017-04-10T13:45:35.000Z","updated_at":"2018-05-15T02:38:35.000Z","dependencies_parsed_at":"2022-08-25T02:52:16.191Z","dependency_job_id":null,"html_url":"https://github.com/Zenika/hoc-react-datgui","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenika%2Fhoc-react-datgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenika%2Fhoc-react-datgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenika%2Fhoc-react-datgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zenika%2Fhoc-react-datgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zenika","download_url":"https://codeload.github.com/Zenika/hoc-react-datgui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868773,"owners_count":21174757,"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":["datgui","graphic-user-interface","gui","hoc","react"],"created_at":"2024-11-16T02:14:50.228Z","updated_at":"2025-04-14T10:53:31.701Z","avatar_url":"https://github.com/Zenika.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## hoc-react-datgui\n\n\u003e HOC adding `dat.GUI` plugged to `React.Component` props.\n\n_*Library currently in development*_\n\n### What's dat.GUI ?\n\n`dat.GUI` is a lightweight graphical user interface for changing variables in JavaScript. Written by https://github.com/dataarts/\n\n### Getting started\n\n```\nnpm install hoc-react-datgui\n```\n\n#### withDatGui(Component, model)\n\nGenerate the `dat.GUI` following the given model object.\n\n```jsx\nimport { withDatGui } from 'hoc-react-datgui'\n\nconst CompWithDatGui = withDatGui(MyComponent, {\n  name: { type: 'string', defaultValue: 'noname' },\n  age: { type: 'number', min: 1, max: 99, step: 1 },\n  gender: { type: 'enum', values: ['Male', 'Female']}\n})\n\n\u003cCompWithDatGui name=\"Benjamin\" /\u003e\n```\n The model is an object descripting the `dat.GUI` component. All keys must match with the component props (name and type).\n\n property | description\n ---------|-----------\n| `type` | `string`, `number`, `enum`, `object`, `array`, `function`, `color` |\n| `defaultValue` | default value of the property. |\n| `max` | only for `number` |\n| `min` | only for `number` |\n| `step` | only for `number`. |\n| `values` | only for `enum`. Array of values for an enum property.|\n\n#### withDatGuiFromProps(Component)\n\nGenerate the `dat.GUI` according to the input props of the wrapped component. (be careful, it doesn't check component propTypes)\n\n```jsx\nimport { withDatGuiFromProps } from 'hoc-react-datgui'\n\nconst CompWithDatGui = withDatGuiFromProps(MyComponent)\n\n\u003cCompWithDatGui name=\"Benjamin\" /\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenika%2Fhoc-react-datgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenika%2Fhoc-react-datgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenika%2Fhoc-react-datgui/lists"}