Coverage for app / documents / visuals / mermaid / look.py: 100%

32 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-10-31 11:23 +0000

1"""How a Mermaid diagram looks in the PDF: Mermaid's default (light) theme, 

2so a diagram keeps its colours from the chat's light mode (fe-core 

3initialises Mermaid with ``theme: "default"``), and the sizes it is laid out 

4at before the page scales it.""" 

5 

6from __future__ import annotations 

7 

8from reportlab.lib.colors import HexColor 

9 

10NODE_FILL = HexColor("#ECECFF") 

11NODE_STROKE = HexColor("#9370DB") 

12CLUSTER_FILL = HexColor("#ffffde") 

13CLUSTER_STROKE = HexColor("#aaaa33") 

14LINE = HexColor("#333333") 

15TEXT = HexColor("#333333") 

16EDGE_LABEL = HexColor("#e8e8e8") 

17NOTE_FILL = HexColor("#fff5ad") 

18NOTE_STROKE = HexColor("#aaaa33") 

19#: A class diagram's and an ER diagram's header band. 

20HEADER_FILL = HexColor("#e2e2fb") 

21ROW_ODD = HexColor("#ffffff") 

22ROW_EVEN = HexColor("#f2f2f2") 

23COMPOSITE_FILL = HexColor("#ffffff") 

24SPECIAL = HexColor("#333333") 

25WHITE = HexColor("#ffffff") 

26 

27#: Text, in points: Mermaid's 16 px is 12 pt, a little large for a page. 

28FONT_SIZE = 9.5 

29SMALL_SIZE = 8.0 

30LINE_HEIGHT = 1.25 

31#: The widest a line of a label runs before it wraps, and the most lines. 

32MAX_LINE_WIDTH = 170.0 

33MAX_LINES = 8 

34 

35#: Gaps, in points: between nodes in a row, between rows, between edges. 

36NODE_SEP = 24.0 

37RANK_SEP = 30.0 

38EDGE_SEP = 8.0 

39#: Inside a node, around its label. 

40PAD_X = 9.0 

41PAD_Y = 6.0 

42#: Inside a cluster, around what it holds. 

43CLUSTER_PAD = 10.0 

44 

45NODE_STROKE_WIDTH = 0.9 

46EDGE_WIDTH = 0.9 

47THICK_EDGE_WIDTH = 2.0 

48DOTTED = (2.0, 2.0)