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.1.tar.gz (161.3 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.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dash_dracula_theme-0.1.1.tar.gz
  • Upload date:
  • Size: 161.3 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.1.tar.gz
Algorithm Hash digest
SHA256 f168f009af9183a67b80356358fe99210c0550e98acb6c4337e168a07babc361
MD5 0d8d79c2508a21206660787e2ffd787f
BLAKE2b-256 c5da66ad92179ed035e14a74517ddf3eacd6b03f8011ea674dfc4024c62caf72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dash_dracula_theme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80e234099a4d2f46747390ff2e397b076a2f66c15b74dced0ff4bbb4bd4bcc8c
MD5 89a9c0d5e435156d5354ae86c8833495
BLAKE2b-256 c0cd3a63e70f2519b2a1442f3717ea9e15612749017fc5149e41148c7b830887

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