A library for creating Dash interactive charts
Project description
sameh_stirling
The sameh_stirling
module contains functions for creating interactive Dash charts.
Installation
pip install sameh-stirling
Usage
The module contains two chart functions:
stacked_bar
Creates an interactive stacked bar chart using Plotly Dash.
from sameh_stirling.stacked_bar import stacked_bar
import pandas as pd
data = pd.DataFrame({
"name": ["Ashley", "Ashley", "Ashley", "Patricia", "Patricia", "Patricia", "Betty", "Betty", "Betty", "Helen", "Helen", "Helen"],
"year": [1920, 1960, 2000, 1920, 1960, 2000, 1920, 1960, 2000, 1920, 1960, 2000],
"n": [2089, 17503, 17997, 6199, 47952, 7453, 22877, 11378, 880, 70621, 40471, 6909]
})
stacked_bar(data, layout_kwargs={}, px_kwargs={})
data
(DataFrame): DataFrame containing the datalayout_kwargs
(dict): Keyword arguments passed toplotly.layout
- optionalpx_kwargs
(dict): Keyword arguments passed toplotly.express
-optional
bubble_chart
Creates an interactive bubble chart using Plotly Dash.
from sameh_stirling.bubble_chart import bubble_chart
import plotly.express as px
data = px.data.gapminder()
bubble_chart(data, layout_kwargs={}, px_kwargs={})
data
(DataFrame): DataFrame containing the datalayout_kwargs
(dict): Keyword arguments passed toplotly.layout
- optionalpx_kwargs
(dict): Keyword arguments passed toplotly.express
-optional
Both functions return a Dash app that can be run with app.run_server()
.
The charts allow selecting dimensions, customizing the font, and passing keyword arguments to plotly.express
and plotly.layout
to customize the appearance.
See the source code for more details on usage and customization options.
Contributing
Contributions to add more charts are welcome! Please open an issue or PR.
License
MIT
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
Hashes for sameh_stirling-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50fa4c43eaf72f1b82246bae71c8201e4c8e100e10f84e626de97e986a94c536 |
|
MD5 | fdfe8b491ec959c302da4584a66dfe1a |
|
BLAKE2b-256 | 66ab3bc2ca813c874bfc6540754d58cd3e06514397c2d0e47ab3c304575c532f |