dash-dracula-theme 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hjeverts-VSM
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: dash-dracula-theme
3
+ Version: 0.1.0
4
+ Summary: Dracula dark/light theme for Plotly Dash applications
5
+ Author: hjeverts-VSM
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 hjeverts-VSM
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Requires-Python: >=3.9
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENSE
31
+ Requires-Dist: dash>=4.0
32
+ Requires-Dist: plotly>=5.0
33
+ Requires-Dist: dash-bootstrap-components>=2.0
34
+ Provides-Extra: pdf
35
+ Requires-Dist: reportlab>=4.0; extra == "pdf"
36
+ Requires-Dist: kaleido>=0.2; extra == "pdf"
37
+ Dynamic: license-file
38
+
39
+ # Dracula for [Dash](https://dash.plotly.com/)
40
+
41
+ > A dark theme for [Plotly Dash](https://dash.plotly.com/) — pip-installable Python package
42
+ > that gives any Dash application the full Dracula colour experience, including a light-mode
43
+ > toggle and always-light PDF export.
44
+
45
+ | Dark mode | Light mode |
46
+ |---|---|
47
+ | ![Dark mode](screenshot_dark.png) | ![Light mode](screenshot_light.png) |
48
+
49
+ ## Install
50
+
51
+ All instructions can be found at [INSTALL.md](INSTALL.md).
52
+
53
+ ## Features
54
+
55
+ - **Dark mode** — full Dracula palette applied via CSS variables and a custom Plotly template
56
+ - **Light mode toggle** — single button switches the entire dashboard; all Plotly graphs
57
+ re-colour automatically via a clientside callback
58
+ - **PDF export** — `fig_to_print_image()` always produces print-ready figures on a white
59
+ background, regardless of the current dashboard theme
60
+ - **Official palette** — all 11 Dracula colours exposed as named Python constants
61
+ (`BACKGROUND`, `CYAN`, `PURPLE`, …)
62
+
63
+ ## Quick start
64
+
65
+ ```python
66
+ import dash
67
+ import dash_bootstrap_components as dbc
68
+ import dash_dracula as dr
69
+
70
+ # 1. Create the app with Bootstrap DARKLY as base
71
+ app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
72
+
73
+ # 2. Wire the Dracula theme (copies CSS, registers clientside toggle)
74
+ theme_store = dr.apply_theme(app) # returns dcc.Store for the layout
75
+
76
+ # 3. Use Dracula colours and template in your figures
77
+ fig = go.Figure(layout=dict(template="dracula"))
78
+ fig.add_scatter(y=[1, 2, 3], line_color=dr.CYAN)
79
+
80
+ # 4. Export a figure to a print-ready ReportLab Image (always light)
81
+ from dash_dracula.pdf import fig_to_print_image
82
+ img = fig_to_print_image(fig, w_mm=170, h_mm=100)
83
+ ```
84
+
85
+ See [sample/app.py](sample/app.py) for a complete minimal example.
86
+
87
+ ## Team
88
+
89
+ This theme is maintained by the following person(s) and a bunch of
90
+ [awesome contributors](https://github.com/dracula/dash/graphs/contributors).
91
+
92
+ | [hjeverts](https://github.com/hjeverts) |
93
+ |---|
94
+
95
+ ## Community
96
+
97
+ - [GitHub](https://github.com/dracula/dracula-theme/discussions) — Best for asking questions and discussing issues.
98
+ - [Discord](https://draculatheme.com/discord-invite) — Best for hanging out with the community.
99
+
100
+ ## License
101
+
102
+ [MIT License](LICENSE)
@@ -0,0 +1,64 @@
1
+ # Dracula for [Dash](https://dash.plotly.com/)
2
+
3
+ > A dark theme for [Plotly Dash](https://dash.plotly.com/) — pip-installable Python package
4
+ > that gives any Dash application the full Dracula colour experience, including a light-mode
5
+ > toggle and always-light PDF export.
6
+
7
+ | Dark mode | Light mode |
8
+ |---|---|
9
+ | ![Dark mode](screenshot_dark.png) | ![Light mode](screenshot_light.png) |
10
+
11
+ ## Install
12
+
13
+ All instructions can be found at [INSTALL.md](INSTALL.md).
14
+
15
+ ## Features
16
+
17
+ - **Dark mode** — full Dracula palette applied via CSS variables and a custom Plotly template
18
+ - **Light mode toggle** — single button switches the entire dashboard; all Plotly graphs
19
+ re-colour automatically via a clientside callback
20
+ - **PDF export** — `fig_to_print_image()` always produces print-ready figures on a white
21
+ background, regardless of the current dashboard theme
22
+ - **Official palette** — all 11 Dracula colours exposed as named Python constants
23
+ (`BACKGROUND`, `CYAN`, `PURPLE`, …)
24
+
25
+ ## Quick start
26
+
27
+ ```python
28
+ import dash
29
+ import dash_bootstrap_components as dbc
30
+ import dash_dracula as dr
31
+
32
+ # 1. Create the app with Bootstrap DARKLY as base
33
+ app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
34
+
35
+ # 2. Wire the Dracula theme (copies CSS, registers clientside toggle)
36
+ theme_store = dr.apply_theme(app) # returns dcc.Store for the layout
37
+
38
+ # 3. Use Dracula colours and template in your figures
39
+ fig = go.Figure(layout=dict(template="dracula"))
40
+ fig.add_scatter(y=[1, 2, 3], line_color=dr.CYAN)
41
+
42
+ # 4. Export a figure to a print-ready ReportLab Image (always light)
43
+ from dash_dracula.pdf import fig_to_print_image
44
+ img = fig_to_print_image(fig, w_mm=170, h_mm=100)
45
+ ```
46
+
47
+ See [sample/app.py](sample/app.py) for a complete minimal example.
48
+
49
+ ## Team
50
+
51
+ This theme is maintained by the following person(s) and a bunch of
52
+ [awesome contributors](https://github.com/dracula/dash/graphs/contributors).
53
+
54
+ | [hjeverts](https://github.com/hjeverts) |
55
+ |---|
56
+
57
+ ## Community
58
+
59
+ - [GitHub](https://github.com/dracula/dracula-theme/discussions) — Best for asking questions and discussing issues.
60
+ - [Discord](https://draculatheme.com/discord-invite) — Best for hanging out with the community.
61
+
62
+ ## License
63
+
64
+ [MIT License](LICENSE)
@@ -0,0 +1,72 @@
1
+ """
2
+ dash_dracula
3
+ ~~~~~~~~~~~~
4
+ Dracula dark/light theme for Plotly Dash applications.
5
+
6
+ Quick start::
7
+
8
+ import dash
9
+ import dash_bootstrap_components as dbc
10
+ import dash_dracula as dr
11
+
12
+ app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
13
+ theme_store = dr.apply_theme(app) # wire CSS + toggle callback
14
+
15
+ # In your layout:
16
+ # dr.theme_toggle_button() — the ☀️/🌙 button component
17
+ # theme_store — dcc.Store that must be in the layout
18
+
19
+ # In your figures:
20
+ # template="dracula" — auto-registered on import
21
+ # line_color=dr.CYAN — use palette constants directly
22
+
23
+ # For PDF export (always light):
24
+ # from dash_dracula.pdf import fig_to_print_image
25
+ # img = fig_to_print_image(fig, w_mm=170, h_mm=100)
26
+ """
27
+
28
+ # ── Auto-register the Plotly template on import ──────────────────────────────
29
+ from .plotly_template import register as _register, TEMPLATE_NAME
30
+
31
+ _register()
32
+
33
+ # ── Colour palette ───────────────────────────────────────────────────────────
34
+ from .colors import (
35
+ BACKGROUND,
36
+ CURRENT_LINE,
37
+ SELECTION,
38
+ FOREGROUND,
39
+ COMMENT,
40
+ RED,
41
+ ORANGE,
42
+ YELLOW,
43
+ GREEN,
44
+ CYAN,
45
+ PURPLE,
46
+ PINK,
47
+ COLORWAY,
48
+ NEUTRAL_COLORWAY,
49
+ PRINT_COLORS,
50
+ LIGHT_COLORS,
51
+ AS_DICT as PALETTE,
52
+ )
53
+
54
+ # ── Bootstrap / theme wiring ─────────────────────────────────────────────────
55
+ from .bootstrap import apply_theme, theme_toggle_button
56
+
57
+ # ── PDF utility (lazy — reportlab not required for basic theme usage) ─────────
58
+ from .pdf import fig_to_print_image
59
+
60
+ __all__ = [
61
+ # Template
62
+ "TEMPLATE_NAME",
63
+ # Official palette
64
+ "BACKGROUND", "CURRENT_LINE", "SELECTION", "FOREGROUND", "COMMENT",
65
+ "RED", "ORANGE", "YELLOW", "GREEN", "CYAN", "PURPLE", "PINK",
66
+ # Convenience collections
67
+ "COLORWAY", "NEUTRAL_COLORWAY", "PRINT_COLORS", "LIGHT_COLORS", "PALETTE",
68
+ # Bootstrap helpers
69
+ "apply_theme", "theme_toggle_button",
70
+ # PDF
71
+ "fig_to_print_image",
72
+ ]