Registry / analytics / reflex-components-plotly

reflex-components-plotly

JSON →
library0.9.2pypypi✓ verified 86d ago

A Reflex library that wraps Plotly for declarative, reactive plotting in Reflex web apps. Current version 0.9.2, requires Python >=3.10. Follows Reflex's component pattern but Plotly-specific footguns (e.g., figure reuse, serialization) are common.

pip install reflex-components-plotly
INSTALL
IMPORT
SIG · REFLEX-COMPONENTS-
R
reflex-components-plotly
analyticspythonv0.9.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Plotly
from reflex_components_plotly import Plotly
from reflex_plotly import Plotly
The correct package suffix is _components_plotly, not _plotly.
ReflexPlotly
import reflex_components_plotly as ...
Common but incorrect; the top-level symbol is Plotly.

Creates a Reflex app with a Plotly scatter plot. Note: use fig.to_dict() not fig directly.

import reflex as rx from reflex_components_plotly import Plotly import plotly.express as px df = px.data.iris() fig = px.scatter(df, x='sepal_width', y='sepal_length', color='species') class State(rx.State): pass def index() -> rx.Component: return Plotly.create(data=fig.to_dict()) app = rx.App() app.add_page(index) app.compile()
Debug
Known issues
gotchaPassing a raw Plotly figure object (not dict) may cause serialization errors.
fix
Use fig.to_dict() before passing to Plotly.create().
affects: all
gotchaDo not mutate the figure after passing to Plotly.create() – changes won't reflect. Use State-driven to_dict() updates.
fix
Always recreate the dict in a state event handler.
affects: all
deprecatedPlotly component may conflict with Reflex's built-in plotly integration (rx.plotly) in newer versions.
fix
Prefer rx.plotly if available, or pin reflex to <0.6.0.
affects: reflex >=0.6.0
Errors
Common errors & fixes
ReflexError: Plotly component requires a 'data' prop of type dict
Passed a Plotly Figure object instead of a dictionary.
fix
Pass fig.to_dict() instead of fig.
ImportError: cannot import name 'Plotly' from 'reflex_plotly'
Wrong import path.
fix
Use: from reflex_components_plotly import Plotly
TypeError: Object of type Figure is not JSON serializable
Trying to pass a Plotly Figure directly through Reflex state or to the component.
fix
Serialize to dict with fig.to_dict() before passing to Plotly.create() or storing in state.
Upgrade
Version history
0.9.2latest on PyPI · released May 23, 2026
Audit
Dependencies
reflexrequiredBase framework; this library is a Reflex component
plotlyrequiredCore dependency for creating figures
Agent activity
49 hits · last 30 days
node
46
Bingbot
1
OpenAI (training)
1
Resources

No resource links recorded.

reflex-components-plotly — pip install reflex-components-plotly · libregistry