Skip to main content

A streamlit component to visualize network graph data using Sigma.js

Project description

Streamlit Sigma.js Component

A streamlit component to visualize network graph data.

Combines Python, Streamlit, Vue3 and Sigma.js.

Key Features

  • Visualize network data
  • Interact with the graph
  • Display additional nodes & edges attributes

(screenshot)

Installation

pip installation

pip install streamlit-sigmajs-component

manual installation from source

Create and activate a python virtual environment (venv, conda, ...)

Clone this repository

git clone https://github.com/camaris2/streamlit_sigmajs_component.git

Navigate to root directory

cd streamlit_sigmajs_component

Install the package in editable mode:

pip install -e .

Using the component

In your streamlit app:

  • import the module:

from vsigma_component import vsigma_component

  • call the component

graph_state = vsigma_component(my_nodes, my_edges, my_settings, key="vsigma")

  • (optional) use the data returned via the graph state object (e.g. selected node or edge, ...)

Run Example App

  • create the environment
    • pip install virtualenv (if you don't already have virtualenv installed)
    • virtualenv venv to create your new environment (called 'venv' here)
    • source venv/bin/activate to enter the virtual environment (unix)
    • venv/bin/activate to enter the virtual environment (windows)

pip install -r requirements.txt to install the requirements in the current environment

  • run the streamlit example app:
cd streamlit_sigmajs_component/vsigma_component
streamlit run example.py

Development

  • Ensure you have Python 3.7+, Node.js, and npm installed.

Clone project

Python Setup

Create and activate a virtual environment, then install the package in editable mode:

python3 -m venv venv # On Windows use python -m venv venv
source ./venv/bin/activate # On Windows use `.\venv\Scripts\activate`
pip install -e .

Node Setup

Navigate to the frontend directory and install the necessary npm packages:

cd vsigma_component/vue_sigma
npm install

Running the App (in development mode)

Change PRODUCTION flag in vsigma_component/init.py to False

  • In one terminal start the frontend dev server
cd vsigma_component/vue_sigma
npm run dev
  • In another terminal run the streamlit server
source ./venv/bin/activate  # Unix
.\venv\Scripts\activate  # Windows
cd vsigma_component
streamlit run example.py

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_sigmajs_component-1.0.1.tar.gz (136.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_sigmajs_component-1.0.1-py3-none-any.whl (888.3 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_sigmajs_component-1.0.1.tar.gz.

File metadata

File hashes

Hashes for streamlit_sigmajs_component-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f6c5a1d7f883e69d684fe60096b87bd48b975251638f11c3a2a82202c67d6c57
MD5 242fdf689190b79b22473b9e822b291f
BLAKE2b-256 3af6589232ce0064692ed5bfb2e783b85e77e79db6411f6058f8320d58e16d93

See more details on using hashes here.

File details

Details for the file streamlit_sigmajs_component-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_sigmajs_component-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d46fc47e43aadd0ffafebf7b9080b191884b3a93ebcd6d263a3d9d2d22989be
MD5 556222ea3a8bd04bff85d76dbde9ccf4
BLAKE2b-256 da651f9c9286239ab63ca45e4195a0c001cfdc69e9afa2ff8e57955bb91bc2ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page