aboutsummaryrefslogtreecommitdiff
path: root/react-frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'react-frontend/src')
-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({