-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes from attributes to metadata in graph model
The JSON graph spec no longer uses attributes so changing to metadata. This will ease the tranistion for clients between JSON Graph and the GraphModel. BREAKING CHANGE: Node and Edge no longer have attributes - use metadata instead.
- Loading branch information
1 parent
229bc64
commit 71a6a03
Showing
36 changed files
with
627 additions
and
544 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,40 @@ | ||
import { ModelEdge, ModelNode } from '@committed/components-graph' | ||
|
||
const exampleNodesArr: ModelNode[] = [ | ||
{ id: 'n1', attributes: { type: 'person' } }, | ||
{ id: 'n2', attributes: { type: 'person' } }, | ||
{ id: 'n3', attributes: { type: 'person' } }, | ||
{ id: 'n4', attributes: { type: 'place' } }, | ||
{ id: 'n5', attributes: { type: 'place' } }, | ||
{ id: 'n6', attributes: { type: 'place' } }, | ||
{ id: 'n1', metadata: { type: 'person' } }, | ||
{ id: 'n2', metadata: { type: 'person' } }, | ||
{ id: 'n3', metadata: { type: 'person' } }, | ||
{ id: 'n4', metadata: { type: 'place' } }, | ||
{ id: 'n5', metadata: { type: 'place' } }, | ||
{ id: 'n6', metadata: { type: 'place' } }, | ||
] | ||
const exampleEdgesArr: ModelEdge[] = [ | ||
{ | ||
id: 'e1', | ||
source: 'n1', | ||
target: 'n2', | ||
attributes: {}, | ||
}, | ||
{ | ||
id: 'e2', | ||
source: 'n1', | ||
target: 'n3', | ||
attributes: {}, | ||
}, | ||
{ | ||
id: 'e3', | ||
source: 'n3', | ||
target: 'n4', | ||
attributes: {}, | ||
}, | ||
{ | ||
id: 'e5', | ||
source: 'n5', | ||
target: 'n5', | ||
attributes: {}, | ||
}, | ||
] | ||
|
||
export const exampleGraphData = { | ||
nodes: exampleNodesArr.reduce<Record<string, ModelNode>>((prev, next) => { | ||
prev[next.id] = next | ||
return prev | ||
}, {}), | ||
edges: exampleEdgesArr.reduce<Record<string, ModelEdge>>((prev, next) => { | ||
prev[next.id] = next | ||
prev[next.id as string] = next | ||
return prev | ||
}, {}), | ||
edges: exampleEdgesArr | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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.