Skip to main content

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

dash_customizable_app_style-0.0.7.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

dash_customizable_app_style-0.0.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file dash_customizable_app_style-0.0.7.tar.gz.

File metadata

File hashes

Hashes for dash_customizable_app_style-0.0.7.tar.gz
Algorithm Hash digest
SHA256 747bc6d3db2f6f6039d97a5481f80623bcd7ba3a5094657581045bd581656c52
MD5 c18496f4fd4a07bf17af79136901c1bc
BLAKE2b-256 8b08ed6562985a3fa98c75465f3d64da0145ab7648871dfefa69f690df892976

See more details on using hashes here.

File details

Details for the file dash_customizable_app_style-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for dash_customizable_app_style-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1faffee039359649eb3a9bfde08c64caf0f6dc407d5ec22bf3a633b854ed4cab
MD5 e4fdb767d254a2df58a0e05cee57e8a8
BLAKE2b-256 31195a67ad9d67c5b0f6eb3790a6dffc260e1e26d32adac29a77595244e26b29

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