Skip to content

Commit 19d857b

Browse files
committed
Add some sample usage notes
1 parent 7154195 commit 19d857b

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
This project provides a basic example of using GoJS in a React app.
66
Check out the [Intro page on using GoJS with React](https://gojs.net/alpha/intro/react.html) for more information.
77

8+
When running the sample, try moving around nodes, editing text, relinking, undoing (Ctrl-Z), etc. within the diagram
9+
and you'll notice the changes are reflected in the inspector area. You'll also notice that changes
10+
made in the inspector are reflected in the diagram. If you use the React dev tools,
11+
you can inspect the React state and see it updated as changes happen.
12+
813
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
914
It also uses immer to simplify state update operations.
1015

src/App.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ label {
33
color: #212121; /* Grey 900 */
44
display: block;
55
padding: 2px;
6+
}
7+
8+
p {
9+
font: 300 1rem Roboto, helvetica, sans-serif;
10+
color: #212121; /* Grey 900 */
611
}

src/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,15 @@ class App extends React.Component<{}, AppState> {
265265

266266
return (
267267
<div>
268+
<p>
269+
Try moving around nodes, editing text, relinking, undoing (Ctrl-Z), etc. within the diagram
270+
and you'll notice the changes are reflected in the inspector area. You'll also notice that changes
271+
made in the inspector are reflected in the diagram. If you use the React dev tools,
272+
you can inspect the React state and see it updated as changes happen.
273+
</p>
274+
<p>
275+
Check out the <a href='https://gojs.net/alpha/intro/react.html' target='_blank' rel='noopener noreferrer'>Intro page on using GoJS with React</a> for more information.
276+
</p>
268277
<Diagram
269278
nodeDataArray={this.state.nodeDataArray}
270279
linkDataArray={this.state.linkDataArray}

0 commit comments

Comments
 (0)