Skip to content

Commit

Permalink
docs: fix site docs (#5897)
Browse files Browse the repository at this point in the history
* fix: ReferenceError: Graph is not defined

* refactor: using destructuring assignment
  • Loading branch information
codersjj authored Jun 21, 2024
1 parent 49b3029 commit 33047a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/site/docs/manual/getting-started/quick-start.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Copy the following code into an HTML file and then open this file in a browser:
<script src="https://unpkg.com/@antv/g6@5/dist/g6.min.js"></script>

<script>
const { Graph } = G6;
fetch('https://assets.antv.antgroup.com/g6/graph.json')
.then((res) => res.json())
.then((data) => {
Expand Down Expand Up @@ -78,6 +80,8 @@ fetch('https://assets.antv.antgroup.com/g6/graph.json').then((res) => res.json()
4. Finally, create an instance of the graph, pass in the configuration object, and call the `render` method to render the graph:

```js
const { Graph } = G6;

const graph = new Graph({
container: 'container',
autoFit: 'view',
Expand Down
4 changes: 4 additions & 0 deletions packages/site/docs/manual/getting-started/quick-start.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ order: 0
<script src="https://unpkg.com/@antv/g6@5/dist/g6.min.js"></script>

<script>
const { Graph } = G6;
fetch('https://assets.antv.antgroup.com/g6/graph.json')
.then((res) => res.json())
.then((data) => {
Expand Down Expand Up @@ -78,6 +80,8 @@ fetch('https://assets.antv.antgroup.com/g6/graph.json').then((res) => res.json()
4. 最后创建一个图实例,传入配置对象,并调用 `render` 方法渲染图:

```js
const { Graph } = G6;

const graph = new Graph({
container: 'container',
autoFit: 'view',
Expand Down

0 comments on commit 33047a8

Please sign in to comment.