Skip to content

Commit

Permalink
feat(Graphin): change shape to type for g6@3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Jun 2, 2020
1 parent 0e46247 commit 8df002e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/graphin/src/controller/layout/dataChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function checkEdges(edges: Data['edges'], data: Data, options: CheckerOption) {
.map(edge => {
const { shape, style } = edge;
return {
shape: shape || 'LineEdge',
type: shape || 'LineEdge',
style: style || {
line: {
width: 1,
Expand Down Expand Up @@ -129,8 +129,8 @@ function checkEdges(edges: Data['edges'], data: Data, options: CheckerOption) {
// loop edge checker
if (!options.edge.autoLoop) return edge;
// skip user-defined shape
if (edge.shape === 'LineEdge' && edge.source === edge.target) {
edge.shape = 'loop';
if (edge.type === 'LineEdge' && edge.source === edge.target) {
edge.type = 'loop';
}
return edge;
});
Expand Down Expand Up @@ -165,7 +165,7 @@ function checkNodes(nodes: Data['nodes'], _data: Data, _options: CheckerOption)
})
.map(node => {
return {
shape: node.shape || 'CircleNode',
type: node.shape || 'CircleNode',
...node,
data: {
...node.data,
Expand Down

0 comments on commit 8df002e

Please sign in to comment.