Skip to content

Commit

Permalink
Graph: specify edge keys
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylyeo committed Apr 21, 2024
1 parent bf1f628 commit 691e10b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@
{
const sourceId = attesterNodeId
const targetId = recipientNodeId
const edgeId = `${sourceId}|${targetId}`
// const edgeId = `${sourceId}|${targetId}`
const edgeId = `attestation/${attestationId}`
if(!graph.hasEdge(edgeId) && graph.hasNode(sourceId) && graph.hasNode(targetId))
graph.addEdge(
graph.addEdgeWithKey(
edgeId,
sourceId,
targetId,
{
Expand All @@ -135,10 +137,12 @@
{
const sourceId = attesterNodeId
const targetId = schemaNodeId
const edgeId = `${sourceId}|${targetId}`
// const edgeId = `${sourceId}|${targetId}`
const edgeId = `attestation/${attestationId}|1`
if(!graph.hasEdge(edgeId) && graph.hasNode(sourceId) && graph.hasNode(targetId))
graph.addEdge(
graph.addEdgeWithKey(
edgeId,
sourceId,
targetId,
{
Expand All @@ -152,10 +156,12 @@
{
const sourceId = schemaNodeId
const targetId = recipientNodeId
const edgeId = `${sourceId}|${targetId}`
// const edgeId = `${sourceId}|${targetId}`
const edgeId = `attestation/${attestationId}|2`
if(!graph.hasEdge(edgeId) && graph.hasNode(sourceId) && graph.hasNode(targetId))
graph.addEdge(
graph.addEdgeWithKey(
edgeId,
sourceId,
targetId,
{
Expand Down

0 comments on commit 691e10b

Please sign in to comment.