decktile 0.3.3__tar.gz → 0.3.5__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.
- {decktile-0.3.3 → decktile-0.3.5}/PKG-INFO +23 -12
- {decktile-0.3.3 → decktile-0.3.5}/README.md +21 -10
- {decktile-0.3.3 → decktile-0.3.5}/pyproject.toml +2 -2
- decktile-0.3.5/src/decktile/chart_themes/kubecon_na.toml +30 -0
- decktile-0.3.5/src/decktile/chart_themes/ossummit_europe.toml +30 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/seaborn.py +54 -36
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_seaborn_styles.py +23 -8
- decktile-0.3.3/src/decktile/seaborn_styles/__init__.py +0 -9
- decktile-0.3.3/src/decktile/seaborn_styles/hami.py +0 -33
- decktile-0.3.3/src/decktile/seaborn_styles/kubecon_na.py +0 -35
- decktile-0.3.3/src/decktile/seaborn_styles/ossummit_europe.py +0 -34
- {decktile-0.3.3 → decktile-0.3.5}/LICENSE +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/NOTICE +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/__main__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/assets/lucide/VENDORED.md +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/assets/lucide/lucide.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/assets/lucide/lucide.ttf +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/cli.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/parser/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/parser/ast.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/parser/markdown.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/cards.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/directives.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/fenced.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/layouts.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/lucide.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/plugins/lucide_font.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/html.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/ir.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/odf/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/odf/geometry.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/odf/shapes.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/odf/styles.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/odp.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/pdf.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/pdg.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/templates/base.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/templates/decktile.js +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/render/templates/shell.html +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/theme/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/theme/loader.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/theme/parser.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/default.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/kcd_vietnam.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/kubecon_china.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/kubecon_japan.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/kubecon_na.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/ossummit_europe.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/src/decktile/themes/ossummit_korea.css +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/__init__.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_cli.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_geometry.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_html.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_ir.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_odf_shapes.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_odp.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_parser.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_pdg.py +0 -0
- {decktile-0.3.3 → decktile-0.3.5}/tests/test_video.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: decktile
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: Markdown to designed slides: HTML, PDF and editable ODP
|
|
5
5
|
Author-Email: Reza Jelveh <git@jelveh.me>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -20,7 +20,7 @@ Requires-Dist: pygments-styles>=0.3.0
|
|
|
20
20
|
Requires-Dist: odfdo>=3.27.2
|
|
21
21
|
Requires-Dist: mermaidx>=0.8.1
|
|
22
22
|
Requires-Dist: python-lucide>=0.5.0
|
|
23
|
-
Requires-Dist: predictygraph>=0.3.
|
|
23
|
+
Requires-Dist: predictygraph[icons]>=0.3.3
|
|
24
24
|
Provides-Extra: plot
|
|
25
25
|
Requires-Dist: pillow>=11.0.0; extra == "plot"
|
|
26
26
|
Requires-Dist: seaborn>=0.13.2; extra == "plot"
|
|
@@ -473,20 +473,31 @@ Pre-imported: `sns`, `plt`, `pd`, `np`. Set `seaborn_theme: kcd_vietnam` in
|
|
|
473
473
|
frontmatter to apply brand colors from the matching CSS theme file. Colors
|
|
474
474
|
and fonts are parsed from the `:root` block. Falls
|
|
475
475
|
back to seaborn palette names (`Paired` is the default, also `deep`,
|
|
476
|
-
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
477
|
-
matches the predictygraph `hami` diagram colours.
|
|
476
|
+
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
478
477
|
|
|
479
|
-
|
|
480
|
-
|
|
478
|
+
Chart themes are [predictygraph](https://github.com/predictygraph/predictygraph)
|
|
479
|
+
themes, the same TOML as a diagram's `theme=`, so one file styles both.
|
|
480
|
+
`seaborn_theme: hami` uses predictygraph's bundled `hami` theme; decktile adds
|
|
481
|
+
`kubecon_na` and `ossummit_europe`, and `PDG_THEME_PATH` directories are searched
|
|
482
|
+
too. The palette sets the chart: `fg` text, `muted` ticks, `border` axes, `bg`
|
|
483
|
+
background, `bg-alt` grid, and the hues (green, blue, cyan, ...) the colour cycle.
|
|
484
|
+
|
|
485
|
+
To keep a theme in your own repo, point `seaborn_theme` (and diagram `theme=`)
|
|
486
|
+
at a `.toml` file next to the deck. An optional `[seaborn]` table, ignored by
|
|
487
|
+
predictygraph, changes the colour order and sets any matplotlib rcParam;
|
|
488
|
+
values may name palette keys:
|
|
481
489
|
|
|
482
490
|
```toml
|
|
483
|
-
# brand.toml
|
|
484
|
-
|
|
491
|
+
# themes/brand.toml
|
|
492
|
+
schema = 1
|
|
493
|
+
extends = "hami"
|
|
494
|
+
|
|
495
|
+
[palette]
|
|
496
|
+
green = "#0f9d58"
|
|
485
497
|
|
|
486
|
-
[
|
|
487
|
-
"
|
|
488
|
-
"
|
|
489
|
-
"axes.facecolor" = "#ffffff"
|
|
498
|
+
[seaborn]
|
|
499
|
+
palette = ["green", "blue", "yellow"]
|
|
500
|
+
"grid.color" = "bg-alt"
|
|
490
501
|
```
|
|
491
502
|
|
|
492
503
|
```yaml
|
|
@@ -441,20 +441,31 @@ Pre-imported: `sns`, `plt`, `pd`, `np`. Set `seaborn_theme: kcd_vietnam` in
|
|
|
441
441
|
frontmatter to apply brand colors from the matching CSS theme file. Colors
|
|
442
442
|
and fonts are parsed from the `:root` block. Falls
|
|
443
443
|
back to seaborn palette names (`Paired` is the default, also `deep`,
|
|
444
|
-
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
445
|
-
matches the predictygraph `hami` diagram colours.
|
|
444
|
+
`muted`, `pastel`, etc.) if no theme CSS matches.
|
|
446
445
|
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
Chart themes are [predictygraph](https://github.com/predictygraph/predictygraph)
|
|
447
|
+
themes, the same TOML as a diagram's `theme=`, so one file styles both.
|
|
448
|
+
`seaborn_theme: hami` uses predictygraph's bundled `hami` theme; decktile adds
|
|
449
|
+
`kubecon_na` and `ossummit_europe`, and `PDG_THEME_PATH` directories are searched
|
|
450
|
+
too. The palette sets the chart: `fg` text, `muted` ticks, `border` axes, `bg`
|
|
451
|
+
background, `bg-alt` grid, and the hues (green, blue, cyan, ...) the colour cycle.
|
|
452
|
+
|
|
453
|
+
To keep a theme in your own repo, point `seaborn_theme` (and diagram `theme=`)
|
|
454
|
+
at a `.toml` file next to the deck. An optional `[seaborn]` table, ignored by
|
|
455
|
+
predictygraph, changes the colour order and sets any matplotlib rcParam;
|
|
456
|
+
values may name palette keys:
|
|
449
457
|
|
|
450
458
|
```toml
|
|
451
|
-
# brand.toml
|
|
452
|
-
|
|
459
|
+
# themes/brand.toml
|
|
460
|
+
schema = 1
|
|
461
|
+
extends = "hami"
|
|
462
|
+
|
|
463
|
+
[palette]
|
|
464
|
+
green = "#0f9d58"
|
|
453
465
|
|
|
454
|
-
[
|
|
455
|
-
"
|
|
456
|
-
"
|
|
457
|
-
"axes.facecolor" = "#ffffff"
|
|
466
|
+
[seaborn]
|
|
467
|
+
palette = ["green", "blue", "yellow"]
|
|
468
|
+
"grid.color" = "bg-alt"
|
|
458
469
|
```
|
|
459
470
|
|
|
460
471
|
```yaml
|
|
@@ -19,11 +19,11 @@ dependencies = [
|
|
|
19
19
|
"odfdo>=3.27.2",
|
|
20
20
|
"mermaidx>=0.8.1",
|
|
21
21
|
"python-lucide>=0.5.0",
|
|
22
|
-
"predictygraph>=0.3.
|
|
22
|
+
"predictygraph[icons]>=0.3.3",
|
|
23
23
|
]
|
|
24
24
|
requires-python = ">=3.11"
|
|
25
25
|
readme = "README.md"
|
|
26
|
-
version = "0.3.
|
|
26
|
+
version = "0.3.5"
|
|
27
27
|
|
|
28
28
|
[project.license]
|
|
29
29
|
text = "Apache-2.0"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# KubeCon NA 2026 title-slide colours, as a predictygraph theme (diagrams and charts).
|
|
6
|
+
schema = 1
|
|
7
|
+
name = "kubecon_na"
|
|
8
|
+
dark = false
|
|
9
|
+
|
|
10
|
+
[palette]
|
|
11
|
+
bg = "#ffffff"
|
|
12
|
+
surface = "#ffffff"
|
|
13
|
+
fg = "#052243"
|
|
14
|
+
muted = "#5A6F8E"
|
|
15
|
+
border = "#052243"
|
|
16
|
+
bg-alt = "#E3F6FF"
|
|
17
|
+
red = "#D62293"
|
|
18
|
+
orange = "#D62293"
|
|
19
|
+
yellow = "#E8C400"
|
|
20
|
+
green = "#2E9C68"
|
|
21
|
+
cyan = "#40BE95"
|
|
22
|
+
blue = "#113E82"
|
|
23
|
+
purple = "#D62293"
|
|
24
|
+
|
|
25
|
+
[shape]
|
|
26
|
+
font = "Roboto"
|
|
27
|
+
|
|
28
|
+
[seaborn]
|
|
29
|
+
palette = ["blue", "red", "green", "yellow", "cyan", "fg"]
|
|
30
|
+
"patch.edgecolor" = "#ffffff"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
# Open Source Summit Europe colours, as a predictygraph theme (diagrams and charts).
|
|
6
|
+
schema = 1
|
|
7
|
+
name = "ossummit_europe"
|
|
8
|
+
dark = false
|
|
9
|
+
|
|
10
|
+
[palette]
|
|
11
|
+
bg = "#ffffff"
|
|
12
|
+
surface = "#ffffff"
|
|
13
|
+
fg = "#003841"
|
|
14
|
+
muted = "#4F6F73"
|
|
15
|
+
border = "#003841"
|
|
16
|
+
bg-alt = "#EDF5F4"
|
|
17
|
+
red = "#E05845"
|
|
18
|
+
orange = "#E58570"
|
|
19
|
+
yellow = "#E58570"
|
|
20
|
+
green = "#0DA89D"
|
|
21
|
+
cyan = "#0DA89D"
|
|
22
|
+
blue = "#0A5560"
|
|
23
|
+
purple = "#0A5560"
|
|
24
|
+
|
|
25
|
+
[shape]
|
|
26
|
+
font = "Roboto"
|
|
27
|
+
|
|
28
|
+
[seaborn]
|
|
29
|
+
palette = ["red", "green", "blue", "orange", "fg"]
|
|
30
|
+
"patch.edgecolor" = "#ffffff"
|
|
@@ -10,20 +10,15 @@ SVG strings for both HTML inline and ODP embedding.
|
|
|
10
10
|
Only active when seaborn + matplotlib are installed (pdm install -G plot).
|
|
11
11
|
Falls back to plain code highlighting otherwise.
|
|
12
12
|
|
|
13
|
-
Theme support: the ``seaborn_theme`` frontmatter field
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parsed and mapped to matplotlib rcParams -- no hardcoded color duplication.
|
|
19
|
-
Style modules in ``decktile.seaborn_styles.<name>`` take precedence over CSS
|
|
20
|
-
and can set ``seaborn_palette`` to override the default ("Paired").
|
|
13
|
+
Theme support: the ``seaborn_theme`` frontmatter field takes a predictygraph
|
|
14
|
+
theme (the same TOML as diagram ``theme=``): a name from ``decktile/chart_themes``,
|
|
15
|
+
``PDG_THEME_PATH`` or predictygraph's bundled themes, or a ``.toml`` path next to
|
|
16
|
+
the deck. Without one, a decktile CSS theme ``decktile/themes/<name>.css`` is
|
|
17
|
+
parsed for colours, else the name is a seaborn palette ("Paired", "deep", ...).
|
|
21
18
|
"""
|
|
22
19
|
|
|
23
|
-
import importlib
|
|
24
20
|
import io
|
|
25
21
|
import re
|
|
26
|
-
import tomllib
|
|
27
22
|
from pathlib import Path
|
|
28
23
|
|
|
29
24
|
_DEFAULT_FIGSIZE = (6.4, 4.8)
|
|
@@ -78,13 +73,45 @@ def _css_theme_rcparams(name: str) -> dict | None:
|
|
|
78
73
|
return style
|
|
79
74
|
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
_CHART_THEMES = Path(__file__).parent.parent / "chart_themes"
|
|
77
|
+
_HUE_ORDER = ("green", "blue", "cyan", "yellow", "purple", "red", "orange")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _pdg_theme(name: str) -> dict | None:
|
|
81
|
+
"""A predictygraph theme (decktile's chart_themes, PDG_THEME_PATH, bundled, or a .toml path) as rcParams.
|
|
82
|
+
|
|
83
|
+
Palette roles drive the chart: fg = text, muted = ticks, border = axes, bg = background,
|
|
84
|
+
bg-alt = grid; hues in a fixed order are the colour cycle. An optional ``[seaborn]`` table
|
|
85
|
+
overrides that: ``palette`` (palette keys or hex) and any matplotlib rcParam.
|
|
86
|
+
"""
|
|
87
|
+
from predictygraph.theme import ThemeError, load_theme
|
|
88
|
+
|
|
89
|
+
local = _CHART_THEMES / f"{name}.toml"
|
|
90
|
+
if not local.is_file() and (_THEME_DIR / f"{name}.css").is_file():
|
|
91
|
+
return None # decktile CSS theme wins over a same-named predictygraph one (e.g. default)
|
|
92
|
+
try:
|
|
93
|
+
t = load_theme(str(local) if local.is_file() else name)
|
|
94
|
+
except ThemeError:
|
|
95
|
+
return None
|
|
96
|
+
pal = t.get("palette", {})
|
|
97
|
+
extra = dict(t.get("seaborn", {}))
|
|
98
|
+
order = extra.pop("palette", None) or [h for h in _HUE_ORDER if h in pal]
|
|
99
|
+
style = {
|
|
100
|
+
"seaborn_palette": [pal.get(c, c) for c in order],
|
|
101
|
+
"axes.facecolor": pal.get("surface", "#ffffff"),
|
|
102
|
+
"figure.facecolor": pal.get("bg", "#ffffff"),
|
|
103
|
+
"axes.edgecolor": pal.get("border"),
|
|
104
|
+
"grid.color": pal.get("bg-alt"),
|
|
105
|
+
"patch.force_edgecolor": True,
|
|
106
|
+
}
|
|
107
|
+
for rc in ("axes.labelcolor", "axes.titlecolor", "text.color"):
|
|
108
|
+
style[rc] = pal.get("fg")
|
|
109
|
+
for rc in ("xtick.color", "ytick.color"):
|
|
110
|
+
style[rc] = pal.get("muted")
|
|
111
|
+
if font := t.get("shape", {}).get("font"):
|
|
112
|
+
style |= {"font.family": "sans-serif", "font.sans-serif": [font, "Arial", "Helvetica", "sans-serif"]}
|
|
113
|
+
style |= {k: pal.get(v, v) if isinstance(v, str) else v for k, v in extra.items()}
|
|
114
|
+
return {k: v for k, v in style.items() if v is not None}
|
|
88
115
|
|
|
89
116
|
|
|
90
117
|
def _apply(style: dict) -> None:
|
|
@@ -102,32 +129,23 @@ def _apply(style: dict) -> None:
|
|
|
102
129
|
|
|
103
130
|
|
|
104
131
|
def set_theme(name: str) -> None:
|
|
105
|
-
"""Apply a
|
|
132
|
+
"""Apply a chart theme by name or ``.toml`` path.
|
|
106
133
|
|
|
107
|
-
Resolution order:
|
|
108
|
-
|
|
134
|
+
Resolution order: predictygraph theme (decktile chart_themes, PDG_THEME_PATH,
|
|
135
|
+
predictygraph bundled, ``.toml`` path) > decktile CSS theme > seaborn palette name.
|
|
109
136
|
"""
|
|
110
137
|
global _palette, _style
|
|
111
138
|
if not name:
|
|
112
139
|
name = _DEFAULT_PALETTE
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
140
|
+
style = _pdg_theme(name)
|
|
141
|
+
if style is None and name.endswith(".toml"):
|
|
142
|
+
raise FileNotFoundError(f"seaborn theme file not found: {name}")
|
|
143
|
+
if style is not None:
|
|
117
144
|
try:
|
|
118
|
-
_apply(_file_theme(path))
|
|
119
|
-
except ImportError:
|
|
120
|
-
_palette, _style = None, None
|
|
121
|
-
return
|
|
122
|
-
try:
|
|
123
|
-
# 1) style module (for custom overrides CSS can't express)
|
|
124
|
-
mod = importlib.import_module(f"decktile.seaborn_styles.{name}")
|
|
125
|
-
style = dict(getattr(mod, "STYLE", {}))
|
|
126
|
-
if style:
|
|
127
145
|
_apply(style)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
146
|
+
except ImportError: # charts are optional (decktile[plot])
|
|
147
|
+
_palette, _style = name, None
|
|
148
|
+
return
|
|
131
149
|
|
|
132
150
|
# 2) CSS theme file (single source of truth for brand colors)
|
|
133
151
|
css_style = _css_theme_rcparams(name)
|
|
@@ -142,23 +142,38 @@ class TestStyleModulePalette:
|
|
|
142
142
|
assert "#e05845" in svg.lower()
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
class
|
|
146
|
-
def
|
|
147
|
-
|
|
145
|
+
class TestPredictygraphThemes:
|
|
146
|
+
def test_hami_from_predictygraph(self):
|
|
147
|
+
import pytest
|
|
148
|
+
|
|
149
|
+
pytest.importorskip("seaborn")
|
|
150
|
+
import decktile.render.seaborn as sb
|
|
151
|
+
|
|
152
|
+
sb.set_theme("hami")
|
|
153
|
+
assert sb._palette[0] == "#16a34a"
|
|
154
|
+
assert sb._style["text.color"] == "#1e293b"
|
|
155
|
+
|
|
156
|
+
def test_kubecon_na_chart_theme(self):
|
|
157
|
+
import pytest
|
|
158
|
+
|
|
159
|
+
pytest.importorskip("seaborn")
|
|
160
|
+
import decktile.render.seaborn as sb
|
|
148
161
|
|
|
149
|
-
|
|
162
|
+
sb.set_theme("kubecon_na")
|
|
163
|
+
assert sb._palette[:2] == ["#113E82", "#D62293"]
|
|
164
|
+
assert sb._style["patch.edgecolor"] == "#ffffff"
|
|
150
165
|
|
|
151
|
-
def
|
|
166
|
+
def test_toml_file_extends_with_seaborn_section(self, tmp_path):
|
|
152
167
|
import pytest
|
|
153
168
|
|
|
154
169
|
pytest.importorskip("seaborn")
|
|
155
170
|
import decktile.render.seaborn as sb
|
|
156
171
|
|
|
157
172
|
f = tmp_path / "brand.toml"
|
|
158
|
-
f.write_text('
|
|
173
|
+
f.write_text('schema = 1\nextends = "hami"\n[seaborn]\npalette = ["blue", "#112233"]\n"grid.color" = "muted"\n')
|
|
159
174
|
sb.set_theme(str(f))
|
|
160
|
-
assert sb._palette == ["#
|
|
161
|
-
assert sb._style["
|
|
175
|
+
assert sb._palette == ["#2563eb", "#112233"]
|
|
176
|
+
assert sb._style["grid.color"] == "#64748b"
|
|
162
177
|
|
|
163
178
|
def test_missing_toml_theme_file(self, tmp_path):
|
|
164
179
|
import pytest
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style modules for decktile themes.
|
|
6
|
-
|
|
7
|
-
Each module exports a STYLE dict of matplotlib rcParams.
|
|
8
|
-
Named to match the CSS theme it pairs with (e.g. kcd_vietnam.css -> kcd_vietnam).
|
|
9
|
-
"""
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style matching the HAMi diagrams (predictygraph theme ``hami``).
|
|
6
|
-
|
|
7
|
-
HAMi green #16a34a, blue #2563eb, text #1e293b, muted #64748b, border #cbd5e1.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
PALETTE = [
|
|
11
|
-
"#16a34a", # HAMi green
|
|
12
|
-
"#2563eb", # blue
|
|
13
|
-
"#0891b2", # cyan
|
|
14
|
-
"#ca8a04", # yellow
|
|
15
|
-
"#7c3aed", # purple
|
|
16
|
-
"#dc2626", # red
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
STYLE = {
|
|
20
|
-
"seaborn_palette": PALETTE,
|
|
21
|
-
"font.family": "sans-serif",
|
|
22
|
-
"font.sans-serif": ["Source Sans 3", "Source Sans Pro", "Arial", "Helvetica", "Liberation Sans", "sans-serif"],
|
|
23
|
-
"axes.facecolor": "#ffffff",
|
|
24
|
-
"axes.edgecolor": "#cbd5e1",
|
|
25
|
-
"axes.labelcolor": "#1e293b",
|
|
26
|
-
"axes.titlecolor": "#1e293b",
|
|
27
|
-
"text.color": "#1e293b",
|
|
28
|
-
"figure.facecolor": "#ffffff",
|
|
29
|
-
"xtick.color": "#64748b",
|
|
30
|
-
"ytick.color": "#64748b",
|
|
31
|
-
"grid.color": "#f1f5f9",
|
|
32
|
-
"patch.edgecolor": "#16a34a",
|
|
33
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style for the KubeCon NA 2026 theme.
|
|
6
|
-
|
|
7
|
-
Colors from the Title slide: blue #113E82, magenta #D62293, green #2E9C68,
|
|
8
|
-
yellow #E8C400 (darkened #FFEE88 so it reads on white), navy #052243.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
PALETTE = [
|
|
12
|
-
"#113E82", # blue, primary
|
|
13
|
-
"#D62293", # magenta
|
|
14
|
-
"#2E9C68", # green
|
|
15
|
-
"#E8C400", # yellow
|
|
16
|
-
"#40BE95", # mint
|
|
17
|
-
"#052243", # navy
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
STYLE = {
|
|
21
|
-
"seaborn_palette": PALETTE,
|
|
22
|
-
"font.family": "sans-serif",
|
|
23
|
-
"font.sans-serif": ["Roboto", "Arial", "Helvetica Neue", "sans-serif"],
|
|
24
|
-
"axes.facecolor": "#ffffff",
|
|
25
|
-
"axes.edgecolor": "#052243",
|
|
26
|
-
"axes.labelcolor": "#052243",
|
|
27
|
-
"axes.titlecolor": "#052243",
|
|
28
|
-
"text.color": "#052243",
|
|
29
|
-
"figure.facecolor": "#ffffff",
|
|
30
|
-
"xtick.color": "#5A6F8E",
|
|
31
|
-
"ytick.color": "#5A6F8E",
|
|
32
|
-
"grid.color": "#E3F6FF",
|
|
33
|
-
"patch.edgecolor": "#ffffff",
|
|
34
|
-
"patch.force_edgecolor": True,
|
|
35
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2026 Reza Jelveh
|
|
2
|
-
#
|
|
3
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
|
|
5
|
-
"""Seaborn/matplotlib style for the Open Source Summit Europe theme.
|
|
6
|
-
|
|
7
|
-
Brand palette: coral #E05845, green #0DA89D, teal #0A5560,
|
|
8
|
-
light coral #E58570, dark navy #003841. Background #ffffff.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
PALETTE = [
|
|
12
|
-
"#E05845", # coral, primary accent
|
|
13
|
-
"#0DA89D", # green, secondary accent
|
|
14
|
-
"#0A5560", # teal
|
|
15
|
-
"#E58570", # light coral, gradient end
|
|
16
|
-
"#003841", # dark navy, contrast
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
STYLE = {
|
|
20
|
-
"seaborn_palette": PALETTE,
|
|
21
|
-
"font.family": "sans-serif",
|
|
22
|
-
"font.sans-serif": ["Roboto", "Arial", "Helvetica Neue", "sans-serif"],
|
|
23
|
-
"axes.facecolor": "#ffffff",
|
|
24
|
-
"axes.edgecolor": "#003841",
|
|
25
|
-
"axes.labelcolor": "#003841",
|
|
26
|
-
"axes.titlecolor": "#003841",
|
|
27
|
-
"text.color": "#003841",
|
|
28
|
-
"figure.facecolor": "#ffffff",
|
|
29
|
-
"xtick.color": "#4F6F73",
|
|
30
|
-
"ytick.color": "#4F6F73",
|
|
31
|
-
"grid.color": "#EDF5F4",
|
|
32
|
-
"patch.edgecolor": "#ffffff",
|
|
33
|
-
"patch.force_edgecolor": True,
|
|
34
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|