Visualizing Network Topologies

Posted on Sat 19 April 2025 in network, topology, visualization, javascript, vibe coding • Tagged with network, topology, visualization, javascript, vibe coding

While preparing my classes on interconnection networks in computer systems, I wanted to better understand metrics related to ring topologies. To explore this, I created a simple JavaScript program to visualize a ring network, using “vibe coding”—an approach where you let Artificial Intelligence (AI) generate the code for you. The result is this Ring Network Visualization (GitHub repository).

Later, I came across several impressive visualizations built with Three.js (like this and this), and I wanted to give it a try. Using the same “vibe coding” approach, I developed this Topology Visualizer (GitHub repository). It’s a simple tool that allows you to visualize different network topologies—such as ring, mesh, and hypercube—in 3D. You can change the number of nodes and observe how the topology evolves. Clicking on a node triggers a visual effect that shows light bolts connecting it to the farthest node, effectively highlighting the diameter of the topology.

Topology Visualizer Screenshot


Serving JavaScript with Python's http.server

Posted on Wed 19 July 2023 in Python, JavaScript, Web • Tagged with Python, JavaScript, Web

I was trying to serve a JavaScript file with Python's http.server module, but I was getting this error:

Loading module from http://localhost:9876/main.js” was blocked because of a disallowed MIME type (“text/plain”).

I saw in this StackOverflow answer that I needed to change the MIME type for JavaScript files. I'm using Windows, so I checked the key HKEY_CLASSES_ROOT\.js in RegEdit, and I found that it had this value:

(Default)     JSFile
ContentType   text/plain
PerceivedType text

I changed the ContentType to application/javascript, and now my JavaScript files are served with the correct MIME type.

I'm not sure why the MIME type was set to text/plain in the first place. I'm guessing that it was set by a program that I installed, but I don't know which one. I'm also not sure if changing the MIME type will cause any problems with other programs.