/twitch-shared-community-graph

Small project to show a graph of shared communities.

Primary LanguageJavaScriptMIT LicenseMIT

Twitch Shared Community Graph


Twitch Shared Community Graph It is a tool that teaches you to visualise the shared communities that exist between streamers on twitch, through the use of graphs.

Graph gif

Installation

NOTE: NodeJS 10.13.0 or higher is required.

# clone the repo
$ git clone https://github.com/EsteveSegura/twitch-shared-community-graph.git

# change the working directory to insta-growth
$ cd twitch-shared-community-graph

# install NodeJS if is not installed
$ cd src && npm i && npm run serve

Usage

To add streamers and see how their communities are related, just edit the /src/index.js file and modify it as follows.

import {getAllFollowers} from './application/getAllFollowers/';
import {adjacencyList} from './domain/services/adjacencyList';
import Graph from './domain/graph/graph';

async function drawGraph() {
  const streamers = [
    await getAllFollowers('<STREAMER USER ID>'), // Add streamer user id
    await getAllFollowers('<STREAMER USER ID>'), // Add streamer user id
  ];

  const createAdjacencyList = adjacencyList(streamers);
  const streamsGraph = new Graph({title: 'Streamers', htmlId: 'sigma-container'});

  streamsGraph.bulkAdjacencyList(createAdjacencyList);
  streamsGraph.render();
}

drawGraph();

License

MIT © twitch-shared-community-graph