/comments-as-a-graph

Read 4chan, Hacker News and reddit comments using a graph visualization.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

comments-as-a-graph

Read 4chan and reddit (coming soon) comments using a graph visualization.

Try news.ycombinator.com

Try reddit.com

Try 4chan.org threads

How it's made

The thread is downloaded from the 4chan api, then a python script converts it into a .gv file by parsing the comments and searching for >>POST_ID references. These references become the graph's edges and the posts become the nodes. Then the file is saved in the site root. Example

The frontend's js loads the .gv file and displays it using viz.js but the viz.js was custom compiled (via emscripten) to shrink it to 1.8MB instead of 2.4MB.

The panning and zooming is provided by svg-pan-zoom and the minimap was implemented by rendering the svg graph to a canvas.