Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pytest-8.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ouhammmourachid authored Sep 27, 2024
2 parents 61a29d4 + 9a5c872 commit c5eb367
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 50 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ diagram
- [ ] [Sankey](https://mermaid.js.org/syntax/sankey.html)
- [ ] [XYChart 🔥](https://mermaid.js.org/syntax/xyChart.html)
- [ ] [Block Diagram 🔥](https://mermaid.js.org/syntax/block.html)
- [ ] [Packet 🔥](https://mermaid.js.org/syntax/packet.html)
- [ ] [Architecture 🔥](https://mermaid.js.org/syntax/architecture.html)

## License

Expand Down
26 changes: 14 additions & 12 deletions mermaid/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,20 @@ def __str__(self) -> str:
string: str = "%%{\n\tinit: {\n"

string += f'\t\t"theme": "{self.theme.value}",\n\t\t"themeVariables": ' + "{\n"
if self.primary_color:
string += f'\t\t\t"primaryColor": "{self.primary_color}",\n'
if self.primary_text_color:
string += f'\t\t\t"primaryTextColor": "{self.primary_text_color}",\n'
if self.primary_border_color:
string += f'\t\t\t"primaryBorderColor": "{self.primary_border_color}",\n'
if self.line_color:
string += f'\t\t\t"lineColor": "{self.line_color}",\n'
if self.secondary_color:
string += f'\t\t\t"secondaryColor": "{self.secondary_color}",\n'
if self.tertiary_color:
string += f'\t\t\t"tertiaryColor": "{self.tertiary_color}",\n'
string += "".join(
[
f'\t\t\t"{style}": "{value}",\n'
for style, value in [
("primaryColor", self.primary_color),
("primaryTextColor", self.primary_text_color),
("primaryBorderColor", self.primary_border_color),
("lineColor", self.line_color),
("secondaryColor", self.secondary_color),
("tertiaryColor", self.tertiary_color),
]
if value
]
)
if string.endswith(",\n"):
string = string[:-2] + "\n"
string += "\t\t}\n"
Expand Down
18 changes: 10 additions & 8 deletions mermaid/reqdiagram/requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ def __init__(
)

def __str__(self) -> str:
string: str = ""
string += f"{self.type_} {self.name} {{\n"
string += f"\tid: {self.id_}\n"
string += f"\ttext: {self.text}\n"
string += f"\trisk: {self.risk}\n"
string += f"\tverifymethod: {self.verifymethod}\n"
string += "}\n"
return string
return "".join(
[
f"{self.type_} {self.name} {{\n",
f"\tid: {self.id_}\n",
f"\ttext: {self.text}\n",
f"\trisk: {self.risk}\n",
f"\tverifymethod: {self.verifymethod}\n",
"}\n",
]
)
24 changes: 13 additions & 11 deletions mermaid/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@ class Style:
def __str__(self) -> str:
"""Return the string representation of the style definition."""
string: str = f"classDef {self.name} "
if self.fill:
string += f",fill:{self.fill}"
if self.color:
string += f",color:{self.color}"
if self.font_weight:
string += f",font-weight:{self.font_weight}"
if self.stroke_width:
string += f",stroke-width:{self.stroke_width}"
if self.stroke:
string += f",stroke:{self.stroke}"
string += "".join(
[
f",{style}:{value}"
for style, value in [
("fill", self.fill),
("color", self.color),
("font-weight", self.font_weight),
("stroke-width", self.stroke_width),
("stroke", self.stroke),
]
if value is not None
]
)
if self.other:
string += f",{self.other}"

return string

def __hash__(self) -> int:
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5eb367

Please sign in to comment.