mirror of
https://github.com/maciejpedzich/six-degs-of-f1.git
synced 2024-11-27 15:55:47 +01:00
Rename VisGraph component to Graph
This commit is contained in:
parent
02908f7021
commit
bbce0af92a
@ -1,7 +1,7 @@
|
||||
---
|
||||
import type { Node, Edge, Options } from 'vis-network/esnext';
|
||||
|
||||
export interface Props {
|
||||
interface Props {
|
||||
nodes: Node[];
|
||||
edges: Edge[];
|
||||
options?: Options;
|
||||
@ -40,6 +40,26 @@ const { nodes, edges, options = {} } = Astro.props;
|
||||
edges
|
||||
};
|
||||
const options: Options = {
|
||||
nodes: {
|
||||
shape: 'box',
|
||||
color: '#2060df',
|
||||
font: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
edges: {
|
||||
arrows: 'to',
|
||||
color: '#4178e7'
|
||||
},
|
||||
layout: {
|
||||
hierarchical: {
|
||||
direction: 'UD',
|
||||
sortMethod: 'directed',
|
||||
nodeSpacing: 175,
|
||||
levelSeparation: 80
|
||||
}
|
||||
},
|
||||
physics: false,
|
||||
...(JSON.parse(this.dataset.options as string) as Options)
|
||||
};
|
||||
|
||||
@ -52,7 +72,7 @@ const { nodes, edges, options = {} } = Astro.props;
|
||||
|
||||
<style>
|
||||
div {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user