Skip to content

Commit c13b249

Browse files
committed
Update for yFiles for HTML 2.4.0.0
1 parent ea2a2d4 commit c13b249

File tree

6 files changed

+25
-26
lines changed

6 files changed

+25
-26
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This sample application serves as a basic scaffold of how to integrate [yFiles f
88

99
## Version Information
1010

11-
- create-react-app v3.3.0
12-
- yFiles for HTML 2.3
11+
- create-react-app v4.0.3
12+
- yFiles for HTML 2.4
1313

1414
## Getting Started
1515

integration-howto.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Adding yFiles as a dependency is as easy as installing an external library from
2424
```
2525
"dependencies": {
2626
...
27-
"yfiles": "../yFiles-for-HTML-Complete-2.3.0.3-Evaluation/lib-dev/es-modules/yfiles-23.0.2-eval-dev.tgz"
27+
"yfiles": "../yFiles-for-HTML-Complete-2.4.0.0-Evaluation/lib-dev/es-modules/yfiles-24.0.0-eval-dev.tgz"
2828
},
2929
```
3030
@@ -45,7 +45,6 @@ With the yFiles dependency, you can easily create a new React component that con
4545
There are two things to look out for:
4646
4747
- Make sure to configure your `license.json` for the library.
48-
- Make sure to include `yfiles.css`, which is an integral part of the library. For example add `import 'yfiles/yfiles.css'` as in `ReactGraphComponent.js`.
4948
5049
2. Afterwards, just add the new React component to the `App.js`.
5150

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
"author": "yWorks GmbH <[email protected]>",
55
"private": true,
66
"dependencies": {
7-
"@testing-library/jest-dom": "^5.11.6",
8-
"@testing-library/react": "^11.2.2",
9-
"@testing-library/user-event": "^12.6.0",
10-
"react": "^17.0.1",
11-
"react-dom": "^17.0.1",
12-
"react-scripts": "4.0.1",
13-
"yfiles": "../yFiles-for-HTML-Complete-2.3.0.4-Evaluation/lib-dev/es-modules/yfiles-23.0.4-eval-dev.tgz"
7+
"@testing-library/jest-dom": "^5.14.1",
8+
"@testing-library/react": "^12.0.0",
9+
"@testing-library/user-event": "^13.1.9",
10+
"react": "^17.0.2",
11+
"react-dom": "^17.0.2",
12+
"react-scripts": "4.0.3",
13+
"web-vitals": "^2.0.1",
14+
"yfiles": "../yFiles-for-HTML-Complete-2.4.0.0-Evaluation/lib-dev/es-modules/yfiles-24.0.0-eval-dev.tgz"
1415
},
1516
"scripts": {
16-
"preinstall": "cd ../yFiles-for-HTML-Complete-2.3.0.4-Evaluation && npm run prepare-package",
17-
"postinstall": " node -e \"require('fs').copyFileSync('../yFiles-for-HTML-Complete-2.3.0.4-Evaluation/lib/license.json','./src/license.json')\"",
17+
"preinstall": "cd ../yFiles-for-HTML-Complete-2.4.0.0-Evaluation && npm run prepare-package",
18+
"postinstall": " node -e \"require('fs').copyFileSync('../yFiles-for-HTML-Complete-2.4.0.0-Evaluation/lib/license.json','./src/license.json')\"",
1819
"start": "react-scripts --expose-gc --max-old-space-size=8192 start",
1920
"build": "react-scripts --expose-gc --max-old-space-size=8192 build",
2021
"eject": "react-scripts eject"

src/App.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
2-
import logo from './yfiles-logo.svg';
3-
import './App.css';
2+
import logo from './yfiles-logo.svg'
3+
import './App.css'
44
import ReactGraphComponent from './ReactGraphComponent.js'
55

66
function App() {
@@ -10,9 +10,9 @@ function App() {
1010
<img src={logo} className="App-logo" alt="logo" />
1111
<h1>A Basic yFiles Integration in React</h1>
1212
</header>
13-
<ReactGraphComponent/>
13+
<ReactGraphComponent />
1414
</div>
15-
);
15+
)
1616
}
1717

18-
export default App;
18+
export default App

src/ReactGraphComponent.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import 'yfiles/yfiles.css'
21
import React, { Component } from 'react'
3-
import {GraphComponent, GraphEditorInputMode, License, Point, Rect} from 'yfiles'
2+
import { GraphComponent, GraphEditorInputMode, License, Point, Rect } from 'yfiles'
43
import licenseData from './license'
54

65
License.value = licenseData
@@ -50,7 +49,7 @@ export default class ReactGraphComponent extends Component {
5049
return (
5150
<div
5251
className="graph-component-container"
53-
ref={node => {
52+
ref={(node) => {
5453
this.div = node
5554
}}
5655
/>

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import './index.css'
4+
import App from './App'
55

6-
ReactDOM.render(<App />, document.getElementById('root'));
6+
ReactDOM.render(<App />, document.getElementById('root'))

0 commit comments

Comments
 (0)