This project visualizes high-level strength comparisons between Pokémon based on their typing using force-based graph drawing.
Creates a visualization for the strength graph of Pokémon
./draw-graph [input_file_path] [number of pokemon] [is_colored] [is_scaling] [output_file_path]
- NOTE: All fields are optional, just ensure that is_colored and is_scaling are passed together
input_file_path
- The path to the csv where the Pokemon are located. Defaults todata/pokemon.csv
number_of_pokemon
- The number of Pokémon that should be compared and visualized, max is801
. Defaults to151
is_colored
- Whether to find the chromatic number of the graph and to color the vertices. Defaults totrue
is_scaling
- Whether to scale the vertices based on its degree. Defaults totrue
output_file_path
- The output file for the visualization fo the graph. Defaults totest_graph.png
cs225
- code provided for CS225 MPs like PNG and HSLAPixeldata
- location with the csv containing all of the Pokémon datagraphAlgorithms
- algorithms that are run on the graph (BFS, Visualizer, Coloring)graphStructure
- classes that are the strucuture of the graph (Graph, Vertex, Edge)graphUtil
- utility class to help create the graph (DataParser, GraphBuilder, TypeMapper)tests
- includes all the test files for each class
- clang 6.0.1
- Clone this repo navigate to its directory
The Pokemon data is already included in csv format inside the repo.
git clone https://github-dev.cs.illinois.edu/cs225-fa21/ccl4-harryc3-devbp2-suyashn2.git pokemon-graph-viz cd pokemon-graph-viz
- Now make the executable by running
make
- Run the executable
./draw-graph [input_file_path] [number of pokemon] [is_colored] [is_scaling] [output_file_path]
- Construct a graph with 20 nodes, with coloring, but without scaling
./draw-graph 20 True False
- This will construct a graph with 151 nodes, with coloring and scaling
The output for this executable will look like this:
./draw-graph data/pokemon.csv 151 True True test_graph2.png
The project comes with a test suite that can be build and run it with the following commands:
make test
./test [tag]
The tests can be found in the tests folder. Functionalities can be specifically tested using the following tags:
- [parser]: the csv is read correctly and saved in an object
- [builder]: the graph can be built with the correct number of vertices and edges and the correct values
- [mapper]: the Pokémon types have the correct indicies
- [graph]: the graph's access methods are correct
- [bfs]: BFS runs properly on the graph and visited the correct edges and vertices in the correct order
- [coloring]: the chromatic number of the graph is correctly generated and colors are properly assigned to different nodes
- no-tags: all of the tests above are run