A Streamlit custom component to display a timeline
Project description
Timeline Component for Streamlit
A simple component to display a timeline in Streamlit apps. It integrates Knightlab's TimelineJS.
Installation
First install Streamlit (of course!) then pip-install this library:
pip install streamlit
pip install streamlit-timeline
Example
# Streamlit Timeline Component Example
import streamlit as st
from streamlit_timeline import timeline
# use full page width
st.set_page_config(page_title="Timeline Example", layout="wide")
# load data
with open('example.json', "r") as f:
data = f.read()
# render timeline
timeline(data, height=800)
Parameters
The timeline()
function accepts a string or a dict, as long as it's in the TimelineJS json format. The optional heigth of the visualization is in px.
Preview
You can also check the preview video or go to the demo A History of Natural Language Processing.
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
File details
Details for the file streamlit-timeline-0.0.2.tar.gz
.
File metadata
- Download URL: streamlit-timeline-0.0.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d77e418cc08211d0cbe87f21cb9b57038b1cda68c364e5a4e518496f6db955b |
|
MD5 | 06cf117c3142e2ed0a03766b2f283eb5 |
|
BLAKE2b-256 | bfdf51f1c25c0bf72f314b0e238c508011a96ee9534232b2c4edb3156a2f49d8 |