-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1121262
commit 754ce48
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ package-lock.json | |
# yarn-lock | ||
yarn.lock | ||
|
||
dist | ||
|
||
# ignore dist files | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,49 @@ | ||
import React from 'react'; | ||
import styles from './index.css'; | ||
import ERGraph from '../../../dist/index'; | ||
|
||
const data = { | ||
nodes: [ | ||
{ | ||
id: 'node-0', | ||
x: 40, | ||
y: 40, | ||
width: 300, | ||
height: 200, | ||
render: () => { | ||
return <div>hello node-0</div>; | ||
}, | ||
}, | ||
{ | ||
id: 'node-1', | ||
x: 140, | ||
y: 40, | ||
width: 300, | ||
height: 200, | ||
render: () => { | ||
return ( | ||
<div | ||
onClick={() => { | ||
console.log('node-1'); | ||
}} | ||
> | ||
hello node-1 | ||
</div> | ||
); | ||
}, | ||
}, | ||
], | ||
edges: [ | ||
{ | ||
source: 'node-0', | ||
target: 'node-1', | ||
}, | ||
], | ||
}; | ||
export default function() { | ||
return ( | ||
<div className={styles.normal}> | ||
<div className={styles.welcome} /> | ||
<ul className={styles.list}> | ||
<li> | ||
To get started, edit <code>src/pages/index.js</code> and save to reload. | ||
</li> | ||
<li> | ||
<a href="https://umijs.org/guide/getting-started.html">Getting Started</a> | ||
</li> | ||
</ul> | ||
<ERGraph data={data} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
const Node = () => { | ||
return <div>hello Node</div> | ||
} | ||
|
||
export default Node |
Empty file.