Plot your dataframe with reflex!
Project description
reflex-plot
Seamlessly plot dataframes in Reflex just like you would do with Matplotlib.
You can import plot from reflex_plot to get a Rechart component.
import random
from typing import Literal
import pandas as pd
import reflex as rx
from reflex_plot import plot
def plot_data(kind: Literal["line", "area", "bar"]) -> rx.Component:
df = pd.DataFrame(
{
"category": list(range(20)),
"value": [random.randint(0, 1000) for _ in range(20)],
}
)
return plot(
df,
kind=kind,
x="category",
y="value",
grid=True,
tool_tip=True,
)
Pandas plotting backend
You can also set reflex_plot as the default backend for pandas and use DataFrame.plot as you would do with Matplotlib
pd.set_option("plotting.backend", "reflex_plot")
def plot_data(kind: Literal["line", "area", "bar"]) -> rx.Component:
df = pd.DataFrame(
{
"category": list(range(20)),
"value": [random.randint(0, 1000) for _ in range(20)],
}
)
return df.plot(
kind=kind,
x="category",
y="value",
grid=True,
tool_tip=True,
)
How to install
pip install reflex-plot
Charts type covered
- Line
- Area
- Bar
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reflex_plot-0.1.0.tar.gz.
File metadata
- Download URL: reflex_plot-0.1.0.tar.gz
- Upload date:
- Size: 232.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35419e56f10098d4213b73cf8738095c477e124614c4ac3d0064085911405ed6
|
|
| MD5 |
def55778140762b4145b35db4a3429a6
|
|
| BLAKE2b-256 |
c4d83ca6cb6b60a506ffa83252744469284390530b409156e96e2d09d002d6d3
|
File details
Details for the file reflex_plot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: reflex_plot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2acb16aaf2c42232fb837aba378c189d127f56ade5aad23abee22d0001820480
|
|
| MD5 |
8062b2d09565af6f9de4eeb6ba1087b3
|
|
| BLAKE2b-256 |
d198a0d87b23267d6be2268874b0d80fa9bae036f929224bdd54913414b9ea2f
|