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

Commit afba94b

Browse files
authored
Cleanup README.md wip
1 parent 088e95c commit afba94b

File tree

1 file changed

+38
-49
lines changed

1 file changed

+38
-49
lines changed

README.md

Lines changed: 38 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,47 @@
11
# React dat.GUI
22

3-
[![](https://img.shields.io/npm/v/react-dat-gui.svg)](https://www.npmjs.com/package/react-dat-gui)
3+
![npm](https://img.shields.io/npm/v/react-dat-gui?style=flat-square)
4+
![Travis (.org)](https://img.shields.io/travis/claus/react-dat-gui?style=flat-square)
5+
![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-dat-gui?style=flat-square)
6+
![GitHub](https://img.shields.io/github/license/claus/react-dat-gui?style=flat-square)
47

5-
This is a fully[\*](#whats-missing) featured React port of Google's esteemed [dat.GUI](https://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage) controller library. It comes packed with all the core components you'll need to cleanly integrate dat.GUIs into your React app.
8+
react-dat-gui is a fully[\*](#whats-missing) featured React port of Google's esteemed [dat.GUI](https://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage) controller library. It comes packed with all of the core components you will need to cleanly integrate dat.GUIs into your React app.
69

7-
For those that haven't used or seen dat.GUI before, it's basically a GUI for updating and interacting with objects in real time. It's used extensively in canvas or WebGL rendering demos/apps for libraries such as [three.js](http://threejs.org) but it can also be used to build browser based editing software.
10+
<p align="middle">
11+
<a href="https://claus.github.io/react-dat-gui/">
12+
<img width="300px" src="https://i.imgur.com/1bJt59V.png" />
13+
</a>
14+
<br />
15+
<a href="https://claus.github.io/react-dat-gui/">Demo</a>
16+
&nbsp;&nbsp;&nbsp;
17+
<a href="https://codesandbox.io/s/react-dat-gui-emjcf?fontsize=14&module=%2Fsrc%2Fcomponents%2FReactDatGui.js">Codesandbox</a>
18+
</p>
819

9-
## TOC
20+
The dat.GUI library is designed for easily updating and interacting with objects in real time. It is used extensively in canvas and WebGL rendering demos/apps for libraries such as [three.js](http://threejs.org) and is also commonly used in browser based editing software.
1021

11-
- [Demo](#demo)
12-
- [Installation](#installation)
13-
- [React Version](#react-version)
14-
- [Usage](#usage)
22+
## Contents
23+
24+
- [Basic Usage](#installation)
1525
- [Docs](#docs)
16-
- [`DatGui`](#datgui)
17-
- [props](#props)
18-
- [Components](#components)
19-
- [Common props](#common-props)
20-
- [`DatBoolean`](#datboolean)
21-
- [`DatButton`](#datbutton)
22-
- [`DatColor`](#datcolor)
23-
- [`DatFolder`](#datfolder)
24-
- [`DatNumber`](#datnumber)
25-
- [`DatPresets`](#datpresets)
26-
- [`DatSelect`](#datselect)
27-
- [`DatString`](#datstring)
28-
- [Scripts](#scripts)
29-
- [`build`](#build)
30-
- [`dev`](#dev)
31-
- [`dev:migrate`](#devmigrate)
32-
- [`dev:promote`](#devpromote)
33-
- [`example`](#example)
34-
- [`example:deploy`](#exampledeploy)
35-
- [`test`](#test)
36-
- [`test:watch`](#testwatch)
37-
- [`lint`](#lint)
38-
- [`lint:fix`](#lintfix)
39-
- [`toc`](#toc)
26+
- [Local Development](#local-development)
4027
- [What's missing](#whats-missing)
4128
- [Roadmap](#roadmap)
42-
- [License](#license)
43-
44-
## Demo
45-
46-
[Checkout the demo!](https://claus.github.io/react-dat-gui/)
47-
48-
The demo is a deployed version of the latest production build of `./example`. There's also a `dev` directory where you can prototype changes to the source code easily. Both of these have been bootstrapped with `create-react-app`.
4929

5030
## Installation
5131

5232
```
5333
npm install react-dat-gui --save
5434
```
5535

56-
### React Version
36+
## Basic Usage
5737

58-
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.
59-
60-
## Usage
61-
62-
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:
38+
react-dat-gui has a wrapper component `<DatGUI />` and several control components that can be used to add functionality to the controller.
6339

6440
```jsx
65-
import React, { Component } from 'react';
41+
import React from 'react';
6642
import DatGui, { DatBoolean, DatColor, DatNumber, DatString } from 'react-dat-gui';
6743

68-
class App extends Component {
44+
class App extends React.Component {
6945
state = {
7046
data: {
7147
package: 'react-dat-gui',
@@ -91,8 +67,6 @@ class App extends Component {
9167
}
9268
```
9369
94-
This will give you a dat.GUI controller which can perform live mutations to the `data` in the `App` component's state.
95-
9670
## Docs
9771
9872
### `DatGui`
@@ -247,6 +221,21 @@ yarn start
247221
248222
Changes to the library code should hot reload in the demo app
249223
224+
## Scripts
225+
226+
| Script | Description |
227+
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
228+
| `build` | Builds the library for production into `/dist` |
229+
| `start` | Starts the library in development mode with hot module reloading |
230+
| `test` | Runs unit testing suite powered by [Jest](https://github.com/facebook/jest) and [testing-library](https://github.com/testing-library/react-testing-library) |
231+
| `lint` | Runs linting over entire codebase with `prettier`, `eslint` and `stylelint` |
232+
| `lint-js` | Lints only javascript files |
233+
| `lint-styles` | Lints only stylesheet files |
234+
| `fix` | Runs linting over entire codebase with `prettier`, `eslint` and `stylelint` and applies any available automatic fixes |
235+
| `fix-js` | Lints only javascript files and applies any available automatic fixes |
236+
| `fix-styles` | Lints only stylesheet files and applies any available automatic fixes |
237+
238+
250239
## What's missing
251240
252241
There are still a few features from the original implementation missing from this package. These are mainly related to saving and loading data as well as local storage. Animations for folder expanding/collapsing is also not currently implemented, but shouldn't be too hard to do.

0 commit comments

Comments
 (0)