Skip to content

Commit

Permalink
<SigmaGraph>: use curved arrow edges
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylyeo committed Apr 20, 2024
1 parent dea320c commit fa07f63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/SigmaGraph.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
let EdgeArrowProgram: typeof import('sigma/rendering').EdgeArrowProgram | undefined = $state(undefined)
$effect(() => { import('sigma/rendering').then(module => { EdgeArrowProgram = module.EdgeArrowProgram }) })
let EdgeCurveProgram: typeof import('@sigma/edge-curve').default | undefined = $state(undefined)
$effect(() => { import('@sigma/edge-curve').then(module => { EdgeCurveProgram = module.default }) })
let EdgeCurveModule: typeof import('@sigma/edge-curve') | undefined = $state(undefined)
$effect(() => { import('@sigma/edge-curve').then(module => { EdgeCurveModule = module }) })
import forceAtlas2 from 'graphology-layout-forceatlas2'
// Context
import { browser } from '$app/environment'
Expand Down Expand Up @@ -72,7 +73,7 @@
// (Derived)
let renderer: Sigma | undefined = $derived.by(() => {
if(browser && graph && container && Sigma && EdgeArrowProgram && EdgeCurveProgram){
if(browser && graph && container && Sigma && EdgeArrowProgram && EdgeCurveModule){
const renderer = new Sigma(
graph,
container,
Expand All @@ -81,7 +82,7 @@
renderEdgeLabels: true,
edgeProgramClasses: {
straight: EdgeArrowProgram,
curved: EdgeCurveProgram,
curved: EdgeCurveModule.EdgeCurvedArrowProgram,
},
},
)
Expand Down

0 comments on commit fa07f63

Please sign in to comment.