-
Notifications
You must be signed in to change notification settings - Fork 263
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
c6f0561
commit 8206356
Showing
3 changed files
with
102 additions
and
2 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
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,48 @@ | ||
import React from 'react'; | ||
import Graphin, { Utils, Behaviors } from '@antv/graphin'; | ||
import iconLoader from '@antv/graphin-icons'; | ||
import { Row, Col } from 'antd'; | ||
|
||
const { ZoomCanvas } = Behaviors; | ||
const data = Utils.mock(4) | ||
.circle() | ||
.graphin(); | ||
const layout = { | ||
type: 'concentric', | ||
}; | ||
|
||
const icons = Graphin.registerFontFamily(iconLoader); | ||
|
||
data.nodes.forEach(node => { | ||
node.style = { | ||
...node.style, | ||
icon: { | ||
type: 'font', | ||
fontFamily: 'graphin', | ||
value: icons.user, | ||
}, | ||
}; | ||
}); | ||
|
||
data.nodes[0].status = { | ||
selected: true, | ||
}; | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<Row> | ||
<Col span={12}> | ||
<Graphin data={data} layout={layout} theme={{ mode: 'light' }}> | ||
<ZoomCanvas disabled /> | ||
</Graphin> | ||
</Col> | ||
<Col span={12}> | ||
<Graphin data={data} layout={layout} theme={{ mode: 'dark' }}> | ||
<ZoomCanvas disabled /> | ||
</Graphin> | ||
</Col> | ||
</Row> | ||
</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,48 @@ | ||
import React from 'react'; | ||
import Graphin, { Utils, Behaviors } from '@antv/graphin'; | ||
import iconLoader from '@antv/graphin-icons'; | ||
import { Row, Col } from 'antd'; | ||
|
||
const { ZoomCanvas } = Behaviors; | ||
const data = Utils.mock(4) | ||
.circle() | ||
.graphin(); | ||
const layout = { | ||
type: 'concentric', | ||
}; | ||
|
||
const icons = Graphin.registerFontFamily(iconLoader); | ||
|
||
data.nodes.forEach(node => { | ||
node.style = { | ||
...node.style, | ||
icon: { | ||
type: 'font', | ||
fontFamily: 'graphin', | ||
value: icons.user, | ||
}, | ||
}; | ||
}); | ||
|
||
data.nodes[0].status = { | ||
selected: true, | ||
}; | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<Row> | ||
<Col span={12}> | ||
<Graphin data={data} layout={layout} theme={{ mode: 'light', primaryColor: '#D77622' }}> | ||
<ZoomCanvas disabled /> | ||
</Graphin> | ||
</Col> | ||
<Col span={12}> | ||
<Graphin data={data} layout={layout} theme={{ mode: 'dark' }}> | ||
<ZoomCanvas disabled /> | ||
</Graphin> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
}; |