aboutsummaryrefslogtreecommitdiff
path: root/react-frontend/src
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-18 00:53:51 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-18 00:53:51 -0400
commite00c435a929afeac1965e04b8f6585696a915e77 (patch)
tree20e58ac3bd458c4bc7382dcb9619aab8ff42609c /react-frontend/src
parent7abfa212097361a6e9f31194ba53055c7c9f4796 (diff)
Working build that scales with the large database. We need to figure out the profit calculation on the large scale, though.
Diffstat (limited to 'react-frontend/src')
-rw-r--r--react-frontend/src/App.js5
-rw-r--r--react-frontend/src/components/Visualization.js15
2 files changed, 13 insertions, 7 deletions
diff --git a/react-frontend/src/App.js b/react-frontend/src/App.js
index 34632eb..c9451a9 100644
--- a/react-frontend/src/App.js
+++ b/react-frontend/src/App.js
@@ -31,6 +31,10 @@ function App() {
const toEpochMilli = date => Date.parse(date);
const getGraphData = () => {
+ console.log({
+ start: toEpochMilli(dates.start),
+ end: toEpochMilli(dates.end)
+ });
fetch("http://localhost:4567/data", {
method: "POST",
body: JSON.stringify({
@@ -46,6 +50,7 @@ function App() {
.then(data => {
setData(data.holders);
setHasLoaded(true);
+ console.log(data.holders);
})
.catch(err => console.log(err));
diff --git a/react-frontend/src/components/Visualization.js b/react-frontend/src/components/Visualization.js
index 91082e9..2016129 100644
--- a/react-frontend/src/components/Visualization.js
+++ b/react-frontend/src/components/Visualization.js
@@ -15,8 +15,7 @@ function Visualization(props) {
const options = {
edges: {
color: "#ffffff"
- },
- autoResize: true
+ }
};
const events = {
select: () => event => props.setSelected(event.nodes[0])
@@ -29,11 +28,13 @@ function Visualization(props) {
const getNodes = () => {
let nodes = [];
props.data.forEach(hub => {
- nodes.push({
- id: hub.id,
- label: hub.name,
- size: hub.suspicionScore * 10
- });
+ if (hub.followers) {
+ nodes.push({
+ id: hub.id,
+ label: hub.name,
+ size: hub.suspicionScore * 10
+ });
+ }
});
return nodes;
}