Skip to content

Commit a919105

Browse files
committed
Node click to view opinion dashboard
1 parent 97a7b06 commit a919105

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/_App/BotAnalysis/Networks/Graph2.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import Card from 'react-bootstrap/Card'
1212
import Spinner from '../../Spinner'
1313
import cachedData from './data'
1414

15+
function nodeClickHandler(node, event){
16+
console.log("YOU CLICKED", node["id"])
17+
//window.open(`https://twitter.com/${node["id"]}`, '_blank')
18+
window.open(`/user-opinions?sn=${node["id"]}`, '_blank')
19+
}
20+
1521
const ForceTree = ({ data }) => {
1622

1723
data["nodes"] = data["nodes"].map(function(node){
@@ -51,6 +57,7 @@ const ForceTree = ({ data }) => {
5157
nodeVal={5}
5258
nodeLabel={(node) => `@${node["id"]}`}
5359
nodeRelSize={1}
60+
onNodeClick={nodeClickHandler}
5461

5562
//dagMode="td"
5663
//dagLevelDistance={300}

src/_App/BotAnalysis/Networks/Section.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export default function BotNetworks() {
1818
<Card.Title><h3>Bot Networks</h3></Card.Title>
1919

2020
<Card.Text>
21-
The chart below shows the interconnections between bots in each community.
21+
The chart below shows the interconnections between bots in each <a href="/bot-communities">community</a>.
22+
{" "} Click any circle to view that bot's Impeachment Opinions in a new window.
2223
</Card.Text>
24+
25+
2326
<NetworkGraph/>
2427

2528
{/*

src/_App/BotAnalysis/Page.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ActivitySection from './Activity/Section'
66
import BeneficiariesSection from './Beneficiaries/Section'
77
import LanguageSection from './Language/Section'
88
import ImpactSection from './Impact/Section'
9+
import NetworksSection from './Networks/Section'
910
import CommunitiesSection from './Communities/Section'
1011
import ClassificationSection from './Classification/Section'
1112

@@ -15,6 +16,7 @@ export default function BotAnalysisPage() {
1516
<SectionIndex/>
1617

1718
<ImpactSection/>
19+
<NetworksSection/>
1820
<BeneficiariesSection/>
1921
<LanguageSection/>
2022
<ActivitySection/>

0 commit comments

Comments
 (0)