aboutsummaryrefslogtreecommitdiff
path: root/react-frontend/src/components/Visualization.js
diff options
context:
space:
mode:
authorJulia McCauley <skurvyj@gmail.com>2021-04-19 19:18:48 -0400
committerJulia McCauley <skurvyj@gmail.com>2021-04-19 19:18:48 -0400
commit01e50d7a0bbab78ffbbf858b03c6b365d2886397 (patch)
tree12034fddb59f9bec2900d798b4a67b21f61b1bfa /react-frontend/src/components/Visualization.js
parent58dbfe9d7e511e47c8b50078f060911de74b1d4b (diff)
added profit calcs back in, made visualization more dynamic
Diffstat (limited to 'react-frontend/src/components/Visualization.js')
-rw-r--r--react-frontend/src/components/Visualization.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/react-frontend/src/components/Visualization.js b/react-frontend/src/components/Visualization.js
index 0a0c82a..9a837a1 100644
--- a/react-frontend/src/components/Visualization.js
+++ b/react-frontend/src/components/Visualization.js
@@ -28,18 +28,20 @@ function Visualization(props) {
});
const getNodes = () => {
let nodes = [];
+ const maxScore = props.data[0].suspicionScore;
+ const interval = maxScore / 4;
props.data.forEach(hub => {
if (hub.followers) {
let colorVal = '#f6f7d4';
const score = hub.suspicionScore;
- if(score > 0.8){
+ if(score > (maxScore - interval)){
colorVal = '#d92027'
}
- if(score < 0.8 && score > 0.6){
+ if(score <= (maxScore - interval) && score > (maxScore - interval*2)){
colorVal = '#f37121'
}
- if(score < 0.6 && score > 0.4){
+ if(score <= (maxScore - interval*2) && score > (maxScore - interval*3)){
colorVal = '#fdca40'
}
nodes.push({