aboutsummaryrefslogtreecommitdiff
path: root/react-frontend/src
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-18 01:31:20 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-18 01:31:20 -0400
commit4cfdb31be3697565e5c4ae95cdc4b60161bd4e84 (patch)
treebfb480708605c0d338e2dd84d18e25ea92197877 /react-frontend/src
parent6b5037e4e03cd44f79bb1d3460e0e45c6d7b6541 (diff)
Have a good working canvas now by limiting the results shown.
Diffstat (limited to 'react-frontend/src')
-rw-r--r--react-frontend/src/App.js8
-rw-r--r--react-frontend/src/components/HubList.js4
-rw-r--r--react-frontend/src/components/Visualization.js2
3 files changed, 8 insertions, 6 deletions
diff --git a/react-frontend/src/App.js b/react-frontend/src/App.js
index c9451a9..0a6e6c1 100644
--- a/react-frontend/src/App.js
+++ b/react-frontend/src/App.js
@@ -48,9 +48,11 @@ function App() {
})
.then(res => res.json())
.then(data => {
- setData(data.holders);
+ //TODO: optimize this
+ const sliced = data.holders.slice(0, 500);
+ console.log(sliced);
+ setData(sliced);
setHasLoaded(true);
- console.log(data.holders);
})
.catch(err => console.log(err));
@@ -59,7 +61,7 @@ function App() {
// Hooks to update data on init and switching of data
- useEffect(() => getGraphData(), []);
+ //useEffect(() => getGraphData(), []);
useEffect(() => {
setIsChanging(true);
getGraphData();
diff --git a/react-frontend/src/components/HubList.js b/react-frontend/src/components/HubList.js
index 5736e89..0df3020 100644
--- a/react-frontend/src/components/HubList.js
+++ b/react-frontend/src/components/HubList.js
@@ -22,8 +22,8 @@ function HubList(props) {
const updateHubItems = () => {
// sort and create the elemnts
let hubs = [];
- const sorted = props.data.sort((a, b) => b.suspicionScore - a.suspicionScore);
- sorted.forEach(hub => hubs.push(
+ //const sorted = props.data.sort((a, b) => b.suspicionScore - a.suspicionScore);
+ props.data.forEach(hub => hubs.push(
<Hub key={hub.id} id={hub.id} name={hub.name} value={hub.suspicionScore} setSelected={props.setSelected}></Hub>
));
diff --git a/react-frontend/src/components/Visualization.js b/react-frontend/src/components/Visualization.js
index 2016129..1975e86 100644
--- a/react-frontend/src/components/Visualization.js
+++ b/react-frontend/src/components/Visualization.js
@@ -32,7 +32,7 @@ function Visualization(props) {
nodes.push({
id: hub.id,
label: hub.name,
- size: hub.suspicionScore * 10
+ size: hub.suspicionScore
});
}
});