Giter Club home page Giter Club logo

streamlit-timeline's Introduction

streamlit-timeline-demo

image image Open in Streamlit

Streamlit component for rendering vis.js timeline with bidirectional communication.

Check out the GitHub repositories streamlit-timeline and streamlit-timeline-demo. For JavaScript examples, check out the vis.js timeline examples and documentation.

Installation

pip install streamlit-vis-timeline

Usage

import streamlit as st
from streamlit_timeline import st_timeline

st.set_page_config(layout="wide")

items = [
    {"id": 1, "content": "2022-10-20", "start": "2022-10-20"},
    {"id": 2, "content": "2022-10-09", "start": "2022-10-09"},
    {"id": 3, "content": "2022-10-18", "start": "2022-10-18"},
    {"id": 4, "content": "2022-10-16", "start": "2022-10-16"},
    {"id": 5, "content": "2022-10-25", "start": "2022-10-25"},
    {"id": 6, "content": "2022-10-27", "start": "2022-10-27"},
]

timeline = st_timeline(items, groups=[], options={}, height="300px")
st.subheader("Selected item")
st.write(timeline)

Demo

streamlit-timeline's People

Contributors

giswqs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

streamlit-timeline's Issues

Question

Hey @giswqs ,

really cool component. Quick question:
Could one combine the timeline with a linechart. So instead of having boxes
one would have just a linechart? So i could also have along the y-axis groups
and for each group i would get a linechart in the x-axis along the time?

Frontend build files don't exist

Hi @giswqs,

it looks like the newest version of streamlit-vis-timeline on PyPI doesn't include the frontend build files.
The prior version 0.2.0 works just fine (but still includes the streamlit st.cache deprecation warning).

Bildschirm­foto 2023-02-21 um 18 23 09

Zoom timeline to current time

Is it possible to have an argument that when passed, will zoom the timeline to specified timestamp? I have historical dating back 6 months, however, I would like to focus on the data closer to the current time while still keeping history.

Issue when trying to run script on streamlit cloud, but it runs well on local

This is my code. It works well on my local environment, but gives that error when I deploy it on streamlit cloud.

I repeatedly keep getting this error on streamlit cloud:
PermissionError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.9/site-packages/streamlit_timeline/frontend/build/index.html'

This is the full code. please help! thank you

import streamlit as st
from streamlit_timeline import st_timeline

items = [
{“id”: 1, “content”: “Event 1”, “start”: “21 Nov 2020”},
{“id”: 2, “content”: “Event 2”, “start”: “14 Dec 2020”},
{“id”: 3, “content”: “Event 3”, “start”: “1 Apr 2021”},
{“id”: 4, “content”: “Event 4”, “start”: “13 Jan 2022”},
{“id”: 5, “content”: “Event 5”, “start”: “30 April 2026”}
]

timeline = st_timeline(items, groups=, options={}, height=“300px”)

This is what i pip installed:

streamlit==1.25.0
streamlit-vis-timeline==0.3.0

Timeline does not load properly once "start" and "end" is configured in the options

With "start" and "end" you can configure the start and endpoint of the axis once the timeline is loaded for the first time. When setting these options the timeline does not load at all. The code needs to be rerun to display the timeline.

from streamlit_timeline import st_timeline

st_timeline(items=[], groups=[], options={
    "start": "2014-01-10",
    "end": "2016-01-10",
    }
)

Is there a way to suppress the JSON output?

Nice work on this component.
I have set selectable to False, but 'None' still appears under the timeline.

timeline = st_timeline(items, groups=[], options={"selectable": False}, style=None, height="200px")

Is there a way to suppress the JSON output from displaying?
Or even better, maybe getting a callback when an item is clicked so the output can be customized?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.