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
pomelo.lcw
committed
Feb 27, 2020
1 parent
e892bf8
commit 777391b
Showing
6 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/graphin-site/examples/components/toolbar/demo/Simple.jsx
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,30 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { Card } from 'antd'; | ||
import Graphin, { Utils } from '@antv/graphin'; | ||
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS | ||
import { Toolbar, ContextMenu } from '@antv/graphin-components'; | ||
import '@antv/graphin-components/dist/index.css'; // Graphin 组件 CSS | ||
|
||
const data = Utils.mock(10) | ||
.circle() | ||
.graphin(); | ||
|
||
const App = () => { | ||
return ( | ||
<div> | ||
<Graphin data={data} layout={{ name: 'concentric' }}> | ||
<Toolbar /> | ||
<ContextMenu | ||
render={() => { | ||
return <Card title="Card title">Card content</Card>; | ||
}} | ||
/> | ||
</Graphin> | ||
</div> | ||
); | ||
}; | ||
const rootElement = document.getElementById('container'); | ||
ReactDOM.render(<App />, rootElement); |
13 changes: 13 additions & 0 deletions
13
packages/graphin-site/examples/components/toolbar/demo/meta.json
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,13 @@ | ||
{ | ||
"title": { | ||
"zh": "中文分类", | ||
"en": "Category" | ||
}, | ||
"demos": [ | ||
{ | ||
"filename": "renderRandomData.jsx", | ||
"title": "渲染节点:无布局信息", | ||
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*nBhpT5HbGOAAAAAAAAAAAABkARQnAQ" | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/graphin-site/examples/components/toolbar/index.zh.md
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,9 @@ | ||
--- | ||
title: toolbar 工具栏 | ||
order: 0 | ||
redirect_from: | ||
- /zh/examples | ||
- /en/examples | ||
--- | ||
|
||
Toolbar 工具栏 |
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 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,9 +1,10 @@ | ||
exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => { | ||
actions.setWebpackConfig({ | ||
resolve: { | ||
alias: { | ||
react: require.resolve('react'), | ||
}, | ||
}, | ||
}); | ||
actions.setWebpackConfig({ | ||
resolve: { | ||
alias: { | ||
react: require.resolve('react'), | ||
'react-dom': require.resolve('react-dom'), | ||
}, | ||
}, | ||
}); | ||
}; |