Streamlit component that wraps visjs
Project description
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)
Supports all vis.js types:
- network
- timeline
- graph3d
Donate
If you like this project and want to support it, please consider donating.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
visjs-component-0.1.1.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for visjs_component-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8375f17d68f1d85325c5a9d318d012b6135808263a438985b621b6956ae5851 |
|
MD5 | 955d0e6e8996c111f0bc3798a020d69d |
|
BLAKE2b-256 | bc44b8ae405f13aac59fffcd7beff38856ff8335be642226b34fc711307e441c |