Streamlit visjs component
Streamlit component that wraps vis.js.
Installation instructions
pip install visjs-component
Usage instructions
import streamlit as st
from visjs_component import visjs
data = {
"nodes": [
{"id": 1, "label": "Node 1"},
{"id": 2, "label": "Node 2"},
{"id": 3, "label": "Node 3"},
{"id": 4, "label": "Node 4"},
{"id": 5, "label": "Node 5"},
],
"edges": [
{"from": 1, "to": 3},
{"from": 1, "to": 2},
{"from": 2, "to": 4},
{"from": 2, "to": 5},
],
"options": {
"nodes": {
"shape": "dot",
"size": 16,
},
"edges": {
"color": "#000000",
},
"physics": {
"enabled": True,
},
"interaction": {
"hover": True,
},
"height": "500px",
},
}
eventHandlers = [
{
"event": "click",
"callback": lambda eventData: st.json(
eventData['data']
),
}
]
visjs(title="# Network Vis", type="network", data=data, eventHandlers=eventHandlers, key="my_network_id")
Supports all vis.js types:
- network
- timeline
- graph3d
Change Log
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[0.2.0] - 2024-05-27
Added
- New
combined.pyexample with the 3 types of visualisations - Support for multiple instances by adding a
keyparameter as shown below
visjs(title="# Network Vis", type="network", data=data, eventHandlers=eventHandlers, key="your_unique_key")
Changed
titleproperty is now optional.
Donate
If you like this project and want to support it, please consider donating.
Metadata
Release files for visjs-component 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| visjs_component-0.2.0.tar.gz | 5.6 kB | Without provenance | Details for visjs_component-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| visjs_component-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for visjs_component-0.2.0-py3-none-any.whl |
Total release size: 12.2 kB
Release files / visjs_component-0.2.0.tar.gz
| Download URL | visjs_component-0.2.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dc02a37e9c87cd9ae6766ec5c86ab6699d25b9027b1d38ef7eb17b1f5ce6b1f7
|
|
BLAKE2b-256 checksum How to use checksums |
6fcc4a0e6221f209d7f08ab448f26c614c36c0bacdac3c6d4da16e7739c3cfe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / visjs_component-0.2.0-py3-none-any.whl
| Download URL | visjs_component-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7800b910d349db5d7b7fdfae7c8fc12b74d399c9c9f8a946f6809b1b627b11fa
|
|
BLAKE2b-256 checksum How to use checksums |
c204b9e2e82309875ed677eb45ce364e61e9e611d3aaa951aad569c6d091622b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Security for visjs-component 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.