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';
|
import type { Node, Edge, Options } from 'vis-network/esnext';
|
||||||
|
|
||||||
export interface Props {
|
interface Props {
|
||||||
nodes: Node[];
|
nodes: Node[];
|
||||||
edges: Edge[];
|
edges: Edge[];
|
||||||
options?: Options;
|
options?: Options;
|
||||||
@ -40,6 +40,26 @@ const { nodes, edges, options = {} } = Astro.props;
|
|||||||
edges
|
edges
|
||||||
};
|
};
|
||||||
const options: Options = {
|
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)
|
...(JSON.parse(this.dataset.options as string) as Options)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +72,7 @@ const { nodes, edges, options = {} } = Astro.props;
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
div {
|
div {
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue
Block a user