• This repository has been archived on 20/Mar/2022
  • Stars
    star
    150
  • Rank 242,558 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A streamlit component for bi-directional communication with bokeh plots.

NOTE

Due to some personal issues I am unable to maintain the project for quite a while. I am archiving this project and there wont be further updates in it. Thanks to those who used the package.

Streamlit Bokeh Events

A streamlit component for bi-directional communication with bokeh plots.

Its just a workaround till streamlit team releases support for bi-directional communication with plots.

Demo

Plots

demo

Widgets

Data Tables

demo2

Color Picker

demo3

Run Any Custom JS

demo4

Get data from Clipboard

demo5

Installation

pip install streamlit-bokeh-events

Usage

import streamlit as st
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, CustomJS

# import function
from streamlit_bokeh_events import streamlit_bokeh_events

# create plot
p = figure(tools="lasso_select")
cds = ColumnDataSource(
    data={
        "x": [1, 2, 3, 4],
        "y": [4, 5, 6, 7],
    }
)
p.circle("x", "y", source=cds)

# define events
cds.selected.js_on_change(
    "indices",
    CustomJS(
        args=dict(source=cds),
        code="""
        document.dispatchEvent(
            new CustomEvent("YOUR_EVENT_NAME", {detail: {your_data: "goes-here"}})
        )
        """
    )
)

# result will be a dict of {event_name: event.detail}
# events by default is "", in case of more than one events pass it as a comma separated values
# event1,event2 
# debounce is in ms
# refresh_on_update should be set to False only if we dont want to update datasource at runtime
# override_height overrides the viewport height
result = streamlit_bokeh_events(
        bokeh_plot=p,
        events="YOUR_EVENT_NAME",
        key="foo",
        refresh_on_update=False,
        override_height=600,
        debounce_time=500)

# use the result
st.write(result)

More Repositories

1

streamlit-stream

A template for creating streamlit apps that consume streaming data
Python
104
star
2

streamlit-heroku

Dockerizing streamlit application and deploying it on heroku.
Python
84
star
3

Python101-ABESIT

An introductory course to Python @ ABES Institute of Technology, Ghaziabad
Python
28
star
4

streamlit-stream-stonks

An extended example of streaming application in streamlit of a Stocks Monitoring Dashboard.
Python
12
star
5

Projects-and-Related-Technologies

A crash course on technologies related to project related technologies. A followup after Python101.
Python
11
star
6

RailIN

Unofficial API for Indian Railways.
Python
6
star
7

Data-centric-application-Development

Session content for talk delivered in ABES on data centric application development.
TypeScript
5
star
8

TicTacToe

A simplistic anonymous multiplayer Tic Tac Toe using python for backend and jquery for frontend.
Python
4
star
9

GIS_API

A REST API based on indexing of pincodes, nearby pincodes, and geofencing based information.
Python
2
star
10

GenerateInvoice

An invoice generator template like application made with Django and materializecss, with login and regeneration capabilities.
Python
2
star
11

String-Match-API

String Matching API for plagiarism check using cosine similarity and vector space models.
Python
2
star
12

BreastCancer_Classification

A comparative analysis of best Classification method for Winsconsin Breast Cancer Data.
Python
2
star
13

PythonFunctionCalling

A descriptive analysis of function calls in python.
Jupyter Notebook
2
star
14

HeartDiseaseDataAnalysis

An analysis of Heart Disease Data using KNearest Neighbors and PSO to optimize n_nearest.
Python
2
star
15

YTSearch

Youtube Data API wrapper for retreving channel's videos and their related videos.
Python
2
star
16

Fibonacci-Series-Comparision

A time comparison of various methods used for creating fibonacci series.
Python
2
star
17

PyZIPIN

A python 3 library providing information of ZIP codes of India based on data from data.gov.in(2018)
Python
2
star
18

Basics-of-machine-learning

Content for webinar delivered at RKGIT on 24-06-2020.
Jupyter Notebook
1
star
19

TouRail

Virtual Tour of Railway Station App.
TypeScript
1
star
20

OpenCA

A tool based on pyOpenSSL to easily create and manage Certification Authorities.
Python
1
star
21

etoll

JavaScript
1
star
22

Jupyter-draw

A jupyter extension to enable drawing in output cell.
JavaScript
1
star
23

VRAHAD

Python
1
star
24

Alphabet_matching_using_SVM

Alphabets matching using SVM using Sklearn on UCI Letter Image Recognition Data
Python
1
star
25

Spacy_States_and_District_Matcher_Patterns_for_India

1
star
26

SimpleHTTPServer

A Simple HTTP Server Written in Java to understand how HTTP works.
Java
1
star
27

moodleDown

A batch downloader for moodle, Downloads all notes and other material subject wise and puts them in correspoding unit wise folders.
Python
1
star
28

Bitfinex-Notifications

A socket based approach for setting and emitting notifications in real-time.
Python
1
star
29

NirAadhaar

An implementation of the Aadhaar API v1.6 in Python for local usage.
Python
1
star
30

Do-SMS

Do SMS is a Simple Flutter App to send SMS from a mobile based on HTTP Requests.
Dart
1
star
31

QnA

A Simple MERN app for QnA.
JavaScript
1
star
32

FlipkartNLP

Gives better rating of Flipkart products using normalized bag-of-words sentimental analysis of Reviews and incorporating star-ratings.
Python
1
star