Registry / web-framework / streamlit-plotly-events

streamlit-plotly-events

JSON →
library0.0.6pypypiunverified

A Streamlit component that wraps Plotly charts and enables capturing events (e.g., click, hover, select) from the chart and passing them back to Streamlit for reactive updates. Version 0.0.6 requires Python >=3.6, currently in early/experimental stage with infrequent releases.

pip install streamlit-plotly-events
INSTALL
IMPORT
SIG · STREAMLIT-PLOTLY-E
S
streamlit-plotly-events
web-frameworkpythonv0.0.6
Install
18.4s avg
Import
Disk
554MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 564.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 18.4s · import 0.000s · 533MB
554MB installed
● package 554MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plotly_chart
from streamlit_plotly_events import plotly_chart
from streamlit_plotly_events import plotly_events
Function name is 'plotly_chart', not 'plotly_events'. Many users mistakenly copy the module name.

Minimal example: render a scatter plot and capture click events. Returns list of dicts with point and curve info.

import streamlit as st import plotly.graph_objects as go from streamlit_plotly_events import plotly_chart fig = go.Figure(data=[go.Scatter(x=[1,2,3], y=[4,5,6], mode='markers')]) selected_points = plotly_chart(fig, click_event=True, hover_event=False, select_event=False) if selected_points: st.write(selected_points)
Debug
Known issues
gotchaEvent arguments (click_event, hover_event, select_event) must be passed as keyword arguments; they are not positional.
fix
Always use keyword arguments: plotly_chart(fig, click_event=True)
affects: all
gotchaThe component returns None when no event has occurred. Always check for None before iterating.
fix
if selected_points: st.write(selected_points) to avoid AttributeError
affects: all
gotchaThe library does not support all Plotly chart types; complex layouts or subplots may cause silent failures or errors.
fix
Stick to simple, single-trace figures. Test thoroughly.
affects: all
breakingVersion 0.0.5 removed the old 'streamlit-plotly-events' import path; use 'streamlit_plotly_events' (underscore).
fix
Replace 'import streamlit_plotly_events' (with hyphens) with 'from streamlit_plotly_events import plotly_chart'.
affects: >=0.0.5
deprecatedThe 'start_event' and 'end_event' parameters were deprecated in 0.0.4 and removed in 0.0.5.
fix
Use click_event, hover_event, select_event instead.
affects: >=0.0.5
Upgrade
Version history
0.0.6latest on PyPI · released Apr 26, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
streamlit-plotly-events — pip install streamlit-plotly-events · libregistry