Customizable background color, text color and font family for Dash applications using Dash Hooks
Project description
Dash Customizable Style App Plugin Using Dash Hooks
Background color, text color and font family selectors to cusotmize your Dash apps using Dash Hooks.
Usage
from dash import html, Dash
import dash_bootstrap_components as dbc
import dash_ag_grid as dag # Imported for the example explanation
import dash_customizable_app_style as style_plugin
# Initialize the Dash app
app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
# Create the Dash App layout
app.layout = html.Div(
# Set an ID called 'main_container' to the component you want an exchangeable background color, text color and font family
id = "main_container",
children = [
# Register the app style selectors
style_plugin.customize_app_selectors(),
# To be able to also update AgGrid's background color, text color
# and font family, use a pattern-matching ID for them as following.
dag.AgGrid(id = {"type": "grid", "index": "your_grid_index"}
# Rest of AgGrid...
),
# To be able to also update Figure's background color, text color
# and font family, use a dcc.Store, dcc.Graph and a pattern-matching
# ID for them as following.
dcc.Store(id={"type": "figure-store", "index": "line"}),
dcc.Graph(id={"type": "graph", "index": "line"}),
dcc.Store(id={"type": "figure-store", "index": "histogram"}),
dcc.Graph(id={"type": "graph", "index": "histogram"})
# Rest of your app code...
])
# To update Figures from an @app.callback
@app.callback(
Output({"type": "figure-store", "index": "line"}, "data"),
Output({"type": "figure-store", "index": "histogram"}, "data"),
# Rest of your callback....
return line.to_dict(), histogram.to_dict()
Install requirements
pip install dash
pip install dash-bootstrap-components
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
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 dash_customizable_app_style-0.0.7.tar.gz.
File metadata
- Download URL: dash_customizable_app_style-0.0.7.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747bc6d3db2f6f6039d97a5481f80623bcd7ba3a5094657581045bd581656c52
|
|
| MD5 |
c18496f4fd4a07bf17af79136901c1bc
|
|
| BLAKE2b-256 |
8b08ed6562985a3fa98c75465f3d64da0145ab7648871dfefa69f690df892976
|
File details
Details for the file dash_customizable_app_style-0.0.7-py3-none-any.whl.
File metadata
- Download URL: dash_customizable_app_style-0.0.7-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1faffee039359649eb3a9bfde08c64caf0f6dc407d5ec22bf3a633b854ed4cab
|
|
| MD5 |
e4fdb767d254a2df58a0e05cee57e8a8
|
|
| BLAKE2b-256 |
31195a67ad9d67c5b0f6eb3790a6dffc260e1e26d32adac29a77595244e26b29
|