This project provides an interactive network visualization of characters, episodes, and locations from the TV show Rick and Morty. It fetches data from the Rick and Morty API, processes the data using Python, and visualizes it as a force-directed graph using D3.js.
The graph includes:
- Nodes: Characters, episodes, and locations, each scaled for size based on degree of connectivity.
- Links: All relationships between the nodes, such as:
- Characters appearing in episodes.
- Characters residing in locations.
The project is hosted on the web at: https://rick-morty-node-map.onrender.com/
Note: This project is hosted on the free tier, so you may need to wait a few moments for the server to spin up.
- Interactive graph with zoom, drag, and pan.
- Toggle between circular nodes and character images.
- Filter nodes based on types (Characters, Episodes, Locations).
- Search nodes by name and types (Characters, Episodes, Locations).
- Highlight connections to one particular node.
- Checkbox toggles show/hide node types or switch between circular nodes categorized by type and images of characters.
- Search tool filters nodes by name or type.
- Clicking a node with "Highlight Selected Nodes" checked focuses on its relationships and rearranges the graph.
- Clicking on a node always displays the node's data, including character images.
Before running the project, make sure you have the following installed:
- Python: Version 3.10 or higher.
- Node.js: Version 16 or higher with npm.
- Necessary Python packages:
requests
The graph (and its underlying network.json
file) is organized like this:
- Nodes:
- Characters: Represent individuals from the show.
- Episodes: Represent episodes in which characters appear.
- Locations: Represent places associated with characters.
- Edges:
- Connect Characters to the Episodes they appear in.
- Connect Characters to the Locations they reside in.
- A character connects to the episodes they appear in and the location they are from.
- Locations are linked to characters, and never linked to episodes.
- No selected node will connect to additional nodes of the same type.
- Every character is connected to at least one episode and one location.
- Git clone https://github.com/akutsupis/rick_morty_node_map.git
- Install Python dependencies using
pip install -r requirements.txt
- Run
python DataStructure.py
to download and create the network json files. - Run
npm install
to install required Node.js dependencies. - Use
node app.js
to launch the server. - Open your browser and navigate to http://localhost:3000.
The Rick and Morty API does not require any API key for access.