diff --git a/src/components/VisGraph.astro b/src/components/VisGraph.astro new file mode 100644 index 0000000..1c0fafd --- /dev/null +++ b/src/components/VisGraph.astro @@ -0,0 +1,58 @@ +--- +import type { Node, Edge, Options } from 'vis-network/esnext'; + +export interface Props { + nodes: Node[]; + edges: Edge[]; + options?: Options; +} + +const { nodes, edges, options = {} } = Astro.props; +--- + + +
+
+ + + + diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro new file mode 100644 index 0000000..90818f3 --- /dev/null +++ b/src/layouts/BaseLayout.astro @@ -0,0 +1,18 @@ + + + + + + + Astro + + + + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index 2d14107..1517317 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,16 +1,23 @@ --- +import BaseLayout from '../layouts/BaseLayout.astro'; +import VisGraph from '../components/VisGraph.astro'; + +const nodes = [ + { id: 1, label: 'Node 1' }, + { id: 2, label: 'Node 2' }, + { id: 3, label: 'Node 3' }, + { id: 4, label: 'Node 4' }, + { id: 5, label: 'Node 5' } +]; +const edges = [ + { from: 1, to: 3 }, + { from: 1, to: 2 }, + { from: 2, to: 4 }, + { from: 2, to: 5 }, + { from: 3, to: 3 } +]; +--- ---- - - - - - - - - Astro - - -

Astro

- - + + +