Skip to main content

Easy-to-use data visualization framework

Project description

Dashy

A small framework built on top of Plotly Dash and Dash Bootstrap Components intended to make it easy and quick to build dashboards without having to think about all the small details.

GitHub Workflow Status PyPI PyPI - Python Version GitHub

How To Use | Key Features | Future | Credits | License

Install

pip install dash-dashy

Key Features

Simpler callbacks

Dash callbacks usually looks like

@app.callback(
  Output('container', 'children'),
  Input('btn-1', 'n_clicks'),
  Input('btn-2', 'n_clicks'),
  Input('btn-3', 'n_clicks'),
  State('dropdown', 'value'))
def some_callback_func(...):
  ...

In order to make callbacks less verbose Dashy apps has its own callback decorator using only list and tuples as arguments. The example above reduces to

@app.cb(
  inputs=[('btn-1', 'n_clicks'), ('btn-2', 'n_clicks'), ('btn-3', 'n_clicks')],
  outputs=('container', 'children'),
  states=('dropdown', 'value'))
def some_callback_func(...):
  ...

Dashy also assume an implicit order of the decorator arguments which is, inputs -> outputs -> states. This is handy for simple callbacks like

# callback taking buttons clicks as input and outputs 'children' to 'container'
@app.cb(('btn-1', 'n_clicks'), ('container', 'children'))
def some_callback_func(...):
  ...

Dashy callbacks also does not require an explicit output.

# do something when the button is clicked
@app.cb(('btn-1', 'n_clicks'))
def some_callback_func(...):
  ...

High level function components

All components in Dashy are functions, import what you need or everything

# import individual components
from dashy.components import navbar, button, graph, dropdown
# or
import dashy.components as dc

Layout

Dashy utilizes bootstrap's grid system and tries to handle as much of the layout as possible while still making the dashboards look good. Import the container row and col components and build your layout.

from dashy.components import container, row, col

layout = container([
  row([
    # your components
  ]),
  col([
    # more components
  ])
])

Complete app example

Building an app with a navbar, tabs and a callback to switch tabs becomes

from dashy import create_app
from dashy.components import navbar, tabs, div


app = create_app(__name__, layout=[
    navbar('My App', dark=True),
    tabs(id='tabs', labels=['Tab1', 'Tab2', 'Tab3'], content_id='tab-content')
])


@app.cb(('tabs', 'active_tab'), ('tab-content', 'children'))
def switch_tabs(tab_id: str):
    return div(f'Hello from {tab_id}')


if __name__ == "__main__":
    app.launch()

Future

  • Integrate all components with bootstrap themes
  • Dashboard templates

Credits

This software uses the following awesome open source packages:

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

dash-dashy-0.0.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

dash_dashy-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file dash-dashy-0.0.2.tar.gz.

File metadata

  • Download URL: dash-dashy-0.0.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for dash-dashy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e2188e9b4db894b89254f1cd49848d097ead259f359933aa83365818ced7ce46
MD5 1ea424c3ac2cf0983e562a44fb32e491
BLAKE2b-256 c22488f67a25b9e47b4bf6b5820e71071238b604bba43ef6c01e6e01416d5824

See more details on using hashes here.

File details

Details for the file dash_dashy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dash_dashy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.2

File hashes

Hashes for dash_dashy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 70d7be0650c5a68dccd90b7e4b324b56be2d6e40aadeb4e45769063a059cbb6a
MD5 953d25ac9be93737466b31fa063a7f1a
BLAKE2b-256 b4e3aa8e10729a2c86d24b031c78910b2975f5d7dddd314027c40a657c52fb8f

See more details on using hashes here.

Supported by

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