Skip to content

Commit de97845

Browse files
feat(#1532): default diagram theme to 'auto'; sans schema labels
Make 'auto' (adaptive light/dark SVG) the default diagram_theme, so rendered diagrams adapt to the viewer's appearance out of the box. Also set the schema cluster label to Helvetica — it previously fell back to Graphviz's Times default while the node labels were already sans.
1 parent 378caf6 commit de97845

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/datajoint/diagram.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,7 @@ def _master_of(part_stripped):
16911691
style="rounded,dashed",
16921692
color=sc_color,
16931693
fontcolor=sc_fontcolor,
1694+
fontname="Helvetica", # schema label in a sans font, not Graphviz's Times default
16941695
)
16951696
node_by_name = {n.get_name().strip('"'): n for n in nodes}
16961697
# masters in this schema that have at least one part present

src/datajoint/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ class DisplaySettings(BaseSettings):
247247
description="Default diagram layout direction: 'TB' (top-to-bottom) or 'LR' (left-to-right)",
248248
)
249249
diagram_theme: Literal["light", "dark", "auto"] = Field(
250-
default="light",
250+
default="auto",
251251
validation_alias="DJ_DIAGRAM_THEME",
252252
description=(
253-
"Default diagram color theme: 'light', 'dark' (dark background with adjusted palette), "
254-
"or 'auto' (single SVG that adapts to the viewer's light/dark mode)"
253+
"Default diagram color theme: 'auto' (single SVG that adapts to the viewer's light/dark "
254+
"mode; default), 'light', or 'dark' (dark background with adjusted palette)"
255255
),
256256
)
257257

0 commit comments

Comments
 (0)