diff options
author | clarkohw <66530369+clarkohw@users.noreply.github.com> | 2021-04-19 20:39:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-19 20:39:00 -0400 |
commit | c1a59efe3ac070bdd6866666bbee5f5b57786777 (patch) | |
tree | 6fa47afa0b624eaea0d9ffa24531cad8be35f9d3 /react-frontend/src/components/Visualization.js | |
parent | 905460902c06e9df370c91109554ecbbeb730ac7 (diff) | |
parent | 01e50d7a0bbab78ffbbf858b03c6b365d2886397 (diff) |
Merge branch 'master' into profit-optimization
Diffstat (limited to 'react-frontend/src/components/Visualization.js')
-rw-r--r-- | react-frontend/src/components/Visualization.js | 8 |
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({ |