Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit cb03d35

Browse files
Added section on React version, DatFolder animations and license to readme
1 parent bce95dd commit cb03d35

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ For those that haven't used or seen dat.GUI before, it's basically a GUI for upd
88

99
- [Demo](#demo)
1010
- [Installation](#installation)
11+
* [React Version](#react-version)
1112
- [Usage](#usage)
1213
- [Docs](#docs)
1314
* [`DatGui`](#datgui)
@@ -36,6 +37,7 @@ For those that haven't used or seen dat.GUI before, it's basically a GUI for upd
3637
+ [`toc`](#toc)
3738
- [What's missing](#whats-missing)
3839
- [Roadmap](#roadmap)
40+
- [License](#license)
3941

4042
## Demo
4143

@@ -49,6 +51,10 @@ The demo is a deployed version of the latest production build of `./example`. Th
4951
npm install react-dat-gui --save
5052
```
5153

54+
### React Version
55+
56+
React dat.GUI uses React and React-DOM `^16.0.0` aka React Fiber. It's recommended that you update your app's React version to align with this in order to avoid any issues.
57+
5258
## Usage
5359

5460
First you'll need a wrapper component which will handle the updates from your dat.GUI, this component should pass the data for the GUI to control as well as an `onUpdate` function to the `DatGui` container component as props. Here's how you might do that:
@@ -69,13 +75,13 @@ class App extends Component {
6975
}
7076
}
7177
72-
update = data => this.setState({ data })
78+
handleUpdate = data => this.setState({ data })
7379
7480
render() {
7581
const { data } = this.state;
7682
7783
return (
78-
<DatGui data={data} onUpdate={this.update}>
84+
<DatGui data={data} onUpdate={this.handleUpdate}>
7985
<DatString path='package' label='Package' />
8086
<DatNumber path='power' label='Power' min={9000} max={9999} step={1} />
8187
<DatBoolean path='isAwesome' label='Awesome?' />
@@ -97,16 +103,16 @@ This is the main container component for your GUI and is the default export from
97103

98104
##### required
99105

100-
* `data` - The data your dat.GUI controller will mutate
101-
* `onUpdate` - The method which will be called whenever an update is handled by the controller
102-
* `children` - The dat.GUI components that make up the controller
106+
* `data: object` - The data your dat.GUI controller will mutate
107+
* `onUpdate: func` - The method which will be called whenever an update is handled by the controller
108+
* `children: array` - The dat.GUI components that make up the controller
103109

104110
##### optional
105111

106-
* `liveUpdate` - Determines if live updates should occur, defaults to `true`
107-
* `labelWidth` - The width of the labels in pixels, defaults to `40`
108-
* `className` - The class name to set on the `DatGui` div
109-
* `style` - The style object to set on the `DatGui` div
112+
* `liveUpdate: bool` - Determines if live updates should occur, defaults to `true`
113+
* `labelWidth: number` - The width of the labels in pixels, defaults to `40`
114+
* `className: string` - The class name to set on the `DatGui` div
115+
* `style: object` - The style object to set on the `DatGui` div
110116

111117
### Components
112118

@@ -254,6 +260,12 @@ For the first, I think the fact that this is now an NPM module sort of goes agai
254260
Local storage however is in the roadmap and will probably be done very soon.
255261

256262
## Roadmap
263+
257264
* Loading and storing both default and preset data via `localStorage`
258-
* Time travel with undo/redo buttons (edited)
265+
* Animations for `DatFolder` expanding/collapsing
266+
* Time travel with undo/redo buttons
259267
* Better support for floating point `DatNumber`s (rounding etc.)
268+
269+
## License
270+
271+
[MIT](https://opensource.org/licenses/MIT)

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-dat-gui",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "dat.GUI reimagined for React",
55
"main": "build/react-dat-gui.js",
66
"style": "build/react-dat-gui.css",

0 commit comments

Comments
 (0)