blob: bba295543c5ba8c215e39043a26b7fcfc8b36c83 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
import React, { useState } from "react"
import { observer } from "mobx-react-lite"
import { ViewStyle } from "react-native"
import { Screen, Text } from "../../components"
// import { useNavigation } from "@react-navigation/native"
// import { useStores } from "../../models"
import { color } from "../../theme"
import { Graph } from "../../components"
import { Tweaks } from "../../components"
import genRandomTree from "../../data/randomdata";
const ROOT: ViewStyle = {
backgroundColor: color.palette.black,
flex: 1,
}
export const GraphScreen = observer(function GraphScreen() {
// Pull in one of our MST stores
// const { someStore, anotherStore } = useStores()
// Pull in navigation via hook
// const navigation = useNavigation()
const [charge, setCharge] = useState(-30);
const [collision, setCollision] = useState(false);
const [linkStrength, setLinkStrength] = useState(1);
const [linkIts, setLinkIts] = useState(1);
const [physics, setPhysics] = useState(
{
charge: -30,
collision: false,
linkStrength: 1,
linkIts: 1
});
const gData = genRandomTree();
return (
<Screen style={ROOT} preset="scroll">
<Text preset="header" text="Graph" />
<Tweaks
physics={physics}
setPhysics={setPhysics}
/>
<Graph
physics={physics}
gData = {gData}
/>
</Screen>
);
});
|