Project Name: Interactive Visualization Tool for Equipment Reference Data Libraries - Use case on 15926.org RDLs
This project is an interactive visualization tool for the 15926.org RDLs, designed to help users explore complex data relationships using NetworkX and D3.js visualizations. The application is built using Streamlit, providing an intuitive and interactive web interface.
To retrieve the latest DATA from the ENDPOINT:
python3 scripts/data_retrieve.py
OR
python scripts/data_retrieve.py
To run this project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/nlp-tlp/15926-4-CITS5206-18.git cd 15926-4-CITS5206-18
-
Set Up a Virtual Environment:
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install Required Dependencies:
pip install --upgrade pip pip install -r requirements.txt
-
Check Installed Dependencies:
Use the provided script to check if all dependencies are installed properly:
python3 scripts/plugin_check.py
-
Run the Application:
streamlit run src/main.py
-
Terminate the Application:
Control + C
-
Exit the Virtual Environment (when finished):
deactivate
-
Clone the Repository:
git clone https://github.com/nlp-tlp/15926-4-CITS5206-18.git cd 15926-4-CITS5206-18
-
Set Up a Virtual Environment:
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate
-
Install Required Dependencies:
pip install -r requirements.txt
-
Check Installed Dependencies:
Use the provided script to check if all dependencies are installed properly:
python scripts/plugin_check.py
-
(Optional) Install Watchdog for Better Performance: For better performance, it is recommended to install the Watchdog module, which improves file monitoring. This requires the installation of Xcode command line tools (for macOS users):
xcode-select --install
pip install watchdog
-
Run the Application:
streamlit run src/main.py
-
Terminate the Application:
Control + C
-
Exit the Virtual Environment (when finished):
deactivate
-
Activate the Virtual Environment:
source venv/bin/activate
-
Run the Application:
streamlit run src/main.py
-
Exit the Virtual Environment (when finished):
deactivate
-
Activate the Virtual Environment:
venv\Scripts\activate
-
Run the Application:
streamlit run src\main.py
-
Terminate the Application:
Control + C
-
Exit the Virtual Environment:
deactivate
The filter rule used in the application is as follows:
- Data entries without superclass, subclass, type, and description will be excluded from the visualization.
This ensures that the visualized data maintains its integrity and relevance for exploring relationships within the ISO 15926-4 standard.
data/
├── filtered_out_data.jason # Data including invalid nodes
└── final_output.json # Data source file
docs/
├── demos # Previous code
├── materials/ # Unit materials
└── meeting_minutes/ # Recordings for each meeting.
scripts/
├── data_retrieve.py # Script to update dataset from online source.
└── plugin_check.py # Script to check installed dependencies
src/
├── main.py # Main application entry point
├── layout.py # Functions related to layout and styling
├── data_handler.py # Data loading functions
├── networkx_plot.py # NetworkX plot visualization functions
└── d3js_plot.py # D3.js plot visualization functions
static/
└── images/
└── nlp-tlp-logo.png
tests/
├── driverpath.py # Driver path for testing
├── test_comp_view.py # Test the comparative view
└── test.py # Test other functions
requirements.txt # List of dependencies
README.md
To use the interactive visualization tool:
- Run the application using the Streamlit command provided above.
- Navigate between visualizations:
- NetworkX Plot: Visualize relationships using NetworkX. Click on nodes to display definitions in the sidebar. Hover over nodes to see tooltips.
- D3.js Plot: Explore hierarchical data relationships using a D3.js tree visualization.
- Search and Filter Options:
- Use the sidebar to search for specific nodes and adjust the number of parent and child levels displayed in the visualization.
- Search History:
- The search history is displayed in the sidebar.
- Click on a history item to restore the previous search state.
- Implemented Functions:
- Click on a node: When you click on a node, its 'Definition' and 'Type' are displayed in the sidebar.
- Mouse hover on a node: Hovering over a node displays a floating window with the node's 'Definition' over it.
- Fullscreen mode: Click the "Fullscreen" button to enable the fullscreen view of the model. Press "Esc" to exit fullscreen mode.
- Enable Comparative Analysis:
- Use the
Enable Comparative
button to enable the comparative analysis mode. - Select two nodes to compare their hierarchical relationships.
- The nodes are highlighted in the graph for easy comparison.
- Use the
DEMO : https://youtu.be/y0_YqlkHXQc
main.py
: The entry point of the application that initializes the Streamlit app and coordinates between different modules.layout.py
: Contains functions to set up the layout and styling of the Streamlit interface.data_handler.py
: Handles loading and processing of data from JSON files.networkx_plot.py
: Contains the logic for handling user interactions for NetworkX plot.d3js_plot.py
: Manages the D3.js plot data preparation and rendering.
If the app does not run or you encounter issues, please follow these troubleshooting steps:
-
Ensure the Virtual Environment is Activated: If the dependencies are not recognized, make sure the virtual environment is activated by using the activation command mentioned above.
-
Check for Dependency Issues: Run the plugin check script to verify if all dependencies are installed:
python3 scripts/plugin_check.py
-
Reinstall Dependencies: If any dependency is missing, you can install them individually using
pip install <dependency-name>
.
Before running the test scripts, please complete the following steps:
-
Download and Configure Chromedriver:
-
Download the appropriate version of Chromedriver based on your Chrome browser version.
-
Update the
driver_path
variable intests/driverpath.py
with the absolute path to the Chromedriver. -
Example:
driver_path = "C:/Users/XXXX/Downloads/chromedriver-win64/chromedriver.exe"
-
-
Set Application Port:
- The application port must be fixed to ensure the tests run correctly.
- Use the following command to start the application on a specific port (e.g., 8501):
streamlit run src/main.py --server.port 8501
-
Run the test scripts
pytest tests/test.py pytest tests/test_comp_view.py
We welcome contributions to enhance the functionality and usability of this tool. To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b branch_name
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin branch_name
). - Create a new Pull Request.
©2024 , Made For "UWA NLP-TLP Group", Designed and Developed by Manish Varada Reddy, Melo Xue, Shanmugapriya Sankarraj, Xudong Ying, Yu Xia, Zihan Zhang.