Skip to main content

Dracula dark/light theme for Plotly Dash applications

Project description

Dracula for Dash

A dark theme for Plotly Dash — pip-installable Python package that gives any Dash application the full Dracula colour experience, including a light-mode toggle and always-light PDF export.

Dark mode Light mode
Dark mode Light mode

Install

All instructions can be found at INSTALL.md.

Features

  • Dark mode — full Dracula palette applied via CSS variables and a custom Plotly template
  • Light mode toggle — single button switches the entire dashboard; all Plotly graphs re-colour automatically via a clientside callback
  • PDF exportfig_to_print_image() always produces print-ready figures on a white background, regardless of the current dashboard theme
  • Official palette — all 11 Dracula colours exposed as named Python constants (BACKGROUND, CYAN, PURPLE, …)

Quick start

import dash
import dash_bootstrap_components as dbc
import dash_dracula as dr

# 1. Create the app with Bootstrap DARKLY as base
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])

# 2. Wire the Dracula theme (copies CSS, registers clientside toggle)
theme_store = dr.apply_theme(app)          # returns dcc.Store for the layout

# 3. Use Dracula colours and template in your figures
fig = go.Figure(layout=dict(template="dracula"))
fig.add_scatter(y=[1, 2, 3], line_color=dr.CYAN)

# 4. Export a figure to a print-ready ReportLab Image (always light)
from dash_dracula.pdf import fig_to_print_image
img = fig_to_print_image(fig, w_mm=170, h_mm=100)

See sample/app.py for a complete minimal example.

Team

This theme is maintained by the following person(s) and a bunch of awesome contributors.

hjeverts

Community

  • GitHub — Best for asking questions and discussing issues.
  • Discord — Best for hanging out with the community.

License

MIT License

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_dracula_theme-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

dash_dracula_theme-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file dash_dracula_theme-0.1.0.tar.gz.

File metadata

  • Download URL: dash_dracula_theme-0.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dash_dracula_theme-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df2b165adc5fab26cca057b6b1cb1bd45d04e89a64c80fb8cc386daca388386b
MD5 0957aa1f293b5016eeee166117337d5f
BLAKE2b-256 0d9d7f1ca13b0d6a47949ae9b04859a0ccb93678ed86983c26620de2b76c33e8

See more details on using hashes here.

File details

Details for the file dash_dracula_theme-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dash_dracula_theme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd6b95d9047e079991bd7e7164314c850bf21417ee64424979a03464cf9016be
MD5 e875429d1b63e7e9628e9132bf9fd685
BLAKE2b-256 c6f5a9bbd394dba6003454e1e60f7b6abcf471f5a2013b0aaeb375ec4102593f

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