Skip to content

Commit

Permalink
🐛 fix examples throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Nov 29, 2019
1 parent f5222a0 commit a1b547a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 33 deletions.
9 changes: 5 additions & 4 deletions packages/graphin-site/examples/layout/demo/Force.jsx
@@ -1,12 +1,13 @@
/* eslint-disable no-undef */
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const data = Utils.mock(100).random(0.3).graphin();
const data = Utils.mock(100)
.random(0.3)
.graphin();

const App = () => (
<Graphin data={data} layout={{ name: 'force' }} />
);
const App = () => <Graphin data={data} layout={{ name: 'force' }} />;

ReactDOM.render(<App />, document.getElementById('container'));
@@ -1,15 +1,11 @@
/* eslint-disable react/react-in-jsx-scope */
/* eslint-disable no-undef */

// import React from 'react';
// import ReactDOM from 'react-dom';
// import Graphin from '@antv/graphin';
// import '@antv/graphin/dist/index.css'; // 引入Graphin CSS
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const Graphin = window.Graphin.default;
const { Utils } = window.Graphin;

const data = Utils.mock(100)
const data = Utils.mock(50)
.random(0.3)
.graphin();

Expand Down
13 changes: 13 additions & 0 deletions packages/graphin-site/examples/layout/demo/Grid.jsx
@@ -0,0 +1,13 @@
/* eslint-disable no-undef */
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const data = Utils.mock(50)
.random(0.3)
.graphin();

const App = () => <Graphin data={data} layout={{ name: 'grid' }} />;

ReactDOM.render(<App />, document.getElementById('container'));
9 changes: 7 additions & 2 deletions packages/graphin-site/examples/layout/demo/meta.json
Expand Up @@ -7,12 +7,17 @@
{
"filename": "ForceWithCentripetal.jsx",
"title": "自定义向心力",
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*nBhpT5HbGOAAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_975111/afts/img/A*Z2vsTZDRHxYAAAAAAAAAAABkARQnAQ"
},
{
"filename": "Force.jsx",
"title": "力导布局",
"screenshot": "https://gw.alipayobjects.com/mdn/rms_d314dd/afts/img/A*nBhpT5HbGOAAAAAAAAAAAABkARQnAQ"
"screenshot": "https://gw.alipayobjects.com/mdn/rms_975111/afts/img/A*oBwXRrtoXM0AAAAAAAAAAABkARQnAQ"
},
{
"filename": "Grid.jsx",
"title": "矩阵布局",
"screenshot": "https://gw.alipayobjects.com/mdn/rms_975111/afts/img/A*p-mqRZq2_WcAAAAAAAAAAABkARQnAQ"
}
]
}
15 changes: 5 additions & 10 deletions packages/graphin-site/examples/render/demo/Circle.jsx
@@ -1,14 +1,9 @@
/* eslint-disable react/react-in-jsx-scope */
/* eslint-disable no-undef */

// import React from 'react';
// import ReactDOM from 'react-dom';
// import Graphin from '@antv/graphin';
// import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const Graphin = window.Graphin.default;
const { Utils } = window.Graphin;
// console.log(ReactDOM, window.ReactDOM);
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const data = Utils.mock(10)
.circle()
Expand All @@ -22,4 +17,4 @@ const App = () => {
);
};
const rootElement = document.getElementById('container');
window.ReactDOM.render(<App />, rootElement);
ReactDOM.render(<App />, rootElement);
12 changes: 4 additions & 8 deletions packages/graphin-site/examples/render/demo/Random.jsx
@@ -1,13 +1,9 @@
/* eslint-disable react/react-in-jsx-scope */
/* eslint-disable no-undef */

// import React from 'react';
// import ReactDOM from 'react-dom';
// import Graphin from '@antv/graphin';
// import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const Graphin = window.Graphin.default;
const { Utils } = window.Graphin;
import React from 'react';
import ReactDOM from 'react-dom';
import Graphin, { Utils } from '@antv/graphin';
import '@antv/graphin/dist/index.css'; // 引入Graphin CSS

const data = Utils.mock(10)
.random()
Expand Down

0 comments on commit a1b547a

Please sign in to comment.