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
Showing
9 changed files
with
368 additions
and
305 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
entry: './src/index.tsx', | ||
esm: 'babel', | ||
cjs: 'babel', | ||
}; |
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,39 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import GraphScopeComponent from '@antv/graphin-graphscope'; | ||
import { Utils } from '@antv/graphin'; | ||
|
||
const originData = Utils.mock(5) | ||
.circle() | ||
.graphin(); | ||
|
||
originData.nodes[0].style = { | ||
keyshape: { | ||
size: [20, 20], | ||
}, | ||
}; | ||
|
||
export default () => { | ||
const [data, setData] = useState(originData); | ||
const domRef = React.useRef(null); | ||
|
||
const queryNeighbors = (nodeId: string, degree: number) => { | ||
debugger; | ||
const model = data.nodes.filter(node => node.id === nodeId); | ||
const newData = Utils.mock(3) | ||
.expand(model) | ||
.graphin(); | ||
|
||
setData({ | ||
nodes: [...data.nodes, ...newData.nodes], | ||
edges: [...data.edges, ...newData.edges], | ||
} as any); | ||
}; | ||
|
||
console.log('------原始shuju', data); | ||
return ( | ||
<div> | ||
<div ref={domRef}></div> | ||
<GraphScopeComponent graphDOM={domRef.current} data={data} width={1000} height={400} neighbors={queryNeighbors} /> | ||
</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,19 @@ | ||
--- | ||
title: GraphScope 演示 | ||
group: | ||
path: /demo | ||
nav: | ||
title: GraphScope | ||
path: /graphscope | ||
order: 1 | ||
--- | ||
|
||
## 基本介绍 | ||
|
||
内置的 Graphin 节点 | ||
|
||
## Typescript | ||
|
||
### Graphin Circle | ||
|
||
<code src='./demo/index.tsx'> |
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.