A Flask-based web application for visualizing large networks using Cytoscape.js. This application enables users to upload, query, and interactively explore network graphs with support for multiple file formats and visualization options.
Here's what you can expect when running the application:
Visualization of a medium-sized network with 998 nodes and 3000 edges
Result of querying Node_49 showing first-degree neighbors
Dark mode visualization with custom highlight colors
CSV format of exported subgraph data
The application provides powerful network visualization capabilities including:
- Upload and parse SIF, TSV/CSV files with automatic format detection
- Error handling for invalid file formats and data validation
- Query-based visualization of nodes and their first-degree neighbors
- Interactive visualization with multiple layout algorithms (Grid, Circle, CoSE)
- Dark mode support for comfortable viewing
- Subgraph extraction and export functionality
- Real-time network statistics and metrics
NRNB-VIS-APP/
β
βββ app.py # Flask application entry point
βββ generate_large_csv.py # Test data generation script
βββ README.md # This documentation
βββ LICENSE # MIT License file
β
βββ templates/
β βββ index.html # Main application template
β
βββ static/
β βββ app.js # Client-side application logic
β βββ style.css # Application styling
β βββ images/ # Screenshot directory for README
β βββ full_network.png
β βββ subgraph_query.png
β βββ dark_mode.png
β βββ exported_subgraph.png
β
βββ test_data/ # Generated test networks
βββ test_small.csv
βββ test_medium.csv
βββ test_large.csv
βββ test_xlarge.csv
-
Install Python 3 if not already installed
- Windows: Download from python.org
- macOS:
brew install python3 - Linux:
sudo apt install python3(Ubuntu/Debian) orsudo dnf install python3(Fedora)
-
Clone the Repository
git clone https://github.com/yourusername/NRNB-VIS.git cd NRNB-VIS -
Create a Virtual Environment
Windows:
python -m venv venv venv\Scripts\activate
macOS/Linux:
python3 -m venv venv source venv/bin/activate -
Install Dependencies
pip install flask
-
Generate Test Networks
Windows:
python generate_large_csv.py
macOS/Linux:
python3 generate_large_csv.py
-
Push Generated Files (if using Git)
# Create test_data directory if it doesn't exist mkdir -p test_data # Move generated files to test_data directory mv test_*.csv test_data/ # Add and commit the files git add test_data/*.csv git commit -m "Add test network data files" git push origin main
Note: If your test files are large, consider adding them to
.gitignoreand providing the generation script instead.
-
Start the Flask Server
Windows:
python app.py
macOS/Linux:
python3 app.py
-
Open your browser and navigate to http://127.0.0.1:5000/
- Click the "Choose File" button and select your network file
- Supported formats:
- CSV/TSV with header row containing "source" and "target" columns
- SIF format:
source interaction target1 target2 ... - TXT files with appropriate structure
-
View Full Network
- Networks with <5,000 nodes display automatically
- Larger networks require querying Subgraph to avoid performance issues
-
Query Specific Nodes
- Enter node IDs in the query box (comma or space-separated)
- Click "Query" to visualize selected nodes and their neighbors
-
Customize Visualization
- Choose different layouts from the dropdown menu
- Toggle dark mode for better visibility
- Select highlight colors for queried subgraphs
-
Export Options
- Download current subgraph as CSV
- Double-click nodes to view detailed information
- Drag nodes to adjust layout
- Zoom and pan to explore large networks
- Use the color picker to highlight specific subgraphs
- File Format Issues: Ensure your CSV/TSV has the correct header format
- Performance Problems: Use the query feature for large networks
- Memory Errors: Clear browser data or use smaller input files
This project is licensed under the MIT License - see the LICENSE file for details.