Skip to main content

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 data
  • layout_kwargs (dict): Keyword arguments passed to plotly.layout - optional
  • px_kwargs (dict): Keyword arguments passed to plotly.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 data
  • layout_kwargs (dict): Keyword arguments passed to plotly.layout - optional
  • px_kwargs (dict): Keyword arguments passed to plotly.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sameh-stirling-0.0.6.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sameh_stirling-0.0.6-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file sameh-stirling-0.0.6.tar.gz.

File metadata

  • Download URL: sameh-stirling-0.0.6.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sameh-stirling-0.0.6.tar.gz
Algorithm Hash digest
SHA256 9cf28b1692dce09d28b6865fba7702be2cdd5db55fb473d93c4042512f30ca59
MD5 81a7f605ba202836dc9a464bc629882c
BLAKE2b-256 85561a872b1a70d1316ce867f684c72db066d7fc5019351da111906bd3213cb9

See more details on using hashes here.

File details

Details for the file sameh_stirling-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: sameh_stirling-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for sameh_stirling-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 50fa4c43eaf72f1b82246bae71c8201e4c8e100e10f84e626de97e986a94c536
MD5 fdfe8b491ec959c302da4584a66dfe1a
BLAKE2b-256 66ab3bc2ca813c874bfc6540754d58cd3e06514397c2d0e47ab3c304575c532f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page