-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: add combo demos * docs: combo demos
- Loading branch information
Showing
16 changed files
with
74 additions
and
254 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
124 changes: 0 additions & 124 deletions
124
packages/site/examples/item/defaultCombos/demo/circle.js
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
import { Graph } from '@antv/g6'; | ||
|
||
const data = { | ||
nodes: [ | ||
{ id: 'node1', style: { x: 250, y: 150, parentId: 'combo1' } }, | ||
{ id: 'node2', style: { x: 350, y: 150, parentId: 'combo1' } }, | ||
{ id: 'node3', style: { x: 250, y: 300, parentId: 'combo2' } }, | ||
], | ||
edges: [], | ||
combos: [ | ||
{ id: 'combo1', style: { parentId: 'combo2' } }, // collapsed: true | ||
{ id: 'combo2', style: {} }, | ||
], | ||
}; | ||
|
||
const graph = new Graph({ | ||
container: 'container', | ||
node: { | ||
style: { | ||
labelText: (d) => d.id, | ||
}, | ||
}, | ||
combo: { | ||
style: { | ||
type: 'circle', // 👈🏻 Combo shape type. | ||
}, | ||
}, | ||
data, | ||
behaviors: ['drag-element', 'collapse-expand'], | ||
}); | ||
|
||
graph.render(); |
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.
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,33 @@ | ||
import { Graph } from '@antv/g6'; | ||
|
||
const data = { | ||
nodes: [ | ||
{ id: 'node1', style: { x: 250, y: 150, parentId: 'combo1' } }, | ||
{ id: 'node2', style: { x: 350, y: 150, parentId: 'combo1' } }, | ||
{ id: 'node3', style: { x: 250, y: 300, parentId: 'combo2' } }, | ||
], | ||
edges: [], | ||
combos: [ | ||
{ id: 'combo1', style: { parentId: 'combo2' } }, // collapsed: true | ||
{ id: 'combo2', style: {} }, | ||
], | ||
}; | ||
|
||
const graph = new Graph({ | ||
container: 'container', | ||
node: { | ||
style: { | ||
labelText: (d) => d.id, | ||
}, | ||
}, | ||
combo: { | ||
style: { | ||
type: 'rect', // 👈🏻 Combo shape type. | ||
padding: 20, | ||
}, | ||
}, | ||
data, | ||
behaviors: ['drag-element', 'collapse-expand'], | ||
}); | ||
|
||
graph.render(); |
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
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
Oops, something went wrong.