Explore Wikipedia allows you to simply explore the links between pages on wikipedia and visualize the paths between them.
I created this proejct shortly after learning taking a data structures course. We learned about graphs, trees, traversal, and DFS and BFS algorithms. After learning about this I immediately connected it to The Wiki Game: a game that places you at a certain page and asks you to find your way to the given target page. I created this project so that I could do just that and visualize the results as well. The python script build_graph.py can actually 'play' this game perfectly. Given a starting page and a target page, it will use a DFS to explore all wikipedia pages until it eventually finds the target page. It actually works pretty well for pages that are highly related but as soon as you put in pdifferent pages, it will get completely 'lost' and take forever to find the target (mostly because wikipedia has so many pages lol). The frontend simply looks at pre-generated data and allows you to visualize how individual pages connect to each other. This is one of my favourite projects because it is genuinely so cool to see the links between pages and the weird and unexpected links you can find between something like the page "B Programming Language" and "Gary Kasparov" (former world chess champion).
- Solve any problem from The Wiki Game
- Find a path between any two pages on Wikipedia
- Beautifully visualize the path between two pages
- Create a python virtual environment with
python3 -m venv ./env - Activate the environment:
source ./env/bin/activate - Run
src/build_graph.pyand input the names of the source and target wikipedia pages - You can now look at the generated graph here:
build/converted.js. This file has the graph converted fromnxformat (what python ses) tocytoscapewhich is what the frontend JavaScript uses. - Run
npm installto install all frontend packages - Run
npm run devto run the frontend - Go to
http://localhost:5173and view the cool visualization :)
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project on Github
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request on Github
Musa Ahmed - [email protected]
Project Link: https://github.com/m-GDEV/explore-wikipedia
Distributed under the GPL 3.0 License. See LICENSE for more information.
